Skip to content

Commit 1133c29

Browse files
committed
ux: accent button style
Signed-off-by: leo <[email protected]>
1 parent 13c40da commit 1133c29

File tree

3 files changed

+61
-57
lines changed

3 files changed

+61
-57
lines changed

src/Resources/Styles.axaml

Lines changed: 3 additions & 55 deletions
Original file line numberDiff line numberDiff line change
@@ -510,79 +510,27 @@
510510
<Setter Property="Background" Value="Transparent"/>
511511
</Style>
512512
<Style Selector="Button.flat.primary">
513+
<Setter Property="Foreground" Value="{DynamicResource AccentButtonForeground}"/>
513514
<Setter Property="BorderBrush" Value="{DynamicResource AccentButtonBorderBrush}"/>
514515
<Setter Property="Background" Value="{DynamicResource AccentButtonBackground}"/>
515516
</Style>
516517
<Style Selector="Button.flat.primary:pointerover /template/ Border#PART_Border">
517518
<Setter Property="Background" Value="{DynamicResource AccentButtonBackgroundPointerOver}"/>
518519
</Style>
519520
<Style Selector="Button.flat.primary:pointerover /template/ ContentPresenter#PART_ContentPresenter">
521+
<Setter Property="Foreground" Value="{DynamicResource AccentButtonForeground}"/>
520522
<Setter Property="Background" Value="Transparent"/>
521523
</Style>
522524
<Style Selector="Button.flat.primary:disabled">
523525
<Setter Property="Opacity" Value=".65"/>
524526
</Style>
525-
<Style Selector="Button.flat.primary TextBlock">
527+
<Style Selector="Button.flat.primary:disabled /template/ ContentPresenter#PART_ContentPresenter">
526528
<Setter Property="Foreground" Value="{DynamicResource AccentButtonForeground}"/>
527529
</Style>
528530
<Style Selector="Button.flat.primary ToolTip TextBlock">
529531
<Setter Property="Foreground" Value="{DynamicResource Brush.FG1}"/>
530532
</Style>
531533

532-
<Style Selector="SplitButton">
533-
<Setter Property="MinHeight" Value="24"/>
534-
<Setter Property="Template">
535-
<ControlTemplate>
536-
<Grid ColumnDefinitions="*,1,Auto">
537-
<Button x:Name="PART_PrimaryButton"
538-
Grid.Column="0"
539-
Classes="flat primary"
540-
MinWidth="32"
541-
HorizontalAlignment="Stretch"
542-
VerticalAlignment="Stretch"
543-
Content="{TemplateBinding Content}"
544-
ContentTemplate="{TemplateBinding ContentTemplate}"
545-
Command="{TemplateBinding Command}"
546-
CommandParameter="{TemplateBinding CommandParameter}"
547-
CornerRadius="3,0,0,3"
548-
Padding="{TemplateBinding Padding}"
549-
Focusable="False"
550-
KeyboardNavigation.IsTabStop="False" />
551-
552-
<Button x:Name="PART_SecondaryButton"
553-
Grid.Column="2"
554-
Classes="flat primary"
555-
Width="32"
556-
CornerRadius="0,3,3,0"
557-
Padding="0"
558-
Focusable="False"
559-
HorizontalAlignment="Stretch"
560-
VerticalAlignment="Stretch"
561-
KeyboardNavigation.IsTabStop="False">
562-
<Path Height="12" Width="12"
563-
Margin="0,4,0,0"
564-
Fill="{DynamicResource AccentButtonForeground}"
565-
Data="{DynamicResource Icons.Down}"/>
566-
</Button>
567-
</Grid>
568-
</ControlTemplate>
569-
</Setter>
570-
571-
<Style Selector="^:disabled /template/ Button">
572-
<Setter Property="BorderThickness" Value="1"/>
573-
<Setter Property="BorderBrush" Value="{DynamicResource Brush.Border2}"/>
574-
<Setter Property="Background" Value="Transparent"/>
575-
</Style>
576-
577-
<Style Selector="^:disabled TextBlock">
578-
<Setter Property="Foreground" Value="{DynamicResource Brush.FG2}"/>
579-
</Style>
580-
581-
<Style Selector="^:disabled Path">
582-
<Setter Property="Fill" Value="{DynamicResource Brush.FG2}"/>
583-
</Style>
584-
</Style>
585-
586534
<Style Selector="aee|TextArea">
587535
<Setter Property="SelectionBorder">
588536
<Setter.Value>

src/Views/SelfUpdate.axaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@
6666
HorizontalContentAlignment="Center"
6767
VerticalContentAlignment="Center">
6868
<StackPanel Orientation="Horizontal">
69-
<Path Width="12" Height="12" Data="{StaticResource Icons.Pull}" Fill="White"/>
70-
<TextBlock Text="{DynamicResource Text.SelfUpdate.GotoDownload}" Margin="8,0,0,0"/>
69+
<Path Width="12" Height="12" Data="{StaticResource Icons.Pull}" Fill="{DynamicResource AccentButtonForeground}"/>
70+
<TextBlock Text="{DynamicResource Text.SelfUpdate.GotoDownload}" Margin="8,0,0,0" Foreground="{DynamicResource AccentButtonForeground}"/>
7171
</StackPanel>
7272
</Button>
7373

src/Views/WorkingCopy.axaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -296,6 +296,62 @@
296296
Padding="8,0"
297297
Click="OnContinue"
298298
IsVisible="{Binding InProgressContext, Converter={x:Static ObjectConverters.IsNotNull}}">
299+
<SplitButton.Styles>
300+
<Style Selector="SplitButton">
301+
<Setter Property="MinHeight" Value="24"/>
302+
<Setter Property="Template">
303+
<ControlTemplate>
304+
<Grid ColumnDefinitions="*,1,Auto">
305+
<Button x:Name="PART_PrimaryButton"
306+
Grid.Column="0"
307+
Classes="flat primary"
308+
MinWidth="32"
309+
HorizontalAlignment="Stretch"
310+
VerticalAlignment="Stretch"
311+
Content="{TemplateBinding Content}"
312+
ContentTemplate="{TemplateBinding ContentTemplate}"
313+
Command="{TemplateBinding Command}"
314+
CommandParameter="{TemplateBinding CommandParameter}"
315+
CornerRadius="3,0,0,3"
316+
Padding="{TemplateBinding Padding}"
317+
Focusable="False"
318+
KeyboardNavigation.IsTabStop="False" />
319+
320+
<Button x:Name="PART_SecondaryButton"
321+
Grid.Column="2"
322+
Classes="flat primary"
323+
Width="32"
324+
CornerRadius="0,3,3,0"
325+
Padding="0"
326+
Focusable="False"
327+
HorizontalAlignment="Stretch"
328+
VerticalAlignment="Stretch"
329+
KeyboardNavigation.IsTabStop="False">
330+
<Path Height="12" Width="12"
331+
Margin="0,4,0,0"
332+
Fill="{DynamicResource AccentButtonForeground}"
333+
Data="{DynamicResource Icons.Down}"/>
334+
</Button>
335+
</Grid>
336+
</ControlTemplate>
337+
</Setter>
338+
339+
<Style Selector="^:disabled /template/ Button">
340+
<Setter Property="BorderThickness" Value="1"/>
341+
<Setter Property="BorderBrush" Value="{DynamicResource Brush.Border2}"/>
342+
<Setter Property="Background" Value="Transparent"/>
343+
</Style>
344+
345+
<Style Selector="^:disabled TextBlock">
346+
<Setter Property="Foreground" Value="{DynamicResource Brush.FG2}"/>
347+
</Style>
348+
349+
<Style Selector="^:disabled Path">
350+
<Setter Property="Fill" Value="{DynamicResource Brush.FG2}"/>
351+
</Style>
352+
</Style>
353+
</SplitButton.Styles>
354+
299355
<SplitButton.IsEnabled>
300356
<MultiBinding Converter="{x:Static BoolConverters.And}">
301357
<Binding Path="IsCommitting" Converter="{x:Static BoolConverters.Not}"/>

0 commit comments

Comments
 (0)