Files
quiver-launcher/App.axaml
T
Thomas GeorgiadisandCursor 2c85fa0370 feat: update Quiver Launcher to support .NET 10 and enhance UI/UX
- Introduce Android app
- Migrate project files to .NET 10, updating dependencies and workflows.
- Migrate project to Avalonia 12
- Refactor App.axaml to include a ResourceDictionary for theme management.
- Introduce new styles for gamepad navigation and focus rings.
- Implement hosted main view management for better application lifecycle handling.
- Remove deprecated MainWindow.Mods.cs file and related code.
- Update README to reflect changes in project structure and requirements.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-01 20:06:33 +10:00

184 lines
8.3 KiB
XML

<Application xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:services="clr-namespace:QuiverLauncher.Services"
x:Class="QuiverLauncher.App"
RequestedThemeVariant="Dark">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceInclude Source="avares://QuiverLauncher/Themes/WindowDrawnDecorations.axaml"/>
</ResourceDictionary.MergedDictionaries>
<SolidColorBrush x:Key="ThemeBase" Color="#18181b"/>
<SolidColorBrush x:Key="ThemeLighter" Color="#252527"/>
<SolidColorBrush x:Key="ThemeDarker" Color="#0e0e10"/>
<SolidColorBrush x:Key="ThemeBorder" Color="#2d2d30"/>
<SolidColorBrush x:Key="ThemeText" Color="White"/>
<SolidColorBrush x:Key="ThemeTextSecondary" Color="#B8B8B8"/>
<SolidColorBrush x:Key="ThemeSuccess" Color="#22c55e"/>
<SolidColorBrush x:Key="ThemeWarning" Color="#f59e0b"/>
<SolidColorBrush x:Key="ThemeError" Color="#ef4444"/>
<SolidColorBrush x:Key="ThemeAccent" Color="#f59e0b"/>
<SolidColorBrush x:Key="ThemeFocusRing" Color="#38bdf8"/>
</ResourceDictionary>
</Application.Resources>
<Application.Styles>
<FluentTheme />
<!-- Visible selection on dark ThemeBase TextBoxes (Steam Deck / themed inputs). -->
<Style Selector="TextBox">
<Setter Property="SelectionBrush" Value="{DynamicResource ThemeAccent}"/>
<Setter Property="SelectionForegroundBrush" Value="{DynamicResource ThemeDarker}"/>
<Setter Property="CaretBrush" Value="{DynamicResource ThemeText}"/>
<Setter Property="services:GamepadTextInput.EngageOnConfirm" Value="True"/>
</Style>
<Style Selector="ContextMenu">
<Setter Property="Background" Value="{DynamicResource ThemeBase}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeBorder}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="4"/>
<Setter Property="CornerRadius" Value="8"/>
</Style>
<Style Selector="MenuItem">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
<Setter Property="Padding" Value="10,8"/>
<Setter Property="CornerRadius" Value="4"/>
<Setter Property="BorderThickness" Value="2"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="services:MenuSubmenuOverlap.Enable" Value="True"/>
</Style>
<Style Selector="MenuItem:selected">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
</Style>
<Style Selector="Window.gamepad-chrome Button,
Window.gamepad-chrome TextBox,
Window.gamepad-chrome CheckBox,
Window.gamepad-chrome ComboBox">
<Setter Property="FocusAdorner" Value="{x:Null}"/>
</Style>
<!-- Focus rings only under nav chrome; :focus-visible stays for Tab. -->
<Style Selector="Window.gamepad-chrome MenuItem:focus">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="MenuItem:focus-visible">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="Window.gamepad-chrome Button:focus">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="Window.gamepad-chrome TextBox:focus /template/ Border#PART_BorderElement">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="Window.gamepad-chrome CheckBox:focus /template/ Border#NormalRectangle">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="Window.gamepad-chrome ComboBox:focus">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="Window Button:focus-visible">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<!-- Gamepad/keyboard rings. Do not require Window.gamepad-chrome — Avalonia 12
ancestor matches fail in Gamescope the same way DataTemplates do. -->
<Style Selector="Button.gamepad-focused /template/ Border">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="3"/>
</Style>
<Style Selector="Button.gamepad-focused">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="3"/>
</Style>
<!-- Disabled dialog buttons (e.g. Install with nothing checked) must still show the ring. -->
<Style Selector="Button.gamepad-focused:disabled">
<Setter Property="Opacity" Value="1"/>
</Style>
<Style Selector="Button.gamepad-focused:disabled /template/ Border">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="3"/>
<Setter Property="Background" Value="{DynamicResource ThemeDarker}"/>
</Style>
<Style Selector="TextBox.gamepad-focused /template/ Border#PART_BorderElement">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="3"/>
</Style>
<Style Selector="CheckBox.gamepad-focused /template/ Border#NormalRectangle">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="3"/>
</Style>
<!-- Modal dialogs are separate Windows; ComboBox focus ring must live in App styles. -->
<Style Selector="ComboBox.gamepad-focused">
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="3"/>
</Style>
<Style Selector="ComboBox.gamepad-focused /template/ Border#Background">
<Setter Property="Background" Value="{DynamicResource ThemeDarker}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="3"/>
</Style>
<!-- Steam virtual mouse in Gaming Mode: don't let :pointerover look like the cursor. -->
<Style Selector="Window.gamepad-chrome Button.settings:pointerover">
<Setter Property="Background" Value="Transparent"/>
</Style>
<Style Selector="Window.gamepad-chrome Button.settings.gamepad-focused:pointerover">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="3"/>
</Style>
<!-- Dialog ComboBox popups don't inherit MainWindow styles — define item chrome here. -->
<Style Selector="ComboBoxItem:pointerover /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
</Style>
<!-- Committed selection (mouse or after Confirm) — quieter than the gamepad cursor. -->
<Style Selector="ComboBoxItem:selected /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeBase}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
</Style>
<!-- Keyboard/gamepad cursor before Confirm — strong fill + orange ring. -->
<Style Selector="ComboBoxItem.gamepad-focused /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
<Style Selector="ComboBoxItem:selected.gamepad-focused /template/ ContentPresenter">
<Setter Property="Background" Value="{DynamicResource ThemeLighter}"/>
<Setter Property="Foreground" Value="{DynamicResource ThemeText}"/>
<Setter Property="BorderBrush" Value="{DynamicResource ThemeFocusRing}"/>
<Setter Property="BorderThickness" Value="2"/>
</Style>
</Application.Styles>
</Application>