mirror of
https://github.com/2dust/v2rayN.git
synced 2026-01-15 10:29:33 +00:00
Refactor button styles and set UI defaults
Introduced a new 'FlatActionMiniButton' style and replaced usages of 'MaterialDesignFloatingActionMiniLightButton' with it across multiple views for a consistent look. Updated the default values for ColorPrimaryName, CurrentTheme, and CurrentFontSize in UIItem. Also adjusted the order of controls in ProfilesView for improved layout.
This commit is contained in:
parent
bc36cf8a47
commit
d077f42768
7 changed files with 65 additions and 43 deletions
|
|
@ -91,11 +91,11 @@ public class UIItem
|
||||||
public int MainGirdHeight1 { get; set; }
|
public int MainGirdHeight1 { get; set; }
|
||||||
public int MainGirdHeight2 { get; set; }
|
public int MainGirdHeight2 { get; set; }
|
||||||
public EGirdOrientation MainGirdOrientation { get; set; } = EGirdOrientation.Vertical;
|
public EGirdOrientation MainGirdOrientation { get; set; } = EGirdOrientation.Vertical;
|
||||||
public string? ColorPrimaryName { get; set; }
|
public string? ColorPrimaryName { get; set; } = "blue";
|
||||||
public string? CurrentTheme { get; set; }
|
public string? CurrentTheme { get; set; } = nameof(ETheme.FollowSystem);
|
||||||
public string CurrentLanguage { get; set; }
|
public string CurrentLanguage { get; set; }
|
||||||
public string CurrentFontFamily { get; set; }
|
public string CurrentFontFamily { get; set; }
|
||||||
public int CurrentFontSize { get; set; }
|
public int CurrentFontSize { get; set; } = 12;
|
||||||
public bool EnableDragDropSort { get; set; }
|
public bool EnableDragDropSort { get; set; }
|
||||||
public bool DoubleClick2Activate { get; set; }
|
public bool DoubleClick2Activate { get; set; }
|
||||||
public bool AutoHideStartup { get; set; }
|
public bool AutoHideStartup { get; set; }
|
||||||
|
|
|
||||||
|
|
@ -115,11 +115,35 @@
|
||||||
TargetType="{x:Type CheckBox}">
|
TargetType="{x:Type CheckBox}">
|
||||||
<Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
|
<Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style
|
||||||
|
x:Key="FlatActionMiniButton"
|
||||||
|
BasedOn="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
||||||
|
TargetType="{x:Type ButtonBase}">
|
||||||
|
<Setter Property="materialDesign:ElevationAssist.Elevation" Value="Dp0" />
|
||||||
|
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Background}" />
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.Primary}" />
|
||||||
|
<Setter Property="BorderThickness" Value="1.5" />
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Primary}" />
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Primary.Light}" />
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource MaterialDesign.Brush.Primary.Dark}" />
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsPressed" Value="True">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource MaterialDesign.Brush.Primary}" />
|
||||||
|
<Setter Property="Foreground" Value="White" />
|
||||||
|
</Trigger>
|
||||||
|
</Style.Triggers>
|
||||||
|
</Style>
|
||||||
<Style
|
<Style
|
||||||
x:Key="DefButton"
|
x:Key="DefButton"
|
||||||
BasedOn="{StaticResource MaterialDesignRaisedButton}"
|
BasedOn="{StaticResource MaterialDesignFlatButton}"
|
||||||
TargetType="{x:Type ButtonBase}">
|
TargetType="{x:Type ButtonBase}">
|
||||||
<Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
|
<Setter Property="FontSize" Value="{DynamicResource StdFontSize}" />
|
||||||
|
<Setter Property="materialDesign:ElevationAssist.Elevation" Value="Dp0" />
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesign.Brush.Primary}" />
|
||||||
|
<Setter Property="BorderThickness" Value="1" />
|
||||||
|
<Setter Property="Padding" Value="16,4" />
|
||||||
</Style>
|
</Style>
|
||||||
<Style
|
<Style
|
||||||
x:Key="DefContextMenu"
|
x:Key="DefContextMenu"
|
||||||
|
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
Width="24"
|
Width="24"
|
||||||
Height="24"
|
Height="24"
|
||||||
Margin="{StaticResource MarginLeftRight8}"
|
Margin="{StaticResource MarginLeftRight8}"
|
||||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
Style="{StaticResource FlatActionMiniButton}"
|
||||||
ToolTip="{x:Static resx:ResUI.menuConnectionCloseAll}">
|
ToolTip="{x:Static resx:ResUI.menuConnectionCloseAll}">
|
||||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Close" />
|
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Close" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
@ -44,7 +44,7 @@
|
||||||
Width="24"
|
Width="24"
|
||||||
Height="24"
|
Height="24"
|
||||||
Margin="{StaticResource MarginLeftRight8}"
|
Margin="{StaticResource MarginLeftRight8}"
|
||||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
Style="{StaticResource FlatActionMiniButton}"
|
||||||
ToolTip="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}">
|
ToolTip="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}">
|
||||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="ArrowSplitVertical" />
|
<materialDesign:PackIcon VerticalAlignment="Center" Kind="ArrowSplitVertical" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
Width="24"
|
Width="24"
|
||||||
Height="24"
|
Height="24"
|
||||||
Margin="{StaticResource MarginLeftRight8}"
|
Margin="{StaticResource MarginLeftRight8}"
|
||||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
Style="{StaticResource FlatActionMiniButton}"
|
||||||
ToolTip="{x:Static resx:ResUI.menuProxiesReload}">
|
ToolTip="{x:Static resx:ResUI.menuProxiesReload}">
|
||||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Reload" />
|
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Reload" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
@ -72,7 +72,7 @@
|
||||||
Width="24"
|
Width="24"
|
||||||
Height="24"
|
Height="24"
|
||||||
Margin="{StaticResource MarginLeftRight8}"
|
Margin="{StaticResource MarginLeftRight8}"
|
||||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
Style="{StaticResource FlatActionMiniButton}"
|
||||||
ToolTip="{x:Static resx:ResUI.menuProxiesDelaytest}">
|
ToolTip="{x:Static resx:ResUI.menuProxiesDelaytest}">
|
||||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="LightningBolt" />
|
<materialDesign:PackIcon VerticalAlignment="Center" Kind="LightningBolt" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
||||||
|
|
@ -35,7 +35,7 @@
|
||||||
Height="24"
|
Height="24"
|
||||||
Margin="{StaticResource MarginLeftRight8}"
|
Margin="{StaticResource MarginLeftRight8}"
|
||||||
AutomationProperties.Name="{x:Static resx:ResUI.menuMsgViewCopyAll}"
|
AutomationProperties.Name="{x:Static resx:ResUI.menuMsgViewCopyAll}"
|
||||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
Style="{StaticResource FlatActionMiniButton}"
|
||||||
ToolTip="{x:Static resx:ResUI.menuMsgViewCopyAll}">
|
ToolTip="{x:Static resx:ResUI.menuMsgViewCopyAll}">
|
||||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="ContentCopy" />
|
<materialDesign:PackIcon VerticalAlignment="Center" Kind="ContentCopy" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
@ -45,7 +45,7 @@
|
||||||
Height="24"
|
Height="24"
|
||||||
Margin="{StaticResource MarginLeftRight8}"
|
Margin="{StaticResource MarginLeftRight8}"
|
||||||
AutomationProperties.Name="{x:Static resx:ResUI.menuMsgViewClear}"
|
AutomationProperties.Name="{x:Static resx:ResUI.menuMsgViewClear}"
|
||||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
Style="{StaticResource FlatActionMiniButton}"
|
||||||
ToolTip="{x:Static resx:ResUI.menuMsgViewClear}">
|
ToolTip="{x:Static resx:ResUI.menuMsgViewClear}">
|
||||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Delete" />
|
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Delete" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,7 @@
|
||||||
Height="30"
|
Height="30"
|
||||||
Margin="{StaticResource MarginLeftRight8}"
|
Margin="{StaticResource MarginLeftRight8}"
|
||||||
AutomationProperties.Name="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}"
|
AutomationProperties.Name="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}"
|
||||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
Style="{StaticResource FlatActionMiniButton}"
|
||||||
ToolTip="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}">
|
ToolTip="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}">
|
||||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="ArrowSplitVertical" />
|
<materialDesign:PackIcon VerticalAlignment="Center" Kind="ArrowSplitVertical" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
Height="30"
|
Height="30"
|
||||||
Margin="{StaticResource MarginLeftRight4}"
|
Margin="{StaticResource MarginLeftRight4}"
|
||||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSubEdit}"
|
AutomationProperties.Name="{x:Static resx:ResUI.menuSubEdit}"
|
||||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
Style="{StaticResource FlatActionMiniButton}"
|
||||||
ToolTip="{x:Static resx:ResUI.menuSubEdit}">
|
ToolTip="{x:Static resx:ResUI.menuSubEdit}">
|
||||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Edit" />
|
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Edit" />
|
||||||
</Button>
|
</Button>
|
||||||
|
|
@ -52,10 +52,38 @@
|
||||||
Height="30"
|
Height="30"
|
||||||
Margin="{StaticResource MarginLeftRight4}"
|
Margin="{StaticResource MarginLeftRight4}"
|
||||||
AutomationProperties.Name="{x:Static resx:ResUI.menuSubAdd}"
|
AutomationProperties.Name="{x:Static resx:ResUI.menuSubAdd}"
|
||||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
Style="{StaticResource FlatActionMiniButton}"
|
||||||
ToolTip="{x:Static resx:ResUI.menuSubAdd}">
|
ToolTip="{x:Static resx:ResUI.menuSubAdd}">
|
||||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Plus" />
|
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Plus" />
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button
|
||||||
|
x:Name="btnAutofitColumnWidth"
|
||||||
|
Width="30"
|
||||||
|
Height="30"
|
||||||
|
Margin="{StaticResource MarginLeftRight4}"
|
||||||
|
AutomationProperties.Name="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}"
|
||||||
|
Style="{StaticResource FlatActionMiniButton}"
|
||||||
|
ToolTip="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}">
|
||||||
|
<materialDesign:PackIcon VerticalAlignment="Center" Kind="ArrowSplitVertical" />
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
x:Name="btnFastRealPing"
|
||||||
|
Width="30"
|
||||||
|
Height="30"
|
||||||
|
Margin="{StaticResource MarginLeftRight4}"
|
||||||
|
Style="{StaticResource FlatActionMiniButton}"
|
||||||
|
ToolTip="{x:Static resx:ResUI.menuFastRealPing}">
|
||||||
|
<materialDesign:PackIcon VerticalAlignment="Center" Kind="LightningBolt" />
|
||||||
|
</Button>
|
||||||
|
<Button
|
||||||
|
x:Name="menuMixedTestServer"
|
||||||
|
Width="30"
|
||||||
|
Height="30"
|
||||||
|
Margin="{StaticResource MarginLeftRight4}"
|
||||||
|
Style="{StaticResource FlatActionMiniButton}"
|
||||||
|
ToolTip="{x:Static resx:ResUI.menuMixedTestServer}">
|
||||||
|
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Speedometer" />
|
||||||
|
</Button>
|
||||||
|
|
||||||
<TextBox
|
<TextBox
|
||||||
x:Name="txtServerFilter"
|
x:Name="txtServerFilter"
|
||||||
|
|
@ -66,36 +94,6 @@
|
||||||
materialDesign:TextFieldAssist.HasClearButton="True"
|
materialDesign:TextFieldAssist.HasClearButton="True"
|
||||||
AutomationProperties.Name="{x:Static resx:ResUI.MsgServerTitle}"
|
AutomationProperties.Name="{x:Static resx:ResUI.MsgServerTitle}"
|
||||||
Style="{StaticResource DefTextBox}" />
|
Style="{StaticResource DefTextBox}" />
|
||||||
|
|
||||||
<Button
|
|
||||||
x:Name="btnAutofitColumnWidth"
|
|
||||||
Width="30"
|
|
||||||
Height="30"
|
|
||||||
Margin="{StaticResource MarginLeftRight4}"
|
|
||||||
AutomationProperties.Name="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}"
|
|
||||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
|
||||||
ToolTip="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}">
|
|
||||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="ArrowSplitVertical" />
|
|
||||||
</Button>
|
|
||||||
|
|
||||||
<Button
|
|
||||||
x:Name="btnFastRealPing"
|
|
||||||
Width="30"
|
|
||||||
Height="30"
|
|
||||||
Margin="{StaticResource MarginLeftRight4}"
|
|
||||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
|
||||||
ToolTip="{x:Static resx:ResUI.menuFastRealPing}">
|
|
||||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="LightningBolt" />
|
|
||||||
</Button>
|
|
||||||
<Button
|
|
||||||
x:Name="menuMixedTestServer"
|
|
||||||
Width="30"
|
|
||||||
Height="30"
|
|
||||||
Margin="{StaticResource MarginLeftRight4}"
|
|
||||||
Style="{StaticResource MaterialDesignFloatingActionMiniLightButton}"
|
|
||||||
ToolTip="{x:Static resx:ResUI.menuMixedTestServer}">
|
|
||||||
<materialDesign:PackIcon VerticalAlignment="Center" Kind="Speedometer" />
|
|
||||||
</Button>
|
|
||||||
</WrapPanel>
|
</WrapPanel>
|
||||||
<DataGrid
|
<DataGrid
|
||||||
x:Name="lstProfiles"
|
x:Name="lstProfiles"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue