Files
LanMountainDesktop/LanMountainDesktop/Views/MainWindow.axaml
2026-03-13 22:20:12 +08:00

513 lines
31 KiB
XML

<Window xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:vm="using:LanMountainDesktop.ViewModels"
xmlns:ui="using:FluentAvalonia.UI.Controls"
xmlns:fi="using:FluentIcons.Avalonia"
xmlns:ic="using:FluentIcons.Avalonia.Fluent"
xmlns:comp="using:LanMountainDesktop.Views.Components"
xmlns:vlc="clr-namespace:LibVLCSharp.Avalonia;assembly=LibVLCSharp.Avalonia"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d"
d:DesignWidth="1280"
d:DesignHeight="720"
x:Class="LanMountainDesktop.Views.MainWindow"
x:DataType="vm:MainWindowViewModel"
Icon="/Assets/avalonia-logo.ico"
WindowState="FullScreen"
SystemDecorations="None"
CanResize="False"
UseLayoutRounding="True"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Background="{DynamicResource AdaptiveSurfaceBaseBrush}"
Title="LanMountainDesktop">
<Design.DataContext>
<vm:MainWindowViewModel />
</Design.DataContext>
<Window.Resources>
<SolidColorBrush x:Key="AdaptivePrimaryBrush" Color="#FF1D4ED8" />
<SolidColorBrush x:Key="AdaptiveSecondaryBrush" Color="#FF1E40AF" />
<SolidColorBrush x:Key="AdaptiveTextPrimaryBrush" Color="#FFF8FAFC" />
<SolidColorBrush x:Key="AdaptiveTextSecondaryBrush" Color="#FFE2E8F0" />
<SolidColorBrush x:Key="AdaptiveTextMutedBrush" Color="#FF94A3B8" />
<SolidColorBrush x:Key="AdaptiveTextAccentBrush" Color="#FF93C5FD" />
<SolidColorBrush x:Key="AdaptiveAccentBrush" Color="#FF3B82F6" />
<SolidColorBrush x:Key="AdaptiveOnAccentBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="AdaptiveSurfaceBaseBrush" Color="#FF020617" />
<SolidColorBrush x:Key="AdaptiveSurfaceRaisedBrush" Color="#FF1E293B" />
<SolidColorBrush x:Key="AdaptiveSurfaceOverlayBrush" Color="#CC0F172A" />
<SolidColorBrush x:Key="AdaptiveButtonBackgroundBrush" Color="#66334155" />
<SolidColorBrush x:Key="AdaptiveButtonBorderBrush" Color="#80E2E8F0" />
<SolidColorBrush x:Key="AdaptiveButtonHoverBackgroundBrush" Color="#88475A74" />
<SolidColorBrush x:Key="AdaptiveButtonPressedBackgroundBrush" Color="#AA2A3B55" />
<SolidColorBrush x:Key="AdaptiveGlassPanelBackgroundBrush" Color="#70233448" />
<SolidColorBrush x:Key="AdaptiveGlassPanelBorderBrush" Color="#70475569" />
<SolidColorBrush x:Key="AdaptiveGlassStrongBackgroundBrush" Color="#A01E293B" />
<SolidColorBrush x:Key="AdaptiveGlassStrongBorderBrush" Color="#80475569" />
<SolidColorBrush x:Key="AdaptiveGlassOverlayBackgroundBrush" Color="#9A0F172A" />
<SolidColorBrush x:Key="AdaptiveNavTextBrush" Color="#FFF8FAFC" />
<SolidColorBrush x:Key="AdaptiveNavSelectedTextBrush" Color="#FFFFFFFF" />
<SolidColorBrush x:Key="AdaptiveNavSelectionIndicatorBrush" Color="#FF93C5FD" />
<SolidColorBrush x:Key="AdaptiveNavItemBackgroundBrush" Color="#220F172A" />
<SolidColorBrush x:Key="AdaptiveNavItemHoverBackgroundBrush" Color="#40334155" />
<SolidColorBrush x:Key="AdaptiveNavItemSelectedBackgroundBrush" Color="#CC1D4ED8" />
<SolidColorBrush x:Key="AdaptiveToggleOnBrush" Color="#FF3B82F6" />
<SolidColorBrush x:Key="AdaptiveToggleOffBrush" Color="#66475569" />
<SolidColorBrush x:Key="AdaptiveToggleBorderBrush" Color="#80E2E8F0" />
<x:Double x:Key="AdaptiveGlassPanelBlurRadius">22</x:Double>
<x:Double x:Key="AdaptiveGlassStrongBlurRadius">28</x:Double>
<x:Double x:Key="AdaptiveGlassPanelOpacity">0.92</x:Double>
<x:Double x:Key="AdaptiveGlassStrongOpacity">0.95</x:Double>
</Window.Resources>
<Grid>
<Grid x:Name="DesktopPage"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<Grid.Transitions>
<Transitions>
<DoubleTransition Property="Opacity" Duration="{StaticResource FluttermotionToken.Duration.Page}" />
</Transitions>
</Grid.Transitions>
<Border x:Name="DesktopHost"
ClipToBounds="True"
Background="Transparent"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch">
<Grid>
<Border x:Name="DesktopWallpaperLayer"
IsHitTestVisible="False"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="{DynamicResource AdaptiveSurfaceBaseBrush}" />
<Image x:Name="DesktopVideoWallpaperImage"
IsVisible="False"
IsHitTestVisible="False"
Stretch="UniformToFill"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch" />
<Grid x:Name="DesktopGrid"
HorizontalAlignment="Center"
VerticalAlignment="Center"
ShowGridLines="False">
<Border x:Name="DesktopPagesViewport"
Grid.Row="1"
Grid.Column="0"
Grid.ColumnSpan="1"
Background="Transparent"
ClipToBounds="True"
BorderThickness="0"
PointerWheelChanged="OnDesktopPagesPointerWheelChanged">
<Grid>
<Grid x:Name="DesktopPagesHost"
HorizontalAlignment="Left"
VerticalAlignment="Top">
<Grid.RenderTransform>
<TranslateTransform>
<TranslateTransform.Transitions>
<Transitions>
<DoubleTransition Property="X" Duration="{StaticResource FluttermotionToken.Duration.Page}" />
</Transitions>
</TranslateTransform.Transitions>
</TranslateTransform>
</Grid.RenderTransform>
<Grid x:Name="DesktopPagesContainer"
Grid.Column="0" />
<Border x:Name="LauncherPagePanel"
Grid.Column="1"
Classes="glass-panel"
ClipToBounds="False"
CornerRadius="36"
Padding="18">
<Grid RowDefinitions="Auto,*">
<StackPanel Spacing="4">
<TextBlock x:Name="LauncherTitleTextBlock"
FontSize="24"
FontWeight="SemiBold"
Text="App Launcher" />
<TextBlock x:Name="LauncherSubtitleTextBlock"
Foreground="{DynamicResource AdaptiveTextSecondaryBrush}"
Text="Apps and folders from Windows Start Menu." />
</StackPanel>
<Grid Grid.Row="1"
Margin="0,12,0,0">
<ScrollViewer x:Name="LauncherRootScrollViewer"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<WrapPanel x:Name="LauncherRootTilePanel"
Orientation="Horizontal" />
</ScrollViewer>
<Grid x:Name="LauncherFolderOverlay"
IsVisible="False"
Background="{DynamicResource AdaptiveGlassOverlayBackgroundBrush}"
Opacity="{DynamicResource AdaptiveGlassOverlayOpacity}"
PointerPressed="OnLauncherFolderOverlayPointerPressed">
<Border x:Name="LauncherFolderPanel"
Classes="mica-strong"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Margin="52"
MaxWidth="760"
MaxHeight="520"
CornerRadius="36"
Padding="14">
<Border.RenderTransform>
<TranslateTransform Y="42" />
</Border.RenderTransform>
<Grid RowDefinitions="Auto,*"
RowSpacing="10">
<Grid ColumnDefinitions="Auto,*,Auto"
ColumnSpacing="8">
<Button x:Name="LauncherFolderBackButton"
Grid.Column="0"
Width="38"
Height="34"
Padding="0"
Click="OnLauncherFolderBackClick">
<fi:FluentIcon Icon="ArrowLeft"
IconVariant="Regular" />
</Button>
<TextBlock x:Name="LauncherFolderTitleTextBlock"
Grid.Column="1"
HorizontalAlignment="Center"
VerticalAlignment="Center"
FontWeight="SemiBold"
Text="Folder" />
<Button x:Name="LauncherFolderCloseButton"
Grid.Column="2"
Width="38"
Height="34"
Padding="0"
Click="OnLauncherFolderCloseClick">
<fi:FluentIcon Icon="Dismiss"
IconVariant="Regular" />
</Button>
</Grid>
<ScrollViewer x:Name="LauncherFolderScrollViewer"
Grid.Row="1"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<WrapPanel x:Name="LauncherFolderTilePanel"
Orientation="Horizontal" />
</ScrollViewer>
</Grid>
</Border>
</Grid>
</Grid>
</Grid>
</Border>
</Grid>
<Canvas x:Name="DesktopEditDragLayer"
IsHitTestVisible="False" />
</Grid>
</Border>
<Border x:Name="TopStatusBarHost"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="1"
Background="Transparent"
BorderThickness="0"
Padding="4">
<StackPanel x:Name="TopStatusComponentsPanel"
Orientation="Horizontal"
Spacing="6">
<comp:ClockWidget x:Name="ClockWidget"
IsVisible="False"
Margin="0" />
</StackPanel>
</Border>
<Border x:Name="BottomTaskbarContainer"
Classes="glass-island"
Grid.Row="0"
Grid.Column="0"
Grid.ColumnSpan="1"
HorizontalAlignment="Stretch"
Margin="0"
CornerRadius="36"
Padding="6">
<Grid ColumnDefinitions="Auto,*,Auto"
ColumnSpacing="8">
<Border x:Name="TaskbarFixedActionsHost"
Grid.Column="0"
Background="Transparent"
BorderThickness="0">
<Grid ColumnDefinitions="Auto"
ColumnSpacing="8">
<Button x:Name="BackToWindowsButton"
Grid.Column="0"
Padding="8"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="Transparent"
BorderThickness="0"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Click="OnMinimizeClick"
ToolTip.Tip="&#22238;&#21040;Windows">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Spacing="8">
<fi:FluentIcon x:Name="BackToWindowsIcon"
Icon="Window"
IconVariant="Regular" />
<TextBlock x:Name="BackToWindowsTextBlock"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Text="&#22238;&#21040;Windows" />
</StackPanel>
</Button>
</Grid>
</Border>
<Border x:Name="TaskbarDynamicActionsHost"
Grid.Column="1"
Background="Transparent"
BorderThickness="0"
IsVisible="False">
<StackPanel x:Name="TaskbarDynamicActionsPanel"
Orientation="Horizontal"
Spacing="8" />
</Border>
<Border x:Name="TaskbarSettingsActionHost"
Grid.Column="2"
Background="Transparent"
BorderThickness="0">
<Grid ColumnDefinitions="Auto,Auto,Auto"
ColumnSpacing="8">
<Button x:Name="OpenSettingsButton"
Grid.Column="0"
IsVisible="False"
Padding="8"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="Transparent"
BorderThickness="0"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Click="OnOpenSettingsClick"
ToolTip.Tip="Settings">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Spacing="8">
<fi:FluentIcon x:Name="OpenSettingsIcon"
Icon="Settings"
IconVariant="Regular" />
<TextBlock x:Name="OpenSettingsButtonTextBlock"
IsVisible="False"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Text="Settings" />
</StackPanel>
</Button>
<Button x:Name="OpenComponentLibraryButton"
Grid.Column="1"
IsVisible="False"
Padding="8"
HorizontalAlignment="Stretch"
VerticalAlignment="Stretch"
Background="Transparent"
BorderThickness="0"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Click="OnOpenComponentLibraryClick"
ToolTip.Tip="&#32452;&#20214;&#24211;">
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Spacing="8">
<fi:FluentIcon x:Name="OpenComponentLibraryIcon"
Icon="Apps"
IconVariant="Regular" />
<TextBlock x:Name="OpenComponentLibraryTextBlock"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Text="&#32452;&#20214;&#24211;" />
</StackPanel>
</Button>
</Grid>
</Border>
</Grid>
</Border>
</Grid>
</Grid>
</Border>
</Grid>
<Border x:Name="ComponentLibraryWindow"
IsVisible="False"
Opacity="0"
Classes="glass-strong"
HorizontalAlignment="Center"
VerticalAlignment="Bottom"
Width="620"
MinWidth="420"
MaxWidth="860"
Height="320"
MinHeight="260"
Margin="24,24,24,100"
CornerRadius="36"
Padding="14"
PointerPressed="OnComponentLibraryWindowPointerPressed"
PointerMoved="OnComponentLibraryWindowPointerMoved"
PointerReleased="OnComponentLibraryWindowPointerReleased">
<Border.Transitions>
<Transitions>
<DoubleTransition Property="Opacity" Duration="{StaticResource FluttermotionToken.Duration.Slow}" />
</Transitions>
</Border.Transitions>
<Grid RowDefinitions="Auto,*"
RowSpacing="10">
<Grid ColumnDefinitions="*,Auto">
<TextBlock x:Name="ComponentLibraryTitleTextBlock"
VerticalAlignment="Center"
FontSize="16"
FontWeight="SemiBold"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Text="Widgets" />
<Button x:Name="CloseComponentLibraryButton"
Grid.Column="1"
Padding="8"
Width="32"
Height="32"
Background="Transparent"
BorderThickness="0"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Click="OnCloseComponentLibraryClick">
<fi:SymbolIcon Classes="icon-s"
Symbol="Dismiss"
IconVariant="Regular" />
</Button>
</Grid>
<Border Grid.Row="1"
Classes="glass-panel"
CornerRadius="12"
Padding="14">
<Grid>
<!-- Category picker (outer) -->
<Grid x:Name="ComponentLibraryCategoriesView">
<Grid RowDefinitions="*">
<Border x:Name="ComponentLibraryCategoryViewport"
Background="Transparent"
ClipToBounds="True">
<ScrollViewer VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<Grid x:Name="ComponentLibraryCategoryPagesHost"
HorizontalAlignment="Stretch"
VerticalAlignment="Top">
<Grid x:Name="ComponentLibraryCategoryPagesContainer" />
</Grid>
</ScrollViewer>
</Border>
<TextBlock x:Name="ComponentLibraryEmptyTextBlock"
VerticalAlignment="Center"
HorizontalAlignment="Center"
Foreground="{DynamicResource AdaptiveTextSecondaryBrush}"
Text="No components." />
</Grid>
</Grid>
<!-- Component picker (inner) -->
<Grid x:Name="ComponentLibraryComponentsView"
IsVisible="False"
RowDefinitions="Auto,*"
RowSpacing="10">
<Button x:Name="ComponentLibraryBackButton"
Grid.Row="0"
HorizontalAlignment="Left"
Padding="8,6"
Background="Transparent"
BorderThickness="0"
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
Click="OnComponentLibraryBackClick">
<StackPanel Orientation="Horizontal" Spacing="8">
<fi:SymbolIcon Classes="icon-s" Symbol="ArrowLeft" IconVariant="Regular" />
<TextBlock x:Name="ComponentLibraryBackTextBlock"
VerticalAlignment="Center"
Text="Back" />
</StackPanel>
</Button>
<Grid Grid.Row="1"
ColumnDefinitions="Auto,*,Auto"
ColumnSpacing="8">
<Button x:Name="ComponentLibraryPrevComponentButton"
Grid.Column="0"
Width="36"
Height="36"
Padding="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
CornerRadius="18"
Click="OnComponentLibraryPrevComponentClick"
IsVisible="False">
<fi:SymbolIcon Symbol="ChevronLeft"
IconVariant="Regular" />
</Button>
<Border x:Name="ComponentLibraryComponentViewport"
Grid.Column="1"
Background="Transparent"
ClipToBounds="True"
PointerPressed="OnComponentLibraryComponentViewportPointerPressed"
PointerMoved="OnComponentLibraryComponentViewportPointerMoved"
PointerReleased="OnComponentLibraryComponentViewportPointerReleased"
PointerCaptureLost="OnComponentLibraryComponentViewportPointerCaptureLost">
<Grid>
<Grid x:Name="ComponentLibraryComponentPagesHost"
HorizontalAlignment="Left"
VerticalAlignment="Top">
<Grid.RenderTransform>
<TranslateTransform>
<TranslateTransform.Transitions>
<Transitions>
<DoubleTransition Property="X" Duration="{StaticResource FluttermotionToken.Duration.Page}" />
</Transitions>
</TranslateTransform.Transitions>
</TranslateTransform>
</Grid.RenderTransform>
<Grid x:Name="ComponentLibraryComponentPagesContainer" />
</Grid>
</Grid>
</Border>
<Button x:Name="ComponentLibraryNextComponentButton"
Grid.Column="2"
Width="36"
Height="36"
Padding="0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
CornerRadius="18"
Click="OnComponentLibraryNextComponentClick"
IsVisible="False">
<fi:SymbolIcon Symbol="ChevronRight"
IconVariant="Regular" />
</Button>
</Grid>
</Grid>
</Grid>
</Border>
</Grid>
</Border>
</Grid>
</Window>