Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
90 changes: 1 addition & 89 deletions src/UniGetUI.Avalonia/App.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,102 +2,14 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="UniGetUI.Avalonia.App"
xmlns:avaloniaApplication1="clr-namespace:UniGetUI.Avalonia"
xmlns:controls="using:UniGetUI.Avalonia.Views.Controls"
RequestedThemeVariant="Default">

<Application.DataTemplates>
<avaloniaApplication1:ViewLocator/>
</Application.DataTemplates>

<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Dark">
<!-- Settings cards -->
<SolidColorBrush x:Key="SettingsCardBackground" Color="#262B3C"/>
<SolidColorBrush x:Key="SettingsCardBorderBrush" Color="#3a3a3a"/>
<SolidColorBrush x:Key="SettingsCardHoverBackground" Color="#2e3448"/>
<!-- Window structure -->
<SolidColorBrush x:Key="AppWindowBackground" Color="#1e2025"/>
<SolidColorBrush x:Key="AppTitleBarBackground" Color="#313131"/>
<SolidColorBrush x:Key="AppSplitterBackground" Color="#14161a"/>
<SolidColorBrush x:Key="AppOperationsPanelBackground" Color="#16181c"/>
<SolidColorBrush x:Key="AppBorderBrush" Color="#323439"/>
<SolidColorBrush x:Key="AppBadgeBackground" Color="#3c3e44"/>
<!-- Dialogs -->
<SolidColorBrush x:Key="AppDialogBackground" Color="#1e2025"/>
<SolidColorBrush x:Key="AppDialogPanelBackground" Color="#2a2d34"/>
<SolidColorBrush x:Key="AppDialogSubtleBackground" Color="#3a3d44"/>
<SolidColorBrush x:Key="AppDialogDarkBackground" Color="#12141a"/>
<!-- Warning banner -->
<SolidColorBrush x:Key="WarningBannerBackground" Color="#3d2800"/>
<SolidColorBrush x:Key="WarningBannerBorderBrush" Color="#7a5200"/>
<SolidColorBrush x:Key="WarningBannerIconBackground" Color="#f0a500"/>
<SolidColorBrush x:Key="WarningBannerIconForeground" Color="#1a1000"/>
<SolidColorBrush x:Key="WarningBannerSubtext" Color="#ffe082"/>
<!-- Setting warning subtext (WarningText on cards) -->
<SolidColorBrush x:Key="SettingWarningTextForeground" Color="#ffc107"/>
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<!-- Settings cards -->
<SolidColorBrush x:Key="SettingsCardBackground" Color="#f3f3f3"/>
<SolidColorBrush x:Key="SettingsCardBorderBrush" Color="#d0d0d0"/>
<SolidColorBrush x:Key="SettingsCardHoverBackground" Color="#e8e8e8"/>
<!-- Window structure -->
<SolidColorBrush x:Key="AppWindowBackground" Color="#f0f0f0"/>
<SolidColorBrush x:Key="AppTitleBarBackground" Color="#e0e0e0"/>
<SolidColorBrush x:Key="AppSplitterBackground" Color="#d8d8d8"/>
<SolidColorBrush x:Key="AppOperationsPanelBackground" Color="#f8f8f8"/>
<SolidColorBrush x:Key="AppBorderBrush" Color="#cccccc"/>
<SolidColorBrush x:Key="AppBadgeBackground" Color="#e0e0e0"/>
<!-- Dialogs -->
<SolidColorBrush x:Key="AppDialogBackground" Color="#ffffff"/>
<SolidColorBrush x:Key="AppDialogPanelBackground" Color="#f5f5f5"/>
<SolidColorBrush x:Key="AppDialogSubtleBackground" Color="#ebebeb"/>
<SolidColorBrush x:Key="AppDialogDarkBackground" Color="#e8e8e8"/>
<!-- Warning banner -->
<SolidColorBrush x:Key="WarningBannerBackground" Color="#fff8e1"/>
<SolidColorBrush x:Key="WarningBannerBorderBrush" Color="#d4a700"/>
<SolidColorBrush x:Key="WarningBannerIconBackground" Color="#f0a500"/>
<SolidColorBrush x:Key="WarningBannerIconForeground" Color="#1a1000"/>
<SolidColorBrush x:Key="WarningBannerSubtext" Color="#7a4f00"/>
<!-- Setting warning subtext (WarningText on cards) -->
<SolidColorBrush x:Key="SettingWarningTextForeground" Color="#a05c00"/>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</Application.Resources>

<Application.Styles>
<FluentTheme />
<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml"/>

<!-- SettingsCard appearance -->
<Style Selector="Border.settings-card">
<Setter Property="Background" Value="{DynamicResource SettingsCardBackground}"/>
<Setter Property="BorderBrush" Value="{DynamicResource SettingsCardBorderBrush}"/>
<Setter Property="Margin" Value="40,0"/>
</Style>
<Style Selector="Border.settings-card-clickable:pointerover">
<Setter Property="Background" Value="{DynamicResource SettingsCardHoverBackground}"/>
</Style>

<!-- Setting warning subtext (amber, both themes) -->
<Style Selector="TextBlock.setting-warning-text">
<Setter Property="Foreground" Value="{DynamicResource SettingWarningTextForeground}"/>
</Style>

<!-- Warning banner (InfoBar-style amber/golden) -->
<Style Selector="Border.warning-banner">
<Setter Property="Background" Value="{DynamicResource WarningBannerBackground}"/>
<Setter Property="BorderBrush" Value="{DynamicResource WarningBannerBorderBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Margin" Value="40,4,40,0"/>
</Style>

<!-- SvgIcon: inherit the Fluent foreground so icons match text colour in both themes -->
<Style Selector="controls|SvgIcon">
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}"/>
</Style>
<StyleInclude Source="avares://UniGetUI.Avalonia/Assets/Styles/Styles.Common.axaml"/>
</Application.Styles>
</Application>
10 changes: 10 additions & 0 deletions src/UniGetUI.Avalonia/App.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
using Avalonia.Controls.ApplicationLifetimes;
using Avalonia.Data.Core.Plugins;
using Avalonia.Markup.Xaml;
using Avalonia.Markup.Xaml.Styling;
using Avalonia.Styling;
using UniGetUI.Avalonia.Views;
using UniGetUI.PackageEngine;
Expand All @@ -15,6 +16,15 @@ public partial class App : Application
public override void Initialize()
{
AvaloniaXamlLoader.Load(this);

string platform = OperatingSystem.IsWindows() ? "Windows"
: OperatingSystem.IsMacOS() ? "macOS"
: "Linux";

Styles.Add(new StyleInclude(new Uri("avares://UniGetUI.Avalonia/"))
{
Source = new Uri($"avares://UniGetUI.Avalonia/Assets/Styles/Styles.{platform}.axaml")
});
}

public override void OnFrameworkInitializationCompleted()
Expand Down
35 changes: 35 additions & 0 deletions src/UniGetUI.Avalonia/Assets/Styles/Styles.Common.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="using:UniGetUI.Avalonia.Views.Controls">

<StyleInclude Source="avares://Avalonia.Controls.DataGrid/Themes/Fluent.xaml"/>

<!-- SettingsCard appearance -->
<Style Selector="Border.settings-card">
<Setter Property="Background" Value="{DynamicResource SettingsCardBackground}"/>
<Setter Property="BorderBrush" Value="{DynamicResource SettingsCardBorderBrush}"/>
<Setter Property="Margin" Value="40,0"/>
</Style>
<Style Selector="Border.settings-card-clickable:pointerover">
<Setter Property="Background" Value="{DynamicResource SettingsCardHoverBackground}"/>
</Style>

<!-- Setting warning subtext (amber, both themes) -->
<Style Selector="TextBlock.setting-warning-text">
<Setter Property="Foreground" Value="{DynamicResource SettingWarningTextForeground}"/>
</Style>

<!-- Warning banner (InfoBar-style amber/golden) -->
<Style Selector="Border.warning-banner">
<Setter Property="Background" Value="{DynamicResource WarningBannerBackground}"/>
<Setter Property="BorderBrush" Value="{DynamicResource WarningBannerBorderBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Margin" Value="40,4,40,0"/>
</Style>

<!-- SvgIcon: inherit the Fluent foreground so icons match text colour in both themes -->
<Style Selector="controls|SvgIcon">
<Setter Property="Foreground" Value="{DynamicResource SystemControlForegroundBaseHighBrush}"/>
</Style>

</Styles>
61 changes: 61 additions & 0 deletions src/UniGetUI.Avalonia/Assets/Styles/Styles.Linux.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Styles.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Dark">
<!-- Settings cards -->
<SolidColorBrush x:Key="SettingsCardBackground" Color="#222534"/>
<SolidColorBrush x:Key="SettingsCardBorderBrush" Color="#3a3a3a"/>
<SolidColorBrush x:Key="SettingsCardHoverBackground" Color="#2e3448"/>
<!-- Window structure -->
<SolidColorBrush x:Key="AppWindowBackground" Color="#191b29"/>
<SolidColorBrush x:Key="AppTitleBarBackground" Color="#191b29"/>
<SolidColorBrush x:Key="AppSplitterBackground" Color="#14161a"/>
<SolidColorBrush x:Key="AppOperationsPanelBackground" Color="#16181c"/>
<SolidColorBrush x:Key="AppBorderBrush" Color="#323439"/>
<SolidColorBrush x:Key="AppBadgeBackground" Color="#3c3e44"/>
<!-- Dialogs -->
<SolidColorBrush x:Key="AppDialogBackground" Color="#191b29"/>
<SolidColorBrush x:Key="AppDialogPanelBackground" Color="#2a2d34"/>
<SolidColorBrush x:Key="AppDialogSubtleBackground" Color="#3a3d44"/>
<SolidColorBrush x:Key="AppDialogDarkBackground" Color="#12141a"/>
<!-- Warning banner -->
<SolidColorBrush x:Key="WarningBannerBackground" Color="#3d2800"/>
<SolidColorBrush x:Key="WarningBannerBorderBrush" Color="#7a5200"/>
<SolidColorBrush x:Key="WarningBannerIconBackground" Color="#f0a500"/>
<SolidColorBrush x:Key="WarningBannerIconForeground" Color="#1a1000"/>
<SolidColorBrush x:Key="WarningBannerSubtext" Color="#ffe082"/>
<!-- Setting warning subtext -->
<SolidColorBrush x:Key="SettingWarningTextForeground" Color="#ffc107"/>
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<!-- Settings cards -->
<SolidColorBrush x:Key="SettingsCardBackground" Color="#fbfbfd"/>
<SolidColorBrush x:Key="SettingsCardBorderBrush" Color="#eff0f3"/>
<SolidColorBrush x:Key="SettingsCardHoverBackground" Color="#f5f6f9"/>
<!-- Window structure -->
<SolidColorBrush x:Key="AppWindowBackground" Color="#f0f3f9"/>
<SolidColorBrush x:Key="AppTitleBarBackground" Color="#f0f3f9"/>
<SolidColorBrush x:Key="AppSplitterBackground" Color="#d8d8d8"/>
<SolidColorBrush x:Key="AppOperationsPanelBackground" Color="#f8f8f8"/>
<SolidColorBrush x:Key="AppBorderBrush" Color="#cccccc"/>
<SolidColorBrush x:Key="AppBadgeBackground" Color="#e0e0e0"/>
<!-- Dialogs -->
<SolidColorBrush x:Key="AppDialogBackground" Color="#ffffff"/>
<SolidColorBrush x:Key="AppDialogPanelBackground" Color="#f5f5f5"/>
<SolidColorBrush x:Key="AppDialogSubtleBackground" Color="#ebebeb"/>
<SolidColorBrush x:Key="AppDialogDarkBackground" Color="#e8e8e8"/>
<!-- Warning banner -->
<SolidColorBrush x:Key="WarningBannerBackground" Color="#fff8e1"/>
<SolidColorBrush x:Key="WarningBannerBorderBrush" Color="#d4a700"/>
<SolidColorBrush x:Key="WarningBannerIconBackground" Color="#f0a500"/>
<SolidColorBrush x:Key="WarningBannerIconForeground" Color="#1a1000"/>
<SolidColorBrush x:Key="WarningBannerSubtext" Color="#7a4f00"/>
<!-- Setting warning subtext -->
<SolidColorBrush x:Key="SettingWarningTextForeground" Color="#a05c00"/>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</Styles.Resources>
</Styles>
61 changes: 61 additions & 0 deletions src/UniGetUI.Avalonia/Assets/Styles/Styles.Windows.axaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
<Styles xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Styles.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Dark">
<!-- Settings cards -->
<SolidColorBrush x:Key="SettingsCardBackground" Color="#222534"/>
<SolidColorBrush x:Key="SettingsCardBorderBrush" Color="#3a3a3a"/>
<SolidColorBrush x:Key="SettingsCardHoverBackground" Color="#2e3448"/>
<!-- Window structure -->
<SolidColorBrush x:Key="AppWindowBackground" Color="#191b29"/>
<SolidColorBrush x:Key="AppTitleBarBackground" Color="#191b29"/>
<SolidColorBrush x:Key="AppSplitterBackground" Color="#14161a"/>
<SolidColorBrush x:Key="AppOperationsPanelBackground" Color="#16181c"/>
<SolidColorBrush x:Key="AppBorderBrush" Color="#323439"/>
<SolidColorBrush x:Key="AppBadgeBackground" Color="#3c3e44"/>
<!-- Dialogs -->
<SolidColorBrush x:Key="AppDialogBackground" Color="#191b29"/>
<SolidColorBrush x:Key="AppDialogPanelBackground" Color="#2a2d34"/>
<SolidColorBrush x:Key="AppDialogSubtleBackground" Color="#3a3d44"/>
<SolidColorBrush x:Key="AppDialogDarkBackground" Color="#12141a"/>
<!-- Warning banner -->
<SolidColorBrush x:Key="WarningBannerBackground" Color="#3d2800"/>
<SolidColorBrush x:Key="WarningBannerBorderBrush" Color="#7a5200"/>
<SolidColorBrush x:Key="WarningBannerIconBackground" Color="#f0a500"/>
<SolidColorBrush x:Key="WarningBannerIconForeground" Color="#1a1000"/>
<SolidColorBrush x:Key="WarningBannerSubtext" Color="#ffe082"/>
<!-- Setting warning subtext -->
<SolidColorBrush x:Key="SettingWarningTextForeground" Color="#ffc107"/>
</ResourceDictionary>
<ResourceDictionary x:Key="Light">
<!-- Settings cards -->
<SolidColorBrush x:Key="SettingsCardBackground" Color="#fbfbfd"/>
<SolidColorBrush x:Key="SettingsCardBorderBrush" Color="#eff0f3"/>
<SolidColorBrush x:Key="SettingsCardHoverBackground" Color="#f5f6f9"/>
<!-- Window structure -->
<SolidColorBrush x:Key="AppWindowBackground" Color="#f0f3f9"/>
<SolidColorBrush x:Key="AppTitleBarBackground" Color="#f0f3f9"/>
<SolidColorBrush x:Key="AppSplitterBackground" Color="#d8d8d8"/>
<SolidColorBrush x:Key="AppOperationsPanelBackground" Color="#f8f8f8"/>
<SolidColorBrush x:Key="AppBorderBrush" Color="#cccccc"/>
<SolidColorBrush x:Key="AppBadgeBackground" Color="#e0e0e0"/>
<!-- Dialogs -->
<SolidColorBrush x:Key="AppDialogBackground" Color="#ffffff"/>
<SolidColorBrush x:Key="AppDialogPanelBackground" Color="#f5f5f5"/>
<SolidColorBrush x:Key="AppDialogSubtleBackground" Color="#ebebeb"/>
<SolidColorBrush x:Key="AppDialogDarkBackground" Color="#e8e8e8"/>
<!-- Warning banner -->
<SolidColorBrush x:Key="WarningBannerBackground" Color="#fff8e1"/>
<SolidColorBrush x:Key="WarningBannerBorderBrush" Color="#d4a700"/>
<SolidColorBrush x:Key="WarningBannerIconBackground" Color="#f0a500"/>
<SolidColorBrush x:Key="WarningBannerIconForeground" Color="#1a1000"/>
<SolidColorBrush x:Key="WarningBannerSubtext" Color="#7a4f00"/>
<!-- Setting warning subtext -->
<SolidColorBrush x:Key="SettingWarningTextForeground" Color="#a05c00"/>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
</ResourceDictionary>
</Styles.Resources>
</Styles>
Loading
Loading