Restore green/red/blue run status colours
The Material cleanup mapped run states to theme roles, which made succeeded runs use tertiary (reddish in the app theme).
This commit is contained in:
@@ -33,16 +33,19 @@ class RunStatusIcon extends StatelessWidget {
|
||||
}
|
||||
}
|
||||
|
||||
/// The dynamic colour for a run state, shared by every status glyph.
|
||||
/// The colour for a run state, shared by every status glyph: green
|
||||
/// succeeded, red failed, blue running, yellow waiting, orange interrupted,
|
||||
/// grey otherwise, each with a brighter dark-mode shade.
|
||||
Color runStatusColor(String state, [ColorScheme? colorScheme]) {
|
||||
final scheme = colorScheme ?? const ColorScheme.light();
|
||||
final dark = (colorScheme?.brightness ?? Brightness.light) == Brightness.dark;
|
||||
return switch (state) {
|
||||
'succeeded' => scheme.tertiary,
|
||||
'failed' => scheme.error,
|
||||
'running' || 'active' => scheme.primary,
|
||||
'waiting' => scheme.secondary,
|
||||
'interrupted' => scheme.tertiary,
|
||||
_ => scheme.onSurfaceVariant,
|
||||
'succeeded' => dark ? const Color(0xFF30D158) : const Color(0xFF34C759),
|
||||
'failed' => dark ? const Color(0xFFFF453A) : const Color(0xFFFF3B30),
|
||||
'running' ||
|
||||
'active' => dark ? const Color(0xFF0A84FF) : const Color(0xFF007AFF),
|
||||
'waiting' => dark ? const Color(0xFFFFD60A) : const Color(0xFFFFCC00),
|
||||
'interrupted' => dark ? const Color(0xFFFF9F0A) : const Color(0xFFFF9500),
|
||||
_ => const Color(0xFF8E8E93),
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user