Files
ClashWidget/SettingsWindow.xaml
2026-05-10 14:50:19 +08:00

107 lines
4.8 KiB
XML

<Window x:Class="ClashWidget.SettingsWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowStyle="None"
Background="#AAFFFFFF"
Topmost="True"
ResizeMode="NoResize"
Width="360" Height="400"
MouseLeftButtonDown="OnMouseLeftButtonDown">
<Grid Margin="20,12">
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<!-- Row 0: traffic light + title -->
<StackPanel Grid.Row="0" Orientation="Horizontal" Margin="0,0,0,14">
<Button Width="12" Height="12" Margin="0,0,8,0"
Click="OnCloseClick" Cursor="Hand" Focusable="False">
<Button.Template>
<ControlTemplate TargetType="Button">
<Ellipse x:Name="Dot" Fill="#FF5F57" Width="12" Height="12" />
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Dot" Property="Fill" Value="#EE4B44" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
<TextBlock Text="Settings" FontSize="13" FontWeight="SemiBold"
Foreground="#FF1E293B" VerticalAlignment="Center" Margin="8,0,0,0" />
</StackPanel>
<!-- API Host -->
<TextBlock Grid.Row="1" Text="API Host" FontSize="11"
Foreground="#FF64748B" Margin="2,0,0,2" />
<TextBox Grid.Row="2"
Text="{Binding ApiHost, UpdateSourceTrigger=PropertyChanged}"
FontSize="13" Padding="8,6"
Background="#F8FAFC" BorderBrush="#E2E8F0"
BorderThickness="1" Margin="0,0,0,10" />
<!-- API Port -->
<TextBlock Grid.Row="3" Text="API Port" FontSize="11"
Foreground="#FF64748B" Margin="2,0,0,2" />
<TextBox Grid.Row="4"
Text="{Binding ApiPort, UpdateSourceTrigger=PropertyChanged}"
FontSize="13" Padding="8,6"
Background="#F8FAFC" BorderBrush="#E2E8F0"
BorderThickness="1" Margin="0,0,0,10" />
<!-- Secret -->
<TextBlock Grid.Row="5" Text="Secret Key" FontSize="11"
Foreground="#FF64748B" Margin="2,0,0,2" />
<TextBox Grid.Row="6"
Text="{Binding ApiSecret, UpdateSourceTrigger=PropertyChanged}"
FontSize="13" Padding="8,6"
Background="#F8FAFC" BorderBrush="#E2E8F0"
BorderThickness="1" Margin="0,0,0,12" />
<!-- Test URL -->
<TextBlock Grid.Row="7" Text="Test URL" FontSize="11"
Foreground="#FF64748B" Margin="2,0,0,2" />
<TextBox Grid.Row="8"
Text="{Binding TestUrl, UpdateSourceTrigger=PropertyChanged}"
FontSize="13" Padding="8,6"
Background="#F8FAFC" BorderBrush="#E2E8F0"
BorderThickness="1" />
<!-- Save button -->
<Button Grid.Row="9" Click="OnSaveClick" Cursor="Hand" Margin="0,14,0,0">
<Button.Template>
<ControlTemplate TargetType="Button">
<Border x:Name="SaveBorder" Background="#FF3B82F6"
CornerRadius="6" Padding="0,10">
<TextBlock Text="Save &amp; Reconnect" FontSize="13"
FontWeight="SemiBold" Foreground="White"
HorizontalAlignment="Center" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="SaveBorder" Property="Background" Value="#2563EB" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Button.Template>
</Button>
<!-- Version -->
<TextBlock Grid.Row="10" Text="Version 1.0.3"
FontSize="11" Foreground="#FF1E293B"
HorizontalAlignment="Center"
Margin="0,16,0,0" />
</Grid>
</Window>