mirror of
https://github.com/KeyKeeperApp/KeyKeeper.git
synced 2026-05-02 12:56:31 +03:00
define button styles globally
This commit is contained in:
@@ -10,6 +10,6 @@
|
|||||||
</Application.DataTemplates>
|
</Application.DataTemplates>
|
||||||
|
|
||||||
<Application.Styles>
|
<Application.Styles>
|
||||||
<FluentTheme />
|
<StyleInclude Source="avares://KeyKeeper/Styles/AppTheme.axaml"/>
|
||||||
</Application.Styles>
|
</Application.Styles>
|
||||||
</Application>
|
</Application>
|
||||||
38
src/KeyKeeper/Styles/AppTheme.axaml
Normal file
38
src/KeyKeeper/Styles/AppTheme.axaml
Normal file
@@ -0,0 +1,38 @@
|
|||||||
|
<Styles xmlns="https://github.com/avaloniaui"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||||
|
<Design.PreviewWith>
|
||||||
|
<Border Background="White" Padding="60">
|
||||||
|
<Button Classes="" Content="contentъ"/>
|
||||||
|
</Border>
|
||||||
|
</Design.PreviewWith>
|
||||||
|
|
||||||
|
<StyleInclude Source="avares://Avalonia.Themes.Fluent/FluentTheme.xaml"/>
|
||||||
|
|
||||||
|
<Style Selector="Button:not(.dummy) /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="Background" Value="#cccccc" />
|
||||||
|
<Setter Property="Foreground" Value="#000000" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="Button:pointerover /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="Background" Value="#aaaaaa" />
|
||||||
|
<Setter Property="Foreground" Value="#000000" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="Button:pressed /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="Background" Value="#444444" />
|
||||||
|
<Setter Property="Foreground" Value="#ffffff" />
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style Selector="Button.accentSidebarButton /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="Background" Value="#00000000" />
|
||||||
|
<Setter Property="Foreground" Value="white" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="Button.accentSidebarButton:pointerover /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="CornerRadius" Value="9" />
|
||||||
|
<Setter Property="BorderBrush" Value="white" />
|
||||||
|
</Style>
|
||||||
|
<Style Selector="Button.accentSidebarButton:pressed /template/ ContentPresenter#PART_ContentPresenter">
|
||||||
|
<Setter Property="CornerRadius" Value="9" />
|
||||||
|
<Setter Property="BorderBrush" Value="white" />
|
||||||
|
<Setter Property="Background" Value="white"/>
|
||||||
|
<Setter Property="Foreground" Value="#2328C4"/>
|
||||||
|
</Style>
|
||||||
|
</Styles>
|
||||||
@@ -28,27 +28,23 @@
|
|||||||
|
|
||||||
<StackPanel Grid.Row="1" Spacing="5" VerticalAlignment="Top" Margin="0 40 0 0">
|
<StackPanel Grid.Row="1" Spacing="5" VerticalAlignment="Top" Margin="0 40 0 0">
|
||||||
<Button Content="New Database"
|
<Button Content="New Database"
|
||||||
Foreground="White"
|
Classes="accentSidebarButton"
|
||||||
Background="Transparent"
|
|
||||||
BorderThickness="0"
|
|
||||||
FontSize="24"
|
FontSize="24"
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
Click="CreateNewVault_Click"/>
|
Click="CreateNewVault_Click"/>
|
||||||
|
|
||||||
<Button Content="Open Database"
|
<Button Content="Open Database"
|
||||||
Foreground="White"
|
Classes="accentSidebarButton"
|
||||||
Background="Transparent"
|
|
||||||
BorderThickness="0"
|
|
||||||
FontSize="24"
|
FontSize="24"
|
||||||
Cursor="Hand"
|
Cursor="Hand"
|
||||||
Click="OpenExistingVault_Click"/>
|
Click="OpenExistingVault_Click"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
<StackPanel Grid.Row="2" Orientation="Horizontal" Spacing="25">
|
<StackPanel Grid.Row="2" Orientation="Horizontal" Spacing="25">
|
||||||
<Button Command="{Binding OpenSettingsCommand}">
|
<Button Command="{Binding OpenSettingsCommand}" Classes="accentSidebarButton">
|
||||||
<Svg Path="/Assets/settings.svg" Width="48" Height="48"/>
|
<Svg Path="/Assets/settings.svg" Width="48" Height="48"/>
|
||||||
</Button>
|
</Button>
|
||||||
<Button Command="{Binding OpenAboutCommand}">
|
<Button Command="{Binding OpenAboutCommand}" Classes="accentSidebarButton">
|
||||||
<Svg Path="/Assets/about.svg" Width="48" Height="48"/>
|
<Svg Path="/Assets/about.svg" Width="48" Height="48"/>
|
||||||
</Button>
|
</Button>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
@@ -38,23 +38,22 @@
|
|||||||
<Button Content="All Passwords"
|
<Button Content="All Passwords"
|
||||||
Width="120"
|
Width="120"
|
||||||
Height="30"
|
Height="30"
|
||||||
Foreground="Black"
|
|
||||||
HorizontalAlignment="Left"/>
|
HorizontalAlignment="Left"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
||||||
</Border>
|
</Border>
|
||||||
<!-- Save Passwords -->
|
<!-- Save Passwords -->
|
||||||
<Button Content="Save Passwords"
|
<Button Content="Save Passwords"
|
||||||
|
Classes="accentSidebarButton"
|
||||||
Click="SaveButton_Click"
|
Click="SaveButton_Click"
|
||||||
Height="30"
|
Height="30"
|
||||||
Foreground="White"
|
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="0,20,0,0"/>
|
Margin="0,20,0,0"/>
|
||||||
|
|
||||||
<Button Content="New Entry"
|
<Button Content="New Entry"
|
||||||
|
Classes="accentSidebarButton"
|
||||||
Click="AddEntryButton_Click"
|
Click="AddEntryButton_Click"
|
||||||
Height="30"
|
Height="30"
|
||||||
Foreground="White"
|
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
Margin="0,20,0,0"/>
|
Margin="0,20,0,0"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
@@ -106,19 +105,7 @@
|
|||||||
<Button x:Name="UnlockButton"
|
<Button x:Name="UnlockButton"
|
||||||
Command="{Binding TryUnlock}"
|
Command="{Binding TryUnlock}"
|
||||||
HorizontalAlignment="Center"
|
HorizontalAlignment="Center"
|
||||||
Foreground="Black"
|
|
||||||
Background="#aaa"
|
|
||||||
Content="Unlock!" />
|
Content="Unlock!" />
|
||||||
|
|
||||||
<StackPanel.Styles>
|
|
||||||
<Style Selector="Button /template/ ContentPresenter">
|
|
||||||
<Setter Property="Foreground" Value="#333" />
|
|
||||||
</Style>
|
|
||||||
<Style Selector="Button:pointerover /template/ ContentPresenter">
|
|
||||||
<Setter Property="Background" Value="#ccc" />
|
|
||||||
<Setter Property="Foreground" Value="#444" />
|
|
||||||
</Style>
|
|
||||||
</StackPanel.Styles>
|
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</DataTemplate>
|
</DataTemplate>
|
||||||
</Window.DataTemplates>
|
</Window.DataTemplates>
|
||||||
|
|||||||
Reference in New Issue
Block a user