feat.完善了时钟轻应用,为启动器提供了多语言支持

This commit is contained in:
lincube
2026-05-18 12:26:23 +08:00
parent 93758fc083
commit b6d820a320
63 changed files with 4581 additions and 342 deletions

View File

@@ -0,0 +1,310 @@
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
x:Class="LanMountainDesktop.AirAppHost.ClockAirAppView">
<UserControl.Styles>
<Style Selector="Border.clock-card">
<Setter Property="Background" Value="#F7FFFFFF" />
<Setter Property="BorderBrush" Value="#16000000" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="18" />
<Setter Property="Padding" Value="18" />
</Style>
<Style Selector="ToggleButton.clock-tab">
<Setter Property="MinWidth" Value="84" />
<Setter Property="Height" Value="34" />
<Setter Property="Padding" Value="14,0" />
<Setter Property="CornerRadius" Value="12" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Foreground" Value="{DynamicResource AirAppSecondaryTextBrush}" />
<Setter Property="FontWeight" Value="SemiBold" />
</Style>
<Style Selector="ToggleButton.clock-tab:checked">
<Setter Property="Background" Value="{DynamicResource AirAppAccentBrush}" />
<Setter Property="Foreground" Value="White" />
</Style>
<Style Selector="Button.clock-command">
<Setter Property="MinHeight" Value="34" />
<Setter Property="Padding" Value="14,6" />
<Setter Property="CornerRadius" Value="12" />
<Setter Property="FontWeight" Value="SemiBold" />
</Style>
<Style Selector="Button.clock-icon-command">
<Setter Property="Width" Value="34" />
<Setter Property="Height" Value="30" />
<Setter Property="Padding" Value="0" />
<Setter Property="CornerRadius" Value="10" />
</Style>
<Style Selector="TextBlock.clock-muted">
<Setter Property="Foreground" Value="{DynamicResource AirAppSecondaryTextBrush}" />
</Style>
</UserControl.Styles>
<Grid RowDefinitions="Auto,*"
RowSpacing="16"
Margin="22,14,22,20">
<Grid ColumnDefinitions="*,Auto">
<StackPanel Spacing="3"
VerticalAlignment="Center">
<TextBlock x:Name="HeaderTitleTextBlock"
FontSize="24"
FontWeight="SemiBold"
Foreground="{DynamicResource AirAppTitleTextBrush}" />
<TextBlock x:Name="HeaderSubtitleTextBlock"
Classes="clock-muted"
FontSize="12" />
</StackPanel>
<Border Grid.Column="1"
Background="#0A000000"
CornerRadius="14"
Padding="4"
VerticalAlignment="Center">
<StackPanel Orientation="Horizontal"
Spacing="4">
<ToggleButton x:Name="WorldTabButton"
Classes="clock-tab"
Tag="world"
Click="OnTabButtonClick" />
<ToggleButton x:Name="StopwatchTabButton"
Classes="clock-tab"
Tag="stopwatch"
Click="OnTabButtonClick" />
<ToggleButton x:Name="TimerTabButton"
Classes="clock-tab"
Tag="timer"
Click="OnTabButtonClick" />
<ToggleButton x:Name="SettingsTabButton"
Classes="clock-tab"
Tag="settings"
Click="OnTabButtonClick" />
</StackPanel>
</Border>
</Grid>
<Grid Grid.Row="1">
<Grid x:Name="WorldPage"
ColumnDefinitions="1.05*,1.1*"
ColumnSpacing="16">
<Border Classes="clock-card">
<Grid RowDefinitions="Auto,*,Auto">
<TextBlock x:Name="LocalLabelTextBlock"
Classes="clock-muted"
FontSize="13"
FontWeight="SemiBold" />
<StackPanel Grid.Row="1"
Spacing="12"
VerticalAlignment="Center">
<TextBlock x:Name="LocalTimeTextBlock"
FontSize="54"
FontWeight="SemiBold"
LetterSpacing="0"
Foreground="{DynamicResource AirAppTitleTextBrush}" />
<TextBlock x:Name="LocalDateTextBlock"
Classes="clock-muted"
FontSize="15" />
<TextBlock x:Name="LocalTimeZoneTextBlock"
Classes="clock-muted"
FontSize="12"
TextWrapping="Wrap" />
</StackPanel>
<TextBlock x:Name="WorldSummaryTextBlock"
Grid.Row="2"
Classes="clock-muted"
FontSize="12" />
</Grid>
</Border>
<Border Grid.Column="1"
Classes="clock-card">
<Grid RowDefinitions="Auto,Auto,*"
RowSpacing="12">
<Grid ColumnDefinitions="*,Auto"
ColumnSpacing="8">
<TextBox x:Name="TimeZoneSearchTextBox"
PlaceholderText="Search"
TextChanged="OnTimeZoneSearchChanged" />
<Button x:Name="AddCityButton"
Grid.Column="1"
Classes="clock-command"
Click="OnAddCityClick" />
</Grid>
<ComboBox x:Name="TimeZoneComboBox"
Grid.Row="1"
HorizontalAlignment="Stretch"
MaxDropDownHeight="280" />
<ScrollViewer Grid.Row="2"
VerticalScrollBarVisibility="Auto">
<StackPanel x:Name="WorldClockRowsPanel"
Spacing="8" />
</ScrollViewer>
</Grid>
</Border>
</Grid>
<Border x:Name="StopwatchPage"
Classes="clock-card">
<Grid RowDefinitions="Auto,Auto,*"
RowSpacing="18">
<TextBlock x:Name="StopwatchHintTextBlock"
Classes="clock-muted"
FontSize="13" />
<StackPanel Grid.Row="1"
Spacing="18"
HorizontalAlignment="Center">
<TextBlock x:Name="StopwatchElapsedTextBlock"
Text="00:00:00.00"
FontSize="58"
FontWeight="SemiBold"
LetterSpacing="0"
Foreground="{DynamicResource AirAppTitleTextBrush}" />
<StackPanel Orientation="Horizontal"
HorizontalAlignment="Center"
Spacing="10">
<Button x:Name="StopwatchStartPauseButton"
Classes="clock-command"
Click="OnStopwatchStartPauseClick" />
<Button x:Name="StopwatchLapButton"
Classes="clock-command"
Click="OnStopwatchLapClick" />
<Button x:Name="StopwatchResetButton"
Classes="clock-command"
Click="OnStopwatchResetClick" />
</StackPanel>
</StackPanel>
<ScrollViewer Grid.Row="2"
VerticalScrollBarVisibility="Auto">
<StackPanel x:Name="StopwatchLapsPanel"
Spacing="6" />
</ScrollViewer>
</Grid>
</Border>
<Border x:Name="TimerPage"
Classes="clock-card">
<Grid RowDefinitions="Auto,Auto,Auto,*"
RowSpacing="18">
<TextBlock x:Name="TimerHintTextBlock"
Classes="clock-muted"
FontSize="13" />
<TextBlock x:Name="TimerRemainingTextBlock"
Grid.Row="1"
Text="00:05:00"
FontSize="58"
FontWeight="SemiBold"
LetterSpacing="0"
Foreground="{DynamicResource AirAppTitleTextBrush}"
HorizontalAlignment="Center" />
<StackPanel Grid.Row="2"
Orientation="Horizontal"
HorizontalAlignment="Center"
Spacing="8">
<Button Classes="clock-command"
Tag="1"
Click="OnTimerPresetClick">1</Button>
<Button Classes="clock-command"
Tag="5"
Click="OnTimerPresetClick">5</Button>
<Button Classes="clock-command"
Tag="10"
Click="OnTimerPresetClick">10</Button>
<Button Classes="clock-command"
Tag="15"
Click="OnTimerPresetClick">15</Button>
<Button Classes="clock-command"
Tag="30"
Click="OnTimerPresetClick">30</Button>
</StackPanel>
<Grid Grid.Row="3"
RowDefinitions="Auto,Auto,Auto"
RowSpacing="14"
HorizontalAlignment="Center">
<StackPanel Orientation="Horizontal"
Spacing="8"
HorizontalAlignment="Center">
<TextBox x:Name="TimerMinutesTextBox"
Width="120"
PlaceholderText="Minutes"
Text="5" />
<Button x:Name="TimerApplyButton"
Classes="clock-command"
Click="OnTimerApplyClick" />
</StackPanel>
<StackPanel Grid.Row="1"
Orientation="Horizontal"
HorizontalAlignment="Center"
Spacing="10">
<Button x:Name="TimerStartPauseButton"
Classes="clock-command"
Click="OnTimerStartPauseClick" />
<Button x:Name="TimerResetButton"
Classes="clock-command"
Click="OnTimerResetClick" />
</StackPanel>
<TextBlock x:Name="TimerStatusTextBlock"
Grid.Row="2"
Classes="clock-muted"
FontSize="13"
HorizontalAlignment="Center" />
</Grid>
</Grid>
</Border>
<Border x:Name="SettingsPage"
Classes="clock-card">
<StackPanel Spacing="18"
MaxWidth="560"
HorizontalAlignment="Left">
<TextBlock x:Name="SettingsHeaderTextBlock"
FontSize="18"
FontWeight="SemiBold"
Foreground="{DynamicResource AirAppTitleTextBrush}" />
<Grid ColumnDefinitions="220,*"
RowDefinitions="Auto,Auto,Auto,Auto"
RowSpacing="14"
ColumnSpacing="18">
<TextBlock x:Name="TimeFormatLabelTextBlock"
Classes="clock-muted"
VerticalAlignment="Center" />
<ComboBox x:Name="TimeFormatComboBox"
Grid.Column="1"
SelectionChanged="OnSettingsChanged" />
<TextBlock x:Name="StartupTabLabelTextBlock"
Grid.Row="1"
Classes="clock-muted"
VerticalAlignment="Center" />
<ComboBox x:Name="StartupTabComboBox"
Grid.Row="1"
Grid.Column="1"
SelectionChanged="OnSettingsChanged" />
<CheckBox x:Name="ShowSecondsCheckBox"
Grid.Row="2"
Grid.ColumnSpan="2"
IsCheckedChanged="OnSettingsChanged" />
<CheckBox x:Name="ActivateOnTimerFinishedCheckBox"
Grid.Row="3"
Grid.ColumnSpan="2"
IsCheckedChanged="OnSettingsChanged" />
</Grid>
</StackPanel>
</Border>
</Grid>
</Grid>
</UserControl>