Skip to content

Commit

Permalink
[Avalonia] Switching themes, work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruben2776 committed Sep 21, 2024
1 parent e165f83 commit 991371d
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 45 deletions.
2 changes: 1 addition & 1 deletion src/PicView.Avalonia.Win32/App.axaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<Application
RequestedThemeVariant="Default"
RequestedThemeVariant="Dark"
x:Class="PicView.Avalonia.Win32.App"
x:CompileBindings="True"
xmlns="https://github.com/avaloniaui"
Expand Down
50 changes: 50 additions & 0 deletions src/PicView.Avalonia/PicViewTheme/DarkColors.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<Color x:Key="AccentColor">#FFDB5B3D</Color>
<Color x:Key="SecondaryAccentColor">#e0755a</Color>
<Color x:Key="LogoAccentColor">#FFf8af3c</Color>

<Color x:Key="MainTextColor">#FFf6f4f4</Color>
<Color x:Key="MainTextColorFaded">#d6d4d4</Color>

<Color x:Key="MainIconColor">#eeebebeb</Color>
<Color x:Key="SecondaryIconColor">#eeebebeb</Color>

<Color x:Key="MainBackgroundColor">#CC2b2b2b</Color>
<Color x:Key="SecondaryBackgroundColor">#CC252525</Color>
<Color x:Key="TertiaryBackgroundColor">#CC3d3d3d</Color>
<Color x:Key="FadedBackgroundColor">#FF333333</Color>
<Color x:Key="BackgroundHoverColor">#FF4B4B4B</Color>
<Color x:Key="AltBackgroundHoverColor">#22FFFFFF</Color>
<Color x:Key="AltBackgroundColor">#A7222222</Color>

<Color x:Key="MainButtonBackgroundColor">#FF2e2e2e</Color>

<Color x:Key="MainBorderColor">#FF3A3A3A</Color>
<Color x:Key="SecondaryBorderColor">#777</Color>
<Color x:Key="TertiaryBorderColor">#555</Color>

<Color x:Key="ButtonForegroundPointerOver">#FFF</Color>

<Color x:Key="BackgroundAlpha">#442e2e2e</Color>

<Color x:Key="MenuBackgroundColor">#292929</Color>
<Color x:Key="ContextMenuBackgroundColor">#EE2b2b2b</Color>

<Color x:Key="WindowBackgroundColor">#66000000</Color>
<ImageBrush
DestinationRect="0,0,100,100"
Opacity=".6"
Source="/PicViewTheme/Resources/noisy-texture-200x200-o4-d31-c-161616-t0.png"
SourceRect="0,0,200,200"
Stretch="Fill"
TileMode="FlipXY"
x:Key="NoisyTexture" />

<DropShadowEffect
BlurRadius="5"
Color="#112e2e2e"
OffsetX="2"
OffsetY="2"
x:Key="MenuShadowButtonBorder" />
</ResourceDictionary>
50 changes: 50 additions & 0 deletions src/PicView.Avalonia/PicViewTheme/LightColors.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

<Color x:Key="AccentColor">#FFDB5B3D</Color>
<Color x:Key="SecondaryAccentColor">#e0755a</Color>
<Color x:Key="LogoAccentColor">#FFf8af3c</Color>

<Color x:Key="MainTextColor">#FFf6f4f4</Color>
<Color x:Key="MainTextColorFaded">#d6d4d4</Color>

<Color x:Key="MainIconColor">#eeebebeb</Color>
<Color x:Key="SecondaryIconColor">#eeebebeb</Color>

<Color x:Key="MainBackgroundColor">White</Color>
<Color x:Key="SecondaryBackgroundColor">WhiteSmoke</Color>
<Color x:Key="TertiaryBackgroundColor">#CC3d3d3d</Color>
<Color x:Key="FadedBackgroundColor">#FF333333</Color>
<Color x:Key="BackgroundHoverColor">#FF4B4B4B</Color>
<Color x:Key="AltBackgroundHoverColor">#22FFFFFF</Color>
<Color x:Key="AltBackgroundColor">#A7222222</Color>

<Color x:Key="MainButtonBackgroundColor">#FF2e2e2e</Color>

<Color x:Key="MainBorderColor">#FF3A3A3A</Color>
<Color x:Key="SecondaryBorderColor">#777</Color>
<Color x:Key="TertiaryBorderColor">#555</Color>

<Color x:Key="ButtonForegroundPointerOver">#FFF</Color>

<Color x:Key="BackgroundAlpha">#442e2e2e</Color>

<Color x:Key="MenuBackgroundColor">#292929</Color>
<Color x:Key="ContextMenuBackgroundColor">#EE2b2b2b</Color>

<Color x:Key="WindowBackgroundColor">#66000000</Color>
<ImageBrush
DestinationRect="0,0,100,100"
Opacity=".6"
Source="/PicViewTheme/Resources/noisy-texture-200x200-o4-d31-c-161616-t0.png"
SourceRect="0,0,200,200"
Stretch="Fill"
TileMode="FlipXY"
x:Key="NoisyTexture" />

<DropShadowEffect
BlurRadius="5"
Color="#112e2e2e"
OffsetX="2"
OffsetY="2"
x:Key="MenuShadowButtonBorder" />
</ResourceDictionary>
48 changes: 4 additions & 44 deletions src/PicView.Avalonia/PicViewTheme/Main.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,47 +5,13 @@
<Styles.Resources>
<ResourceDictionary>

<Color x:Key="AccentColor">#FFDB5B3D</Color>
<Color x:Key="SecondaryAccentColor">#e0755a</Color>
<Color x:Key="LogoAccentColor">#FFf8af3c</Color>

<Color x:Key="MainTextColor">#FFf6f4f4</Color>
<Color x:Key="MainTextColorFaded">#d6d4d4</Color>

<Color x:Key="MainIconColor">#eeebebeb</Color>
<Color x:Key="SecondaryIconColor">#eeebebeb</Color>

<Color x:Key="MainBackgroundColor">#CC2b2b2b</Color>
<Color x:Key="SecondaryBackgroundColor">#CC252525</Color>
<Color x:Key="TertiaryBackgroundColor">#CC3d3d3d</Color>
<Color x:Key="FadedBackgroundColor">#FF333333</Color>
<Color x:Key="BackgroundHoverColor">#FF4B4B4B</Color>
<Color x:Key="AltBackgroundHoverColor">#22FFFFFF</Color>
<Color x:Key="AltBackgroundColor">#A7222222</Color>

<Color x:Key="MainButtonBackgroundColor">#FF2e2e2e</Color>

<Color x:Key="MainBorderColor">#FF3A3A3A</Color>
<Color x:Key="SecondaryBorderColor">#777</Color>
<Color x:Key="TertiaryBorderColor">#555</Color>

<Color x:Key="ButtonForegroundPointerOver">#FFF</Color>
<ResourceDictionary.MergedDictionaries>

<Color x:Key="BackgroundAlpha">#442e2e2e</Color>
<!-- TODO: Figure out switching themes -->
<ResourceInclude Source="/PicViewTheme/DarkColors.axaml" />
<!-- TODO: Figure out switching themes -->

<Color x:Key="MenuBackgroundColor">#292929</Color>
<Color x:Key="ContextMenuBackgroundColor">#EE2b2b2b</Color>

<Color x:Key="WindowBackgroundColor">#66000000</Color>
<ImageBrush
DestinationRect="0,0,100,100"
Opacity=".6"
Source="/PicViewTheme/Resources/noisy-texture-200x200-o4-d31-c-161616-t0.png"
SourceRect="0,0,200,200"
Stretch="Fill"
TileMode="FlipXY"
x:Key="NoisyTexture" />
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="/PicViewTheme/Controls/AutoScrollViewer.axaml" />
<ResourceInclude Source="/PicViewTheme/Controls/Border.axaml" />
<ResourceInclude Source="/PicViewTheme/Controls/Button.axaml" />
Expand All @@ -69,12 +35,6 @@
<ResourceInclude Source="/PicViewTheme/Controls/Window.axaml" />
<ResourceInclude Source="/PicViewTheme/Icons.axaml" />
</ResourceDictionary.MergedDictionaries>
<DropShadowEffect
BlurRadius="5"
Color="#112e2e2e"
OffsetX="2"
OffsetY="2"
x:Key="MenuShadowButtonBorder" />
</ResourceDictionary>
</Styles.Resources>
<Style Selector="Window">
Expand Down

0 comments on commit 991371d

Please sign in to comment.