Files
quiver-launcher/MainView.axaml
T
Thomas Georgiadis 6d25842999 Add kiosk mode
Settings > General > Kiosk mode (or --kiosk for one session) starts Quiver
fullscreen and limited to browsing and launching: settings, the App Catalog,
adding, updating and exit controls are hidden, and library card menus keep only
Launch. Ctrl+Alt+K unlocks the session and locks it again; an optional PIN,
stored only as a hash, is asked to unlock. A locked kiosk never holds up logout
or shutdown.
2026-10-07 23:07:31 +11:00

597 lines
22 KiB
XML

<UserControl x:Class="QuiverLauncher.MainView" x:Name="ShellRoot"
xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:QuiverLauncher"
xmlns:views="clr-namespace:QuiverLauncher.Views"
xmlns:services="clr-namespace:QuiverLauncher.Services"
xmlns:mods="clr-namespace:QuiverLauncher.Services.Mods"
xmlns:asyncImageLoader="clr-namespace:AsyncImageLoader;assembly=AsyncImageLoader.Avalonia"
TopLevel.AutoSafeAreaPadding="False"
XYFocus.NavigationModes="Gamepad,Remote"
XYFocus.UpNavigationStrategy="Projection"
XYFocus.DownNavigationStrategy="Projection"
XYFocus.LeftNavigationStrategy="Projection"
XYFocus.RightNavigationStrategy="Projection"
FocusAdorner="{x:Null}"
Background="{Binding WindowBackground}">
<UserControl.Resources>
<!-- Theme Color Resources -->
<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="ThemeFocusRing" Color="#38bdf8"/>
</UserControl.Resources>
<UserControl.Styles><StyleInclude Source="avares://QuiverLauncher/Themes/LauncherStyles.axaml"/></UserControl.Styles>
<Border CornerRadius="0" ClipToBounds="True" Background="Transparent">
<Grid>
<SplitView x:Name="MainSplitView"
CompactPaneLength="0"
DisplayMode="Inline"
IsPaneOpen="True"
OpenPaneLength="240"
PaneBackground="{DynamicResource ThemeDarker}"
PanePlacement="Left">
<SplitView.Pane>
<!-- Left Sidebar Navigation -->
<Border x:Name="SidebarPanel"
XYFocus.NavigationModes="Gamepad,Remote"
XYFocus.UpNavigationStrategy="Projection"
XYFocus.DownNavigationStrategy="Projection"
XYFocus.LeftNavigationStrategy="Projection"
XYFocus.RightNavigationStrategy="Projection"
Background="{DynamicResource ThemeDarker}" BorderBrush="{DynamicResource ThemeBorder}" BorderThickness="0,0,1,0">
<Grid Margin="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<!-- Logo/Header -->
<StackPanel x:Name="SidebarLogoPanel"
Grid.Row="0"
Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Spacing="6">
<Image x:Name="SidebarLogoImage"
Source="avares://QuiverLauncher/Assets/app.png"
VerticalAlignment="Center"/>
<StackPanel Orientation="Vertical"
VerticalAlignment="Center"
Margin="20,0,0,0"
Spacing="2">
<TextBlock Text="QUIVER"
FontSize="18"
FontWeight="Bold"
Foreground="{DynamicResource ThemeText}"
LetterSpacing="2"/>
<TextBlock Text="LAUNCHER"
FontSize="11"
FontWeight="SemiBold"
Foreground="{DynamicResource ThemeTextSecondary}"
LetterSpacing="2.5"/>
</StackPanel>
</StackPanel>
<!-- Navigation Buttons -->
<StackPanel x:Name="SidebarNavPanel" Grid.Row="1" Margin="12,0" VerticalAlignment="Top">
<!-- Continue Button -->
<Button x:Name="ContinueButton"
Classes="settings"
Margin="0,0,0,4"
CornerRadius="8"
Width="216"
HorizontalAlignment="Left"
Click="ContinueButton_Click"
IsVisible="{Binding Library.IsContinueVisible}">
<Grid ColumnDefinitions="*,Auto">
<StackPanel Grid.Column="0"
Orientation="Horizontal"
VerticalAlignment="Center">
<Image Width="32" Height="32"
Source="avares://QuiverLauncher/Assets/Continue.png"
Margin="0,0,12,0"/>
<TextBlock Text="Continue"
VerticalAlignment="Center"/>
</StackPanel>
<Border Grid.Column="1"
ClipToBounds="True"
MaxWidth="48"
MaxHeight="44"
Margin="8,0,0,0"
VerticalAlignment="Center"
HorizontalAlignment="Right">
<asyncImageLoader:AdvancedImage Source="{Binding Library.ContinueGameInfo.DefaultIconUrl}"
Stretch="Uniform"
MaxWidth="48"
MaxHeight="44"/>
</Border>
</Grid>
</Button>
<!-- Library Button -->
<Button x:Name="LibraryNavButton"
Classes="settings selected"
Margin="0,0,0,4"
CornerRadius="8"
Width="216"
HorizontalAlignment="Left"
Click="LibraryNavButton_Click">
<StackPanel Orientation="Horizontal">
<Image Width="32" Height="32"
Source="avares://QuiverLauncher/Assets/DefaultGame.png"
Margin="0,0,12,0"/>
<TextBlock Text="Library" ToolTip.Tip="{Binding Text, RelativeSource={RelativeSource Self}}" VerticalAlignment="Center"/>
</StackPanel>
</Button>
<!-- App Catalog Button -->
<Button x:Name="BrowseNavButton"
IsVisible="{Binding ShowCatalogNavigation}"
Classes="settings"
Margin="0,0,0,4"
CornerRadius="8"
Width="216"
HorizontalAlignment="Left"
Click="BrowseNavButton_Click">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center" Spacing="10">
<Image Width="32" Height="32"
Source="avares://QuiverLauncher/Assets/AppCatalog.png"
Margin="0,0,2,0"/>
<TextBlock Text="App Catalog" VerticalAlignment="Center"/>
</StackPanel>
</Button>
</StackPanel>
<ScrollViewer x:Name="SidebarBodyScroller"
Grid.Row="2"
IsVisible="False"
HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Hidden">
<StackPanel x:Name="SidebarBodyHost"/>
</ScrollViewer>
<!-- Library-only filters -->
<views:LibraryFiltersView x:Name="LibraryFiltersPanel" Grid.Row="2"/>
<!-- Footer Links -->
<StackPanel x:Name="ExternalLinksHost" Grid.Row="3" Margin="12,0,12,8" IsVisible="{Binding ShowExternalLinks}">
<Border Height="1" Background="{DynamicResource ThemeBorder}" Margin="-12,0,-12,8"/>
<StackPanel Orientation="Horizontal" Spacing="8" HorizontalAlignment="Center">
<Button x:Name="GitHubFooterButton"
Classes="iconbutton"
Width="44"
Height="44"
ToolTip.Tip="GitHub"
Click="GithubButton_Click">
<Image Width="32" Height="32"
Source="avares://QuiverLauncher/Assets/Github.png"/>
</Button>
<Button x:Name="DiscordFooterButton"
Classes="iconbutton"
Width="44"
Height="44"
ToolTip.Tip="Discord"
Click="DiscordButton_Click">
<Image Width="32" Height="32"
Source="avares://QuiverLauncher/Assets/Discord.png"/>
</Button>
<Button x:Name="KofiFooterButton"
Classes="iconbutton"
Width="44"
Height="44"
ToolTip.Tip="Ko-fi"
Click="KofiButton_Click">
<Image Width="32" Height="32"
Source="avares://QuiverLauncher/Assets/Kofi.png"/>
</Button>
</StackPanel>
</StackPanel>
</Grid>
</Border>
</SplitView.Pane>
<!-- Main Content Area -->
<Grid x:Name="MainGrid">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Top Bar: drag layer is a sibling behind controls so BeginMoveDrag never captures chrome clicks -->
<Grid Grid.Row="0" ZIndex="1">
<Border Background="{DynamicResource ThemeDarker}"
BorderBrush="{DynamicResource ThemeBorder}"
BorderThickness="0,0,0,1"
PointerPressed="TopBar_PointerPressed"/>
<Border Classes="header-inner">
<Grid RowDefinitions="Auto,Auto">
<Grid x:Name="HeaderLayoutGrid" Grid.Row="0" ColumnDefinitions="Auto,*,Auto,Auto" RowDefinitions="Auto,Auto" VerticalAlignment="Top">
<Button x:Name="DesktopSidebarToggleButton" Grid.Column="0"
Classes="modern-icon" Width="32" Height="32" Margin="8,0,0,0" Padding="6"
VerticalAlignment="Center" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"
IsVisible="{Binding IsDesktopPlatform}" Focusable="True"
AutomationProperties.Name="Hide sidebar" ToolTip.Tip="Hide sidebar">
<Path Width="20" Height="20" Stretch="Uniform" Stroke="{DynamicResource ThemeText}"
StrokeThickness="1.5" Data="M3,3 L21,3 L21,21 L3,21 Z M9,3 L9,21 M16,8 L12,12 L16,16"/>
</Button>
<Button x:Name="MobileNavButton"
Grid.Column="0"
Classes="modern-icon mobile-header-icon"
Width="28"
Height="28"
Margin="4,0,0,0"
Padding="0"
Background="Transparent"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
VerticalAlignment="Center"
IsVisible="{Binding IsMobile}"
PlatformFeedback.FeedbackType="Auto"
ToolTip.Tip="Menu"
>
<Border Width="28" Height="28" CornerRadius="8" Background="#2a2a2a">
<TextBlock Text="☰"
FontSize="14"
Foreground="White"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</Button>
<Grid x:Name="HeaderTitleColumn"
PointerPressed="TopBar_PointerPressed"
Grid.Column="1"
ColumnDefinitions="Auto,*"
MinHeight="44"
VerticalAlignment="Center">
<TextBlock x:Name="HeaderTitleText"
Text="Library" ToolTip.Tip="{Binding Text, RelativeSource={RelativeSource Self}}"
FontSize="24"
Margin="12,0,8,0"
FontWeight="Bold"
Foreground="{DynamicResource ThemeText}"
VerticalAlignment="Center"
HorizontalAlignment="Left"
TextWrapping="NoWrap"
TextTrimming="CharacterEllipsis"
IsHitTestVisible="True"/>
</Grid>
<Grid x:Name="DesktopInlineTopBar"
Grid.Column="2"
IsVisible="{Binding IsDesktopPlatform}">
<views:LibraryToolbarView x:Name="LibraryToolbar"/>
</Grid>
<StackPanel x:Name="HeaderFixedActions" Grid.Column="3"
Orientation="Horizontal"
HorizontalAlignment="Right"
VerticalAlignment="Center">
<StackPanel x:Name="MobileHeaderActions"
Orientation="Horizontal"
VerticalAlignment="Center"
IsVisible="{Binding IsMobile}">
<Button x:Name="MobileSearchToggleButton"
Classes="modern-icon mobile-header-icon"
Width="28"
Height="28"
Margin="8,0,0,0"
Padding="0"
Background="Transparent"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
IsVisible="False"
PlatformFeedback.FeedbackType="Auto"
ToolTip.Tip="Search"
>
<Border Width="28" Height="28" CornerRadius="8" Background="#2a2a2a">
<Viewbox Width="14" Height="14"
HorizontalAlignment="Center" VerticalAlignment="Center">
<Canvas Width="24" Height="24">
<Ellipse Width="16" Height="16"
Canvas.Left="1" Canvas.Top="1"
Stroke="White" StrokeThickness="2.2"
Fill="Transparent"/>
<Line StartPoint="14,14" EndPoint="22.5,22.5"
Stroke="White" StrokeThickness="2.6"
StrokeLineCap="Round"/>
</Canvas>
</Viewbox>
</Border>
</Button>
<Button x:Name="MobileAddButton"
Classes="modern-icon mobile-header-icon"
Width="28"
Height="28"
Margin="8,0,0,0"
Padding="0"
Background="Transparent"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
IsVisible="False"
PlatformFeedback.FeedbackType="Auto"
ToolTip.Tip="Add New Entry"
Click="AddNewEntryButton_Click">
<Border Width="28" Height="28" CornerRadius="8" Background="#2a2a2a">
<TextBlock Text="+"
FontSize="18"
FontWeight="SemiBold"
Foreground="White"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</Button>
<Button x:Name="MobileSortButton"
Classes="modern-icon mobile-header-icon"
Width="28"
Height="28"
Margin="8,0,0,0"
Padding="0"
Background="Transparent"
HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch"
IsVisible="False"
PlatformFeedback.FeedbackType="Auto"
ToolTip.Tip="Sort">
<Button.Flyout>
<MenuFlyout Placement="BottomEdgeAlignedRight"
Opening="MobileLibrarySortFlyout_Opening">
<MenuItem Header="Name (A-Z)" Tag="Name" Click="MobileLibrarySortItem_Click"/>
<MenuItem Header="Name (Z-A)" Tag="NameDesc" Click="MobileLibrarySortItem_Click"/>
<MenuItem Header="Installed First" Tag="Installed" Click="MobileLibrarySortItem_Click"/>
<MenuItem Header="Not Installed First" Tag="NotInstalled" Click="MobileLibrarySortItem_Click"/>
<MenuItem Header="Last Played" Tag="LastPlayed" Click="MobileLibrarySortItem_Click"/>
</MenuFlyout>
</Button.Flyout>
<Border Width="28" Height="28" CornerRadius="8" Background="#2a2a2a">
<TextBlock Text="↕"
FontSize="16"
Foreground="White"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</Button>
</StackPanel>
<!-- Version text -->
<TextBlock Text="{Binding Shell.Version}"
VerticalAlignment="Center"
HorizontalAlignment="Right"
Foreground="{DynamicResource ThemeText}"
FontSize="14"
IsHitTestVisible="False"
IsVisible="{Binding IsDesktopPlatform}"/>
<Button x:Name="CheckForUpdatesButton"
IsVisible="{Binding ShowUpdateCheckButton}"
Classes="modern-icon"
Width="32"
Height="32"
ClipToBounds="False"
Margin="12,0,0,0"
ToolTip.Tip="{Binding Shell.CheckForUpdatesToolTip}"
Click="CheckforUpdates_Click">
<Grid Width="32" Height="32" ClipToBounds="False">
<Image Width="28"
Height="28"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Source="avares://QuiverLauncher/Assets/CheckForUpdates.png"
Opacity="{Binding Shell.CheckForUpdatesIconOpacity}"/>
<Border Width="28"
Height="2"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
ClipToBounds="True"
CornerRadius="1"
IsVisible="{Binding Shell.IsCheckingUpdates}">
<ProgressBar Height="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
BorderThickness="0"
Background="Transparent"
IsIndeterminate="True"/>
</Border>
<Border Background="#FF9500"
CornerRadius="8"
MinWidth="16"
MinHeight="18"
Padding="5,2"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0,-2,-2,0"
IsVisible="{Binding Shell.UpdatesBadgeVisible}">
<TextBlock Text="{Binding Shell.UpdatesBadgeText}"
FontSize="9"
FontWeight="Bold"
Foreground="White"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<Border Background="{DynamicResource ThemeSuccess}"
CornerRadius="8"
Width="16"
Height="16"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0,-2,-2,0"
IsVisible="{Binding Shell.UpdatesUpToDateBadgeVisible}">
<TextBlock Text="✓"
FontSize="10"
FontWeight="Bold"
Foreground="White"
HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</Grid>
</Button>
<Button x:Name="SettingsButton"
IsVisible="{Binding ShowSettingsButton}"
Classes="modern-icon"
Width="28"
Height="28"
Margin="8,0,0,0"
ToolTip.Tip="Settings"
Click="SettingsButton_Click">
<Image Width="28" Height="28"
Source="avares://QuiverLauncher/Assets/Settings.png"/>
</Button>
<!-- Minimize Button -->
<Button x:Name="MinimizeButton"
Classes="modern-icon"
Width="28"
Margin="12,0,0,0"
ClickMode="Press"
IsVisible="{Binding ShowMinimizeButton}"
Click="MinimizeButton_Click">
<Image Width="28"
Height="28"
Source="avares://QuiverLauncher/Assets/Icons/button_minimize.png"/>
</Button>
<!-- Maximize Button -->
<Button x:Name="ToggleMaximizeButton"
Classes="modern-icon"
Width="28"
Margin="8,0,0,0"
ClickMode="Press"
IsVisible="{Binding ShowWindowChromeButtons}"
ToolTip.Tip="{Binding MaximizeButtonTip}"
Click="ToggleMaximize_Click">
<Image Width="28"
Height="28"
Source="avares://QuiverLauncher/Assets/Icons/button_fullscreen.png"/>
</Button>
<!-- Close Button -->
<Button x:Name="CloseLauncherButton"
Classes="modern-icon"
Width="28"
Margin="8,0,10,0"
ClickMode="Press"
IsVisible="{Binding ShowWindowChromeButtons}"
Click="CloseLauncher_Click">
<Image Width="28"
Height="28"
Source="avares://QuiverLauncher/Assets/Icons/button_close.png"/>
</Button>
</StackPanel>
</Grid>
<Grid x:Name="MobileSecondaryTopBar"
Grid.Row="1"
Margin="8,8,8,0"
IsVisible="False">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Grid x:Name="MobileSearchSlot" Grid.Row="0"/>
<DockPanel x:Name="MobileLibraryActionsSlot"
Grid.Row="1"
LastChildFill="True"
Margin="0,8,0,0"/>
</Grid>
</Grid>
</Border>
</Grid>
<!-- Top strip: announcement always wins over the GitHub token warning. -->
<StackPanel Grid.Row="1" ZIndex="1">
<views:UpdateCheckStatusView x:Name="UpdateCheckStatus" DataContext="{Binding Shell}" CancelRequested="CancelUpdateCheck_Click" RetryRequested="RetryUpdateCheck_Click" DismissRequested="DismissUpdateCheck_Click"/>
<views:AndroidLauncherUpdateView x:Name="AndroidUpdateBanner" DataContext="{Binding AndroidUpdates}" IsBanner="True" IsVisible="{Binding ShowBanner, FallbackValue=False}"/>
<views:LauncherBannerView x:Name="Banners"/>
</StackPanel>
<!-- Apps Content with Settings Panel Overlay -->
<Grid Grid.Row="2">
<Control x:Name="CardGamepadFocusSink"
Width="1"
Height="1"
HorizontalAlignment="Left"
VerticalAlignment="Top"
Opacity="0"
IsHitTestVisible="False"
Focusable="True"
FocusAdorner="{x:Null}"
KeyboardNavigation.IsTabStop="False"
XYFocus.NavigationModes="Disabled"/>
<!-- Background Image -->
<Border Background="{DynamicResource ThemeDarker}"/>
<Image x:Name="StaticBackgroundImage"
asyncImageLoader:ImageLoader.Source="{Binding Shell.BackgroundImageUri}"
Stretch="Fill"
Opacity="{Binding Shell.BackgroundOpacity}"/>
<!-- Main App List -->
<Grid><views:LibraryView x:Name="LibraryPanel"/>
<views:AppUpdateReviewView x:Name="AppUpdatesReviewPanel" IsVisible="False" Margin="30,20,6,30"/>
<views:ModsView x:Name="ModsPanel" IsVisible="False" Margin="30,20,6,30"/>
</Grid>
<!-- Browse -->
<views:BrowseView x:Name="BrowsePanel" services:MouseWheelScroll.Multiplier="{Binding #ShellRoot.SettingsModel.MouseWheelScrollSpeed}" IsVisible="False" Margin="30,20,6,30"/>
<TextBlock x:Name="GamepadHintsBar"
FontSize="11"
Foreground="{DynamicResource ThemeTextSecondary}"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Margin="0,0,0,8"
IsVisible="{Binding GamepadHintsVisible}"/>
<!-- Settings Panel Overlay -->
<views:SettingsView x:Name="SettingsPanel" HorizontalAlignment="Right" VerticalAlignment="Stretch" Width="400" IsVisible="False" ZIndex="10"/>
<views:DocumentView x:Name="ChangelogPanel" Grid.RowSpan="2" IsVisible="False" ZIndex="100"/>
<!-- Browse app details -->
<views:BrowseDetailsView x:Name="BrowseDetailsPanel" services:MouseWheelScroll.Multiplier="{Binding #ShellRoot.SettingsModel.MouseWheelScrollSpeed}" Grid.RowSpan="2" IsVisible="{Binding #ShellRoot.Shell.BrowseDetailsOpen}" ZIndex="110"/>
<!-- Mod details (README / Changelog) -->
<ContentControl x:Name="ModDetailsPanel" IsVisible="{Binding Shell.ModDetailsOpen}" Grid.RowSpan="2" ZIndex="110" HorizontalContentAlignment="Stretch" VerticalContentAlignment="Stretch"/>
<!-- Entry Form Overlay -->
<views:AppEntryEditorView x:Name="EntryFormOverlay" Grid.RowSpan="2" IsVisible="{Binding #ShellRoot.Shell.EntryEditorOpen}" ZIndex="100"/>
<!-- Display Filter Overlay -->
<views:DisplayFilterEditorView x:Name="DisplayFilterOverlay" Grid.RowSpan="2" IsVisible="False" ZIndex="110"/>
<!-- Tag Edit Overlay -->
<views:MetadataEditorView x:Name="TagEditOverlay" Grid.RowSpan="2" IsVisible="{Binding #ShellRoot.Shell.TagEditorOpen}" ZIndex="110"/>
</Grid>
</Grid>
</SplitView>
<Grid x:Name="MobileNavOverlay"
IsVisible="False"
ZIndex="30">
<Border Background="#99000000"
x:Name="MobileNavDimmer"/>
<Border Width="264"
HorizontalAlignment="Left"
Background="{DynamicResource ThemeDarker}"
BorderBrush="{DynamicResource ThemeBorder}"
BorderThickness="0,0,1,0">
<Grid x:Name="MobileNavDrawerHost"/>
</Border>
</Grid>
<views:MessagePromptView x:Name="MessagePromptOverlay" ZIndex="200"/>
</Grid>
</Border>
</UserControl>