mirror of
https://github.com/wwiinnddyy/LanMountainDesktop.git
synced 2026-06-21 16:14:28 +08:00
355 lines
18 KiB
XML
355 lines
18 KiB
XML
<UserControl xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:ui="using:FluentAvalonia.UI.Controls"
|
|
xmlns:fi="using:FluentIcons.Avalonia.Fluent"
|
|
mc:Ignorable="d" d:DesignWidth="860" d:DesignHeight="1200"
|
|
x:Class="LanMountainDesktop.Views.SettingsPages.WeatherSettingsPage">
|
|
|
|
<UserControl.Styles>
|
|
<Style Selector="StackPanel.weather-settings-root TextBlock.section-eyebrow">
|
|
<Setter Property="FontSize" Value="13" />
|
|
<Setter Property="FontWeight" Value="SemiBold" />
|
|
<Setter Property="Foreground" Value="{DynamicResource AdaptiveTextSecondaryBrush}" />
|
|
</Style>
|
|
|
|
<Style Selector="StackPanel.weather-settings-root Border.preview-icon-shell">
|
|
<Setter Property="Width" Value="62" />
|
|
<Setter Property="Height" Value="62" />
|
|
<Setter Property="CornerRadius" Value="18" />
|
|
<Setter Property="Background" Value="{DynamicResource AdaptiveSurfaceRaisedBrush}" />
|
|
<Setter Property="BorderThickness" Value="1" />
|
|
<Setter Property="BorderBrush" Value="{DynamicResource AdaptiveButtonBorderBrush}" />
|
|
<Setter Property="Padding" Value="10" />
|
|
</Style>
|
|
|
|
<Style Selector="StackPanel.weather-settings-root Border.settings-note-shell">
|
|
<Setter Property="Background" Value="{DynamicResource AdaptiveSurfaceRaisedBrush}" />
|
|
<Setter Property="CornerRadius" Value="{DynamicResource DesignCornerRadiusSm}" />
|
|
<Setter Property="Padding" Value="14,12" />
|
|
</Style>
|
|
|
|
<Style Selector="StackPanel.weather-settings-root Border.settings-expander-shell">
|
|
<Setter Property="Margin" Value="0" />
|
|
</Style>
|
|
</UserControl.Styles>
|
|
|
|
<StackPanel x:Name="WeatherSettingsContentPanel"
|
|
Classes="settings-animated-intro weather-settings-root"
|
|
Margin="0,0,8,0"
|
|
Spacing="12">
|
|
<TextBlock x:Name="WeatherPanelTitleTextBlock"
|
|
FontSize="28"
|
|
FontWeight="SemiBold"
|
|
Foreground="{DynamicResource AdaptiveTextPrimaryBrush}"
|
|
Text="Weather" />
|
|
|
|
<StackPanel Spacing="8">
|
|
<TextBlock x:Name="WeatherPreviewSectionTextBlock"
|
|
Classes="section-eyebrow"
|
|
Text="Weather Preview" />
|
|
|
|
<Border Classes="settings-expander-shell"
|
|
Padding="18,16">
|
|
<Grid RowDefinitions="Auto,Auto"
|
|
RowSpacing="10">
|
|
<Grid ColumnDefinitions="Auto,*,Auto"
|
|
ColumnSpacing="14">
|
|
<Border Classes="preview-icon-shell">
|
|
<Image x:Name="WeatherPreviewIconImage"
|
|
Stretch="Uniform" />
|
|
</Border>
|
|
|
|
<StackPanel Grid.Column="1"
|
|
VerticalAlignment="Center"
|
|
Spacing="3">
|
|
<TextBlock x:Name="WeatherPreviewTemperatureTextBlock"
|
|
FontSize="34"
|
|
FontWeight="SemiBold"
|
|
Text="--" />
|
|
<TextBlock x:Name="WeatherPreviewUpdatedTextBlock"
|
|
FontSize="13"
|
|
Foreground="{DynamicResource AdaptiveTextSecondaryBrush}"
|
|
Text="-" />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Column="2"
|
|
Orientation="Horizontal"
|
|
Spacing="8"
|
|
VerticalAlignment="Center">
|
|
<Button x:Name="WeatherPreviewButton"
|
|
Padding="16,8"
|
|
Content="Refresh" />
|
|
<ui:ProgressRing x:Name="WeatherPreviewProgressRing"
|
|
Width="20"
|
|
Height="20"
|
|
IsActive="True"
|
|
IsVisible="False" />
|
|
</StackPanel>
|
|
</Grid>
|
|
|
|
<TextBlock x:Name="WeatherPreviewResultTextBlock"
|
|
Grid.Row="1"
|
|
TextWrapping="Wrap"
|
|
Foreground="{DynamicResource AdaptiveTextSecondaryBrush}"
|
|
Text="Use refresh to verify your weather configuration." />
|
|
</Grid>
|
|
</Border>
|
|
</StackPanel>
|
|
|
|
<Border Background="{DynamicResource SurfaceStrokeColorDefaultBrush}"
|
|
Height="1" />
|
|
|
|
<TextBlock x:Name="WeatherSettingsSectionTextBlock"
|
|
Classes="section-eyebrow"
|
|
Text="Settings" />
|
|
|
|
<Border Classes="settings-expander-shell">
|
|
<ui:SettingsExpander x:Name="WeatherLocationSettingsExpander"
|
|
Header="Location Source"
|
|
Description="Choose how weather widgets resolve location."
|
|
IsExpanded="True">
|
|
<ui:SettingsExpander.Footer>
|
|
<ListBox x:Name="WeatherLocationModeChipListBox"
|
|
Classes="settings-chip-list"
|
|
HorizontalAlignment="Right"
|
|
SelectionMode="Single">
|
|
<ListBox.ItemsPanel>
|
|
<ItemsPanelTemplate>
|
|
<WrapPanel Orientation="Horizontal" />
|
|
</ItemsPanelTemplate>
|
|
</ListBox.ItemsPanel>
|
|
<ListBoxItem x:Name="WeatherLocationModeCityChipItem"
|
|
Tag="CitySearch"
|
|
Content="City Search" />
|
|
<ListBoxItem x:Name="WeatherLocationModeCoordinatesChipItem"
|
|
Tag="Coordinates"
|
|
Content="Coordinates" />
|
|
</ListBox>
|
|
</ui:SettingsExpander.Footer>
|
|
|
|
<ui:SettingsExpanderItem>
|
|
<Grid ColumnDefinitions="*,Auto"
|
|
ColumnSpacing="18">
|
|
<StackPanel Spacing="4">
|
|
<TextBlock x:Name="WeatherLocationSelectionTitleTextBlock"
|
|
FontSize="17"
|
|
FontWeight="SemiBold"
|
|
Text="City Selection" />
|
|
<TextBlock x:Name="WeatherLocationSelectionDescriptionTextBlock"
|
|
Foreground="{DynamicResource AdaptiveTextSecondaryBrush}"
|
|
TextWrapping="Wrap"
|
|
Text="Select the current city used for weather queries." />
|
|
</StackPanel>
|
|
|
|
<StackPanel Grid.Column="1"
|
|
MaxWidth="420"
|
|
HorizontalAlignment="Right"
|
|
Spacing="4">
|
|
<TextBlock x:Name="WeatherLocationValueTextBlock"
|
|
FontSize="17"
|
|
FontWeight="SemiBold"
|
|
TextAlignment="Right"
|
|
TextWrapping="Wrap"
|
|
Text="No location selected" />
|
|
<TextBlock x:Name="WeatherLocationStatusTextBlock"
|
|
FontSize="12"
|
|
TextAlignment="Right"
|
|
TextWrapping="Wrap"
|
|
Foreground="{DynamicResource AdaptiveTextSecondaryBrush}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</ui:SettingsExpanderItem>
|
|
|
|
<ui:SettingsExpanderItem>
|
|
<ui:SettingsExpanderItem.Footer>
|
|
<ToggleSwitch x:Name="WeatherAutoRefreshToggleSwitch"
|
|
Content="Auto refresh location on startup" />
|
|
</ui:SettingsExpanderItem.Footer>
|
|
</ui:SettingsExpanderItem>
|
|
|
|
<ComboBox x:Name="WeatherLocationModeComboBox"
|
|
IsVisible="False">
|
|
<ComboBoxItem x:Name="WeatherLocationModeCityItem"
|
|
Tag="CitySearch"
|
|
Content="City Search" />
|
|
<ComboBoxItem x:Name="WeatherLocationModeCoordinatesItem"
|
|
Tag="Coordinates"
|
|
Content="Coordinates" />
|
|
</ComboBox>
|
|
</ui:SettingsExpander>
|
|
</Border>
|
|
|
|
<Border Classes="settings-expander-shell">
|
|
<ui:SettingsExpander x:Name="WeatherCitySearchSettingsExpander"
|
|
Header="City Search"
|
|
Description="Search cities and apply one weather location."
|
|
IsExpanded="True">
|
|
<ui:SettingsExpander.Footer>
|
|
<Button x:Name="WeatherApplyCityButton"
|
|
Padding="14,8"
|
|
Content="Apply City" />
|
|
</ui:SettingsExpander.Footer>
|
|
|
|
<ui:SettingsExpanderItem>
|
|
<StackPanel Spacing="12">
|
|
<Grid ColumnDefinitions="*,Auto,Auto"
|
|
ColumnSpacing="10">
|
|
<TextBox x:Name="WeatherCitySearchTextBox"
|
|
Watermark="e.g. Beijing" />
|
|
<ui:ProgressRing x:Name="WeatherSearchProgressRing"
|
|
Grid.Column="1"
|
|
Width="22"
|
|
Height="22"
|
|
IsActive="True"
|
|
IsVisible="False" />
|
|
<Button x:Name="WeatherSearchButton"
|
|
Grid.Column="2"
|
|
Padding="14,8"
|
|
Content="Search" />
|
|
</Grid>
|
|
|
|
<ComboBox x:Name="WeatherCityResultsComboBox"
|
|
HorizontalAlignment="Stretch"
|
|
MinWidth="320" />
|
|
|
|
<TextBlock x:Name="WeatherSearchStatusTextBlock"
|
|
FontSize="12"
|
|
Foreground="{DynamicResource AdaptiveTextSecondaryBrush}"
|
|
TextWrapping="Wrap"
|
|
Text="Search by city name and apply one location." />
|
|
</StackPanel>
|
|
</ui:SettingsExpanderItem>
|
|
</ui:SettingsExpander>
|
|
</Border>
|
|
|
|
<Border Classes="settings-expander-shell">
|
|
<ui:SettingsExpander x:Name="WeatherCoordinateSettingsExpander"
|
|
Header="Coordinates"
|
|
Description="Set latitude/longitude and optional key/name."
|
|
IsVisible="False"
|
|
IsExpanded="True">
|
|
<ui:SettingsExpander.Footer>
|
|
<Button x:Name="WeatherApplyCoordinatesButton"
|
|
Padding="14,8"
|
|
Content="Apply Coordinates" />
|
|
</ui:SettingsExpander.Footer>
|
|
|
|
<ui:SettingsExpanderItem>
|
|
<StackPanel Spacing="12">
|
|
<Grid ColumnDefinitions="*,*"
|
|
ColumnSpacing="10">
|
|
<ui:NumberBox x:Name="WeatherLatitudeNumberBox"
|
|
Grid.Column="0"
|
|
Header="Latitude"
|
|
Minimum="-90"
|
|
Maximum="90"
|
|
SpinButtonPlacementMode="Inline"
|
|
SmallChange="0.1"
|
|
LargeChange="1"
|
|
Value="39.9042" />
|
|
<ui:NumberBox x:Name="WeatherLongitudeNumberBox"
|
|
Grid.Column="1"
|
|
Header="Longitude"
|
|
Minimum="-180"
|
|
Maximum="180"
|
|
SpinButtonPlacementMode="Inline"
|
|
SmallChange="0.1"
|
|
LargeChange="1"
|
|
Value="116.4074" />
|
|
</Grid>
|
|
|
|
<TextBox x:Name="WeatherLocationKeyTextBox"
|
|
Watermark="Location key (optional)" />
|
|
<TextBox x:Name="WeatherLocationNameTextBox"
|
|
Watermark="Display name (optional)" />
|
|
<TextBlock x:Name="WeatherCoordinateStatusTextBlock"
|
|
FontSize="12"
|
|
Foreground="{DynamicResource AdaptiveTextSecondaryBrush}"
|
|
TextWrapping="Wrap" />
|
|
</StackPanel>
|
|
</ui:SettingsExpanderItem>
|
|
</ui:SettingsExpander>
|
|
</Border>
|
|
|
|
<Border Classes="settings-expander-shell">
|
|
<ui:SettingsExpander x:Name="WeatherAlertFilterSettingsExpander"
|
|
Header="Excluded Alerts"
|
|
Description="Alerts containing these words will not be shown. One rule per line."
|
|
IsExpanded="True">
|
|
<ui:SettingsExpanderItem>
|
|
<Grid ColumnDefinitions="Auto,*"
|
|
ColumnSpacing="20">
|
|
<StackPanel Width="220"
|
|
Spacing="4">
|
|
<TextBlock x:Name="WeatherAlertListTitleTextBlock"
|
|
FontSize="17"
|
|
FontWeight="SemiBold"
|
|
Text="Exclude List" />
|
|
<TextBlock x:Name="WeatherAlertListDescriptionTextBlock"
|
|
Foreground="{DynamicResource AdaptiveTextSecondaryBrush}"
|
|
TextWrapping="Wrap"
|
|
Text="One exclusion rule per line." />
|
|
</StackPanel>
|
|
|
|
<TextBox x:Name="WeatherExcludedAlertsTextBox"
|
|
Grid.Column="1"
|
|
MinHeight="96"
|
|
MaxHeight="220"
|
|
HorizontalAlignment="Stretch"
|
|
AcceptsReturn="True"
|
|
TextWrapping="Wrap"
|
|
Watermark="One keyword per line" />
|
|
</Grid>
|
|
</ui:SettingsExpanderItem>
|
|
</ui:SettingsExpander>
|
|
</Border>
|
|
|
|
<Border Classes="settings-expander-shell">
|
|
<ui:SettingsExpander x:Name="WeatherNoTlsSettingsExpander"
|
|
Header="No TLS Weather Request"
|
|
Description="Not recommended. Enable only for incompatible network environments."
|
|
IsExpanded="True">
|
|
<ui:SettingsExpander.Footer>
|
|
<ToggleSwitch x:Name="WeatherNoTlsToggleSwitch"
|
|
Content="Allow non-TLS request fallback" />
|
|
</ui:SettingsExpander.Footer>
|
|
</ui:SettingsExpander>
|
|
</Border>
|
|
|
|
<Border Classes="settings-note-shell">
|
|
<TextBlock x:Name="WeatherFooterHintTextBlock"
|
|
TextWrapping="Wrap"
|
|
Foreground="{DynamicResource AdaptiveTextSecondaryBrush}"
|
|
Text="Desktop weather widgets will reuse the location and alert exclusion settings configured here." />
|
|
</Border>
|
|
|
|
<Grid IsVisible="False">
|
|
<ui:SettingsExpander x:Name="WeatherPreviewSettingsExpander"
|
|
Header="Weather Preview"
|
|
Description="Refresh and verify current weather service status." />
|
|
<fi:SymbolIcon x:Name="WeatherPreviewIconSymbol"
|
|
Symbol="WeatherSunny"
|
|
IconVariant="Regular" />
|
|
<Border Classes="settings-expander-shell">
|
|
<ui:SettingsExpander x:Name="WeatherIconPackSettingsExpander"
|
|
Header="Weather Icon Style"
|
|
Description="Choose Fluent Icon style for weather symbols.">
|
|
<ui:SettingsExpander.Footer>
|
|
<ComboBox x:Name="WeatherIconPackComboBox"
|
|
Width="220">
|
|
<ComboBoxItem x:Name="WeatherIconPackFluentRegularItem"
|
|
Tag="FluentRegular"
|
|
Content="Fluent Regular" />
|
|
<ComboBoxItem x:Name="WeatherIconPackFluentFilledItem"
|
|
Tag="FluentFilled"
|
|
Content="Fluent Filled" />
|
|
</ComboBox>
|
|
</ui:SettingsExpander.Footer>
|
|
</ui:SettingsExpander>
|
|
</Border>
|
|
</Grid>
|
|
</StackPanel>
|
|
</UserControl>
|