Skip to content

Commit 5bb41ed

Browse files
committed
ux: new style for NumericUpDown
1 parent 6974b0e commit 5bb41ed

File tree

2 files changed

+25
-28
lines changed

2 files changed

+25
-28
lines changed

src/Resources/Styles.axaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,11 @@
2626
<Setter Property="ExtendClientAreaToDecorationsHint" Value="True"/>
2727
<Setter Property="SystemDecorations" Value="Full"/>
2828
<Setter Property="Padding" Value="0"/>
29+
30+
<Style.Resources>
31+
<SolidColorBrush x:Key="SystemControlErrorTextForegroundBrush" Color="Red"/>
32+
<SolidColorBrush x:Key="SystemErrorTextColor" Color="Red"/>
33+
</Style.Resources>
2934
</Style>
3035

3136
<Style Selector="Window[WindowState=Maximized]">
@@ -1294,4 +1299,22 @@
12941299
<Style Selector="TreeDataGridExpanderCell[IsExpanded=False] Path.folder_icon">
12951300
<Setter Property="Data" Value="{StaticResource Icons.Folder.Fill}"/>
12961301
</Style>
1302+
1303+
<Style Selector="NumericUpDown">
1304+
<Style Selector="^ /template/ ButtonSpinner#PART_Spinner">
1305+
<Setter Property="MinHeight" Value="0"/>
1306+
<Setter Property="Height" Value="28"/>
1307+
</Style>
1308+
<Style Selector="^ /template/ TextBox#PART_TextBox">
1309+
<Setter Property="MinHeight" Value="0"/>
1310+
<Setter Property="Height" Value="28"/>
1311+
<Setter Property="VerticalContentAlignment" Value="Center"/>
1312+
</Style>
1313+
<Style Selector="^:focus-within /template/ ButtonSpinner#PART_Spinner">
1314+
<Setter Property="BorderBrush" Value="{DynamicResource Brush.Accent}"/>
1315+
</Style>
1316+
<Style Selector="^ /template/ TextBox#PART_TextBox /template/ Border#PART_BorderElement">
1317+
<Setter Property="IsVisible" Value="False"/>
1318+
</Style>
1319+
</Style>
12971320
</Styles>

src/Views/Preference.axaml

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -200,20 +200,7 @@
200200
Padding="4"
201201
BorderThickness="1" BorderBrush="{DynamicResource Brush.Border1}"
202202
CornerRadius="3"
203-
Value="{Binding DefaultFontSize, Mode=TwoWay}">
204-
<NumericUpDown.Styles>
205-
<Style Selector="NumericUpDown /template/ ButtonSpinner#PART_Spinner">
206-
<Setter Property="MinHeight" Value="0"/>
207-
<Setter Property="Height" Value="28"/>
208-
</Style>
209-
<Style Selector="NumericUpDown /template/ TextBox#PART_TextBox">
210-
<Setter Property="MinHeight" Value="0"/>
211-
<Setter Property="Height" Value="28"/>
212-
<Setter Property="VerticalContentAlignment" Value="Center"/>
213-
<Setter Property="CornerRadius" Value="3,0,0,3"/>
214-
</Style>
215-
</NumericUpDown.Styles>
216-
</NumericUpDown>
203+
Value="{Binding DefaultFontSize, Mode=TwoWay}"/>
217204

218205
<TextBlock Grid.Row="4" Grid.Column="0"
219206
Text="{DynamicResource Text.Preference.Appearance.ColorOverrides}"
@@ -382,20 +369,7 @@
382369
CornerRadius="3"
383370
ParsingNumberStyle="Integer"
384371
FormatString="0"
385-
Value="{Binding GitAutoFetchInterval, Mode=TwoWay, FallbackValue=10}">
386-
<NumericUpDown.Styles>
387-
<Style Selector="NumericUpDown /template/ ButtonSpinner#PART_Spinner">
388-
<Setter Property="MinHeight" Value="0"/>
389-
<Setter Property="Height" Value="28"/>
390-
</Style>
391-
<Style Selector="NumericUpDown /template/ TextBox#PART_TextBox">
392-
<Setter Property="MinHeight" Value="0"/>
393-
<Setter Property="Height" Value="28"/>
394-
<Setter Property="VerticalContentAlignment" Value="Center"/>
395-
<Setter Property="CornerRadius" Value="3,0,0,3"/>
396-
</Style>
397-
</NumericUpDown.Styles>
398-
</NumericUpDown>
372+
Value="{Binding GitAutoFetchInterval, Mode=TwoWay, FallbackValue=10}"/>
399373

400374
<TextBlock Grid.Column="1"
401375
VerticalAlignment="Center"

0 commit comments

Comments
 (0)