Skip to content

Commit f4c4c5e

Browse files
committed
ux: style for auto fetch interval input widget (#123)
1 parent 51d401b commit f4c4c5e

File tree

3 files changed

+18
-3
lines changed

3 files changed

+18
-3
lines changed

src/Resources/Locales/en_US.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@
275275
<x:String x:Key="Text.Preference.Git" xml:space="preserve">GIT</x:String>
276276
<x:String x:Key="Text.Preference.Git.AutoFetch" xml:space="preserve">Fetch remotes automatically</x:String>
277277
<x:String x:Key="Text.Preference.Git.AutoFetchInterval" xml:space="preserve">Auto Fetch Interval</x:String>
278+
<x:String x:Key="Text.Preference.Git.AutoFetchIntervalSuffix" xml:space="preserve">Minute(s)</x:String>
278279
<x:String x:Key="Text.Preference.Git.CRLF" xml:space="preserve">Enable Auto CRLF</x:String>
279280
<x:String x:Key="Text.Preference.Git.DefaultCloneDir" xml:space="preserve">Default Clone Dir</x:String>
280281
<x:String x:Key="Text.Preference.Git.Email" xml:space="preserve">User Email</x:String>

src/Resources/Locales/zh_CN.axaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,7 @@
275275
<x:String x:Key="Text.Preference.Git" xml:space="preserve">GIT配置</x:String>
276276
<x:String x:Key="Text.Preference.Git.AutoFetch" xml:space="preserve">启用定时自动拉取远程更新</x:String>
277277
<x:String x:Key="Text.Preference.Git.AutoFetchInterval" xml:space="preserve">自动拉取间隔</x:String>
278+
<x:String x:Key="Text.Preference.Git.AutoFetchIntervalSuffix" xml:space="preserve">分钟</x:String>
278279
<x:String x:Key="Text.Preference.Git.CRLF" xml:space="preserve">自动换行转换</x:String>
279280
<x:String x:Key="Text.Preference.Git.DefaultCloneDir" xml:space="preserve">默认克隆路径</x:String>
280281
<x:String x:Key="Text.Preference.Git.Email" xml:space="preserve">邮箱</x:String>

src/Views/Preference.axaml

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -231,7 +231,7 @@
231231
<TextBlock Classes="tab_header" Text="{DynamicResource Text.Preference.Git}"/>
232232
</TabItem.Header>
233233

234-
<Grid Margin="8" RowDefinitions="32,32,Auto,32,32,32,32,32,32" ColumnDefinitions="Auto,*">
234+
<Grid Margin="8" RowDefinitions="32,32,Auto,32,32,32,32,32,Auto" ColumnDefinitions="Auto,*">
235235
<TextBlock Grid.Row="0" Grid.Column="0"
236236
Text="{DynamicResource Text.Preference.Git.Path}"
237237
HorizontalAlignment="Right"
@@ -357,7 +357,7 @@
357357
Text="{DynamicResource Text.Preference.Git.AutoFetchInterval}"
358358
HorizontalAlignment="Right"
359359
Margin="0,0,16,0"/>
360-
<Grid Grid.Row="8" Grid.Column="1" ColumnDefinitions="*,Auto" IsVisible="{Binding GitAutoFetch}">
360+
<Grid Grid.Row="8" Grid.Column="1" Height="32" ColumnDefinitions="*,Auto" IsVisible="{Binding GitAutoFetch}">
361361
<NumericUpDown Grid.Column="0"
362362
Minimum="1" Maximum="60" Increment="1"
363363
Height="28"
@@ -367,11 +367,24 @@
367367
ParsingNumberStyle="Integer"
368368
FormatString="0"
369369
Value="{Binding GitAutoFetchInterval, Mode=TwoWay, FallbackValue=10}">
370+
<NumericUpDown.Styles>
371+
<Style Selector="NumericUpDown /template/ ButtonSpinner#PART_Spinner">
372+
<Setter Property="MinHeight" Value="0"/>
373+
<Setter Property="Height" Value="28"/>
374+
</Style>
375+
<Style Selector="NumericUpDown /template/ TextBox#PART_TextBox">
376+
<Setter Property="MinHeight" Value="0"/>
377+
<Setter Property="Height" Value="28"/>
378+
<Setter Property="VerticalContentAlignment" Value="Center"/>
379+
<Setter Property="CornerRadius" Value="3,0,0,3"/>
380+
</Style>
381+
</NumericUpDown.Styles>
370382
</NumericUpDown>
383+
371384
<TextBlock Grid.Column="1"
372385
VerticalAlignment="Center"
373386
Margin="5,0,0,0"
374-
Text="min (1-60)" />
387+
Text="{DynamicResource Text.Preference.Git.AutoFetchIntervalSuffix}" />
375388
</Grid>
376389
</Grid>
377390
</TabItem>

0 commit comments

Comments
 (0)