Skip to content

Commit

Permalink
Improved UI for Desktop version
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Oct 4, 2024
1 parent 2bb5f6a commit 90ba804
Show file tree
Hide file tree
Showing 8 changed files with 47 additions and 13 deletions.
9 changes: 9 additions & 0 deletions v2rayN/ServiceLib/Resx/ResUI.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions v2rayN/ServiceLib/Resx/ResUI.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1324,4 +1324,7 @@
<data name="TipActiveServer" xml:space="preserve">
<value>Active</value>
</data>
<data name="menuStorageUI" xml:space="preserve">
<value>Save Interface Layout</value>
</data>
</root>
3 changes: 3 additions & 0 deletions v2rayN/ServiceLib/Resx/ResUI.zh-Hans.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1321,4 +1321,7 @@
<data name="TipActiveServer" xml:space="preserve">
<value>活动</value>
</data>
<data name="menuStorageUI" xml:space="preserve">
<value>保存界面布局</value>
</data>
</root>
3 changes: 3 additions & 0 deletions v2rayN/ServiceLib/Resx/ResUI.zh-Hant.resx
Original file line number Diff line number Diff line change
Expand Up @@ -1201,4 +1201,7 @@
<data name="TipActiveServer" xml:space="preserve">
<value>活動</value>
</data>
<data name="menuStorageUI" xml:space="preserve">
<value>儲存介面佈局</value>
</data>
</root>
5 changes: 4 additions & 1 deletion v2rayN/v2rayN.Desktop/Views/CheckUpdateView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
d:DesignWidth="800"
x:DataType="vms:CheckUpdateViewModel"
mc:Ignorable="d">
<Button Classes="Tertiary">
<Button
Classes="Tertiary"
FontWeight="Regular"
Theme="{DynamicResource BorderlessButton}">
<Button.Content>
<TextBlock Text="{x:Static resx:ResUI.menuCheckUpdate}" />
</Button.Content>
Expand Down
17 changes: 11 additions & 6 deletions v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,21 +54,26 @@
Source="/Assets/add.png" />
</Button.Content>
</Button>
<Button
<SplitButton
x:Name="btnAutofitColumnWidth"
Width="30"
Width="54"
Height="30"
Margin="20,0"
Classes="Success"
Theme="{DynamicResource SolidButton}"
Theme="{DynamicResource SolidSplitButton}"
ToolTip.Tip="{x:Static resx:ResUI.menuProfileAutofitColumnWidth}">
<Button.Content>
<SplitButton.Content>
<Image
Width="20"
Height="20"
Source="/Assets/fit.png" />
</Button.Content>
</Button>
</SplitButton.Content>
<SplitButton.Flyout>
<MenuFlyout>
<MenuItem Name="menuStorageUI" Header="{x:Static resx:ResUI.menuStorageUI}" />
</MenuFlyout>
</SplitButton.Flyout>
</SplitButton>

<TextBox
x:Name="txtServerFilter"
Expand Down
9 changes: 6 additions & 3 deletions v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ public ProfilesView(Window window)
menuSelectAll.Click += menuSelectAll_Click;
btnAutofitColumnWidth.Click += BtnAutofitColumnWidth_Click;
txtServerFilter.KeyDown += TxtServerFilter_KeyDown;
menuStorageUI.Click += MenuStorageUI_Click;
lstProfiles.KeyDown += LstProfiles_KeyDown;
lstProfiles.SelectionChanged += lstProfiles_SelectionChanged;
lstProfiles.DoubleTapped += LstProfiles_DoubleTapped;
Expand Down Expand Up @@ -195,8 +196,7 @@ private void LstProfiles_DoubleTapped(object? sender, Avalonia.Input.TappedEvent
else
{
ViewModel?.EditServerAsync(EConfigType.Custom);
}
StorageUI();
}
}

private void LstProfiles_LoadingRow(object? sender, DataGridRowEventArgs e)
Expand Down Expand Up @@ -304,7 +304,6 @@ private void AutofitColumnWidth()
{
it.Width = new DataGridLength(1, DataGridLengthUnitType.Auto);
}
StorageUI();
}

private void TxtServerFilter_KeyDown(object? sender, KeyEventArgs e)
Expand All @@ -314,6 +313,10 @@ private void TxtServerFilter_KeyDown(object? sender, KeyEventArgs e)
ViewModel?.RefreshServers();
}
}
private void MenuStorageUI_Click(object? sender, RoutedEventArgs e)
{
StorageUI();
}

//#endregion Event

Expand Down
11 changes: 8 additions & 3 deletions v2rayN/v2rayN.Desktop/Views/ThemeSettingView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,17 @@
d:DesignWidth="800"
x:DataType="vms:ThemeSettingViewModel"
mc:Ignorable="d">
<Button Width="30" Height="30">
<Button
Width="30"
Height="30"
Margin="10,0"
Theme="{DynamicResource BorderlessButton}">
<Button.Content>
<Image
<PathIcon
Width="20"
Height="20"
Source="/Assets/more.png" />
Data="M511.9,276.3c43.8,0 79.2,-35.5 79.2,-79.2 0,-43.8 -35.5,-79.2 -79.2,-79.2 -43.8,0 -79.2,35.5 -79.2,79.2 0,43.8 35.5,79.2 79.2,79.2zM511.9,434.8c-43.8,0 -79.2,35.5 -79.2,79.2 0,43.8 35.5,79.2 79.2,79.2 43.8,0 79.2,-35.5 79.2,-79.2 0,-43.8 -35.5,-79.2 -79.2,-79.2zM511.9,751.8c-43.8,0 -79.2,35.4 -79.2,79.2 0,43.8 35.5,79.2 79.2,79.2 43.8,0 79.2,-35.5 79.2,-79.2 0,-43.8 -35.5,-79.2 -79.2,-79.2z"
Foreground="{DynamicResource ButtonDefaultTertiaryForeground}" />
</Button.Content>
<Button.Flyout>
<Flyout>
Expand Down

0 comments on commit 90ba804

Please sign in to comment.