Skip to content

Commit 1c507ac

Browse files
authored
Feature/avalonia Ubuntu color issue and slider tweaks (#188)
* Override a default color so slider looks same on all platforms * Tweak slider layout to vertically align with other controls * Tweak slider disabled color
1 parent a74527c commit 1c507ac

2 files changed

Lines changed: 28 additions & 1 deletion

File tree

src/apps/Avalonia/Highbyte.DotNet6502.App.Avalonia.Core/App.axaml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,15 @@
2424
<SolidColorBrush x:Key="WarningColor">#B89D5F</SolidColorBrush>
2525
<SolidColorBrush x:Key="DangerColor">#A85E5E</SolidColorBrush>
2626
<SolidColorBrush x:Key="BorderColor">#4A5566</SolidColorBrush>
27+
2728
</Application.Resources>
2829

2930
<Application.Styles>
30-
<FluentTheme />
31+
<FluentTheme>
32+
<FluentTheme.Palettes>
33+
<ColorPaletteResources x:Key="Dark" Accent="#6B8CAE" />
34+
</FluentTheme.Palettes>
35+
</FluentTheme>
3136

3237
<!-- Include style files organized by control type -->
3338
<StyleInclude Source="avares://Highbyte.DotNet6502.App.Avalonia.Core/Styles/TextStyles.axaml"/>

src/apps/Avalonia/Highbyte.DotNet6502.App.Avalonia.Core/Styles/InputStyles.axaml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -188,8 +188,19 @@
188188
<!-- ========================================== -->
189189

190190
<Style Selector="Slider">
191+
<Style.Resources>
192+
<GridLength x:Key="SliderPreContentMargin">6</GridLength>
193+
<GridLength x:Key="SliderPostContentMargin">0</GridLength>
194+
<x:Double x:Key="SliderHorizontalHeight">20</x:Double>
195+
</Style.Resources>
191196
<Setter Property="Foreground" Value="{DynamicResource AccentBlue}"/>
192197
<Setter Property="VerticalAlignment" Value="Center"/>
198+
<Setter Property="Margin" Value="0"/>
199+
</Style>
200+
201+
<Style Selector="Slider.small">
202+
<Setter Property="MinHeight" Value="20"/>
203+
<Setter Property="Height" Value="20"/>
193204
</Style>
194205

195206
<Style Selector="Slider /template/ Thumb">
@@ -205,6 +216,17 @@
205216
<Setter Property="Height" Value="10"/>
206217
</Style>
207218

219+
<!-- Override disabled colors to be more visible on dark background -->
220+
<Style Selector="Slider:disabled /template/ Thumb">
221+
<Setter Property="Background" Value="{DynamicResource BorderColor}"/>
222+
</Style>
223+
<Style Selector="Slider:disabled /template/ RepeatButton#PART_DecreaseButton">
224+
<Setter Property="Background" Value="{DynamicResource BorderColor}"/>
225+
</Style>
226+
<Style Selector="Slider:disabled /template/ RepeatButton#PART_IncreaseButton">
227+
<Setter Property="Background" Value="{DynamicResource BorderColor}"/>
228+
</Style>
229+
208230
<Style Selector="Slider.small">
209231
<Setter Property="MinHeight" Value="20"/>
210232
<Setter Property="Height" Value="20"/>

0 commit comments

Comments
 (0)