File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11using Terminal . Gui ;
2- using Attribute = Terminal . Gui . Attribute ;
32
43namespace Opcilloscope . App . Themes ;
54
@@ -82,10 +81,10 @@ public class TerminalTheme : AppTheme
8281
8382 // Override color schemes - focus highlight uses a DarkGray band since
8483 // panel-background shades are not available in the 16-color palette
85- private ColorScheme ? _mainColorScheme ;
86- private ColorScheme ? _menuColorScheme ;
84+ private Scheme ? _mainColorScheme ;
85+ private Scheme ? _menuColorScheme ;
8786
88- public override ColorScheme MainColorScheme => _mainColorScheme ??= new ( )
87+ public override Scheme MainColorScheme => _mainColorScheme ??= new ( )
8988 {
9089 Normal = NormalAttr ,
9190 Focus = new Attribute ( ForegroundBright , new Color ( ColorName16 . DarkGray ) ) ,
@@ -94,7 +93,7 @@ public class TerminalTheme : AppTheme
9493 Disabled = new Attribute ( StatusInactive , Background )
9594 } ;
9695
97- public override ColorScheme MenuColorScheme => _menuColorScheme ??= new ( )
96+ public override Scheme MenuColorScheme => _menuColorScheme ??= new ( )
9897 {
9998 Normal = NormalAttr ,
10099 Focus = new Attribute ( Background , Foreground ) , // Inverted for menu focus
Original file line number Diff line number Diff line change @@ -82,10 +82,8 @@ public static void SetTheme(AppTheme theme)
8282 /// </summary>
8383 private static void ApplyTerminalColorMode ( AppTheme theme )
8484 {
85- Application . Force16Colors = theme . UseTerminalColors ;
86-
87- // The v2 facade driver caches its own flag rather than reading
88- // Application.Force16Colors, so propagate explicitly when running
85+ // Terminal.Gui 2.4 removed the static Application.Force16Colors;
86+ // the flag now lives on the driver itself.
8987 if ( Application . Driver is { } driver )
9088 {
9189 driver . Force16Colors = theme . UseTerminalColors ;
Original file line number Diff line number Diff line change @@ -123,22 +123,25 @@ public void ThemeManager_SetThemeByName_WithInvalidName_DoesNothing()
123123 }
124124
125125 [ Fact ]
126- public void ThemeManager_SetTerminalTheme_TogglesForce16Colors ( )
126+ public void ThemeManager_SetTerminalTheme_TogglesTerminalColorMode ( )
127127 {
128+ // Terminal.Gui 2.4 removed the static Application.Force16Colors; the flag now
129+ // lives on Application.Driver, which is null in headless tests. Assert on the
130+ // theme property that ThemeManager propagates to the driver when one exists.
128131 try
129132 {
130133 // Act - Terminal theme enables 16-color ANSI output
131134 ThemeManager . SetTheme ( "Terminal" ) ;
132135
133136 // Assert
134137 Assert . IsType < TerminalTheme > ( ThemeManager . Current ) ;
135- Assert . True ( Terminal . Gui . Application . Force16Colors ) ;
138+ Assert . True ( ThemeManager . Current . UseTerminalColors ) ;
136139
137140 // Act - switching back restores 24-bit color output
138141 ThemeManager . SetTheme ( "Dark" ) ;
139142
140143 // Assert
141- Assert . False ( Terminal . Gui . Application . Force16Colors ) ;
144+ Assert . False ( ThemeManager . Current . UseTerminalColors ) ;
142145 }
143146 finally
144147 {
Original file line number Diff line number Diff line change @@ -38,12 +38,12 @@ public void ButtonScheme_IsADistinctScheme(AppTheme theme)
3838 }
3939
4040 [ Fact ]
41- public void ThemeStyler_ApplyTo_SetsTheViewScheme ( )
41+ public void ThemeStyler_ApplyToFrame_SetsTheViewScheme ( )
4242 {
4343 var theme = new DarkTheme ( ) ;
44- var view = new View ( ) ;
44+ var view = new FrameView ( ) ;
4545
46- ThemeStyler . ApplyTo ( view , theme ) ;
46+ ThemeStyler . ApplyToFrame ( view , theme ) ;
4747
4848 Scheme ? applied = view . GetScheme ( ) ;
4949 Assert . NotNull ( applied ) ;
You can’t perform that action at this time.
0 commit comments