WIP AMOLED theme. Likely will not continue working on this as the only way forward is a hacky mess.

This commit is contained in:
Evan Husted 2024-12-24 14:35:49 -06:00
parent 16a60fdf12
commit 1360ef2ec8
6 changed files with 31 additions and 2 deletions

View file

@ -66,7 +66,7 @@
</Style> </Style>
<Style Selector="Border.settings"> <Style Selector="Border.settings">
<Setter Property="Background" <Setter Property="Background"
Value="{DynamicResource ThemeDarkColor}" /> Value="{DynamicResource ThemeControlBorderColor}" />
<Setter Property="BorderBrush" <Setter Property="BorderBrush"
Value="{DynamicResource MenuFlyoutPresenterBorderColor}" /> Value="{DynamicResource MenuFlyoutPresenterBorderColor}" />
<Setter Property="BorderThickness" <Setter Property="BorderThickness"

View file

@ -1,5 +1,6 @@
<ResourceDictionary xmlns="https://github.com/avaloniaui" <ResourceDictionary xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ryu="clr-namespace:Ryujinx.Ava">
<ResourceDictionary.ThemeDictionaries> <ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Default"> <ResourceDictionary x:Key="Default">
<SolidColorBrush x:Key="DataGridSelectionBackgroundBrush" <SolidColorBrush x:Key="DataGridSelectionBackgroundBrush"
@ -52,5 +53,22 @@
<Color x:Key="Unbounded">#FFFF4554</Color> <Color x:Key="Unbounded">#FFFF4554</Color>
<Color x:Key="Custom">#6483F5</Color> <Color x:Key="Custom">#6483F5</Color>
</ResourceDictionary> </ResourceDictionary>
<ResourceDictionary x:Key="{x:Static ryu:RyujinxApp.AmoledThemeVariant}">
<SolidColorBrush x:Key="DataGridSelectionBackgroundBrush"
Color="{DynamicResource DataGridSelectionColor}" />
<Color x:Key="ControlFillColorSecondary">#008AA8</Color>
<Color x:Key="DataGridSelectionColor">#FF00FABB</Color>
<Color x:Key="ThemeContentBackgroundColor">#FF000000</Color>
<Color x:Key="ThemeControlBorderColor">#2D000000</Color>
<Color x:Key="ThemeForegroundColor">#FFFFFFFF</Color>
<Color x:Key="MenuFlyoutPresenterBorderColor">#79000000</Color>
<Color x:Key="AppListBackgroundColor">#50000000</Color>
<Color x:Key="AppListHoverBackgroundColor">#40000000</Color>
<Color x:Key="SecondaryTextColor">#A0FFFFFF</Color>
<Color x:Key="FavoriteApplicationIconColor">#fffcd12a</Color>
<Color x:Key="Switch">#FF2EEAC9</Color>
<Color x:Key="Unbounded">#FFFF4554</Color>
<Color x:Key="Custom">#6483F5</Color>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries> </ResourceDictionary.ThemeDictionaries>
</ResourceDictionary> </ResourceDictionary>

View file

@ -98,6 +98,9 @@ namespace Ryujinx.Ava
private void ThemeChanged_Event(object _, ReactiveEventArgs<string> rArgs) => ApplyConfiguredTheme(rArgs.NewValue); private void ThemeChanged_Event(object _, ReactiveEventArgs<string> rArgs) => ApplyConfiguredTheme(rArgs.NewValue);
public static readonly ThemeVariant AmoledThemeVariant = new("Amoled", ThemeVariant.Dark);
public void ApplyConfiguredTheme(string baseStyle) public void ApplyConfiguredTheme(string baseStyle)
{ {
try try
@ -116,6 +119,7 @@ namespace Ryujinx.Ava
"Auto" => DetectSystemTheme(), "Auto" => DetectSystemTheme(),
"Light" => ThemeVariant.Light, "Light" => ThemeVariant.Light,
"Dark" => ThemeVariant.Dark, "Dark" => ThemeVariant.Dark,
"AMOLED" => AmoledThemeVariant,
_ => ThemeVariant.Default, _ => ThemeVariant.Default,
}; };
} }

View file

@ -55,6 +55,7 @@
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
ClipToBounds="True" ClipToBounds="True"
Background="{DynamicResource ThemeControlBorderColor}"
CornerRadius="5"> CornerRadius="5">
<Grid ColumnDefinitions="Auto,10,*,150,100"> <Grid ColumnDefinitions="Auto,10,*,150,100">
<Image <Image
@ -105,6 +106,7 @@
Click="IdString_OnClick" Click="IdString_OnClick"
HorizontalContentAlignment="Left" HorizontalContentAlignment="Left"
VerticalAlignment="Center" VerticalAlignment="Center"
Background="{DynamicResource AppListBackgroundColor}" Background="{DynamicResource AppListBackgroundColor}"
Margin="-1, 0, 0, 0" Margin="-1, 0, 0, 0"
Padding="0" > Padding="0" >

View file

@ -547,6 +547,7 @@ namespace Ryujinx.Ava.UI.ViewModels
"Auto" => 0, "Auto" => 0,
"Light" => 1, "Light" => 1,
"Dark" => 2, "Dark" => 2,
"AMOLED" => 3,
_ => 0 _ => 0
}; };
@ -656,6 +657,7 @@ namespace Ryujinx.Ava.UI.ViewModels
0 => "Auto", 0 => "Auto",
1 => "Light", 1 => "Light",
2 => "Dark", 2 => "Dark",
3 => "AMOLED",
_ => "Auto" _ => "Auto"
}; };

View file

@ -77,6 +77,9 @@
<ComboBoxItem> <ComboBoxItem>
<TextBlock Text="{ext:Locale SettingsTabGeneralThemeDark}" /> <TextBlock Text="{ext:Locale SettingsTabGeneralThemeDark}" />
</ComboBoxItem> </ComboBoxItem>
<ComboBoxItem>
<TextBlock Text="AMOLED" />
</ComboBoxItem>
</ComboBox> </ComboBox>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>