Skip to content

Commit

Permalink
Adjust UI for desktop
Browse files Browse the repository at this point in the history
  • Loading branch information
2dust committed Jan 10, 2025
1 parent baf90cf commit 127858d
Show file tree
Hide file tree
Showing 8 changed files with 54 additions and 87 deletions.
23 changes: 13 additions & 10 deletions v2rayN/v2rayN.Desktop/Views/BackupAndRestoreView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,8 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
xmlns:vms="clr-namespace:ServiceLib.ViewModels;assembly=ServiceLib"
d:DesignHeight="450"
d:DesignWidth="800"
x:DataType="vms:BackupAndRestoreViewModel"
mc:Ignorable="d">
<UserControl.Styles>
<Style Selector="Button">
Expand Down Expand Up @@ -55,7 +53,10 @@
Classes="Margin8"
Content="{x:Static resx:ResUI.menuLocalBackup}" />

<Separator Grid.Row="2" Grid.ColumnSpan="2" />
<Separator
Grid.Row="2"
Grid.Column="0"
Grid.ColumnSpan="2" />

<TextBlock
Grid.Row="3"
Expand All @@ -80,12 +81,11 @@
Classes="Margin8"
ColumnDefinitions="300,200"
RowDefinitions="Auto,Auto,Auto,Auto,Auto">
<StackPanel Orientation="Horizontal">
<TextBlock
Grid.Row="0"
Grid.Column="0"
Classes="Margin8"
Text="{x:Static resx:ResUI.menuRemoteBackupAndRestore}" />
<StackPanel
Grid.Row="0"
Grid.Column="0"
Orientation="Horizontal">
<TextBlock Classes="Margin8" Text="{x:Static resx:ResUI.menuRemoteBackupAndRestore}" />

<Button
Width="30"
Expand Down Expand Up @@ -190,7 +190,10 @@
Classes="Margin8"
Content="{x:Static resx:ResUI.menuRemoteBackup}" />

<Separator Grid.Row="2" Grid.ColumnSpan="3" />
<Separator
Grid.Row="2"
Grid.Column="0"
Grid.ColumnSpan="2" />
<TextBlock
Grid.Row="3"
Grid.Column="0"
Expand Down
7 changes: 6 additions & 1 deletion v2rayN/v2rayN.Desktop/Views/BackupAndRestoreView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ namespace v2rayN.Desktop.Views
{
public partial class BackupAndRestoreView : ReactiveUserControl<BackupAndRestoreViewModel>
{
private Window _window;
private Window? _window;

public BackupAndRestoreView()
{
InitializeComponent();
}

public BackupAndRestoreView(Window window)
{
Expand Down
3 changes: 2 additions & 1 deletion v2rayN/v2rayN.Desktop/Views/CheckUpdateView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,8 @@
<ListBox
x:Name="lstCheckUpdates"
BorderThickness="1"
ItemsSource="{Binding CheckUpdateModels}">
ItemsSource="{Binding CheckUpdateModels}"
Theme="{StaticResource ButtonRadioGroupListBox}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" />
Expand Down
28 changes: 15 additions & 13 deletions v2rayN/v2rayN.Desktop/Views/ClashProxiesView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@
<ListBox
x:Name="lstProxyGroups"
DockPanel.Dock="Left"
ItemsSource="{Binding ProxyGroups}">
ItemsSource="{Binding ProxyGroups}"
Theme="{StaticResource ButtonRadioGroupListBox}">
<ItemsControl.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" />
Expand All @@ -105,24 +106,25 @@
<DataTemplate>
<Border
Width="160"
Margin="-6"
Margin="-8,-4"
Padding="0"
Theme="{StaticResource CardBorder}">
<DockPanel>
<Grid Classes="Margin8" RowDefinitions="1*,8,1*">
<DockPanel Grid.Row="0">
<TextBlock DockPanel.Dock="Right" Text="{Binding Type}" />
<TextBlock Text="{Binding Name}" />
</DockPanel>
<TextBlock Grid.Row="2" Text="{Binding Now}" />
</Grid>
</DockPanel>
<Grid Classes="Margin8" RowDefinitions="1*,8,1*">
<DockPanel Grid.Row="0">
<TextBlock DockPanel.Dock="Right" Text="{Binding Type}" />
<TextBlock Text="{Binding Name}" />
</DockPanel>
<TextBlock Grid.Row="2" Text="{Binding Now}" />
</Grid>
</Border>
</DataTemplate>
</ItemsControl.ItemTemplate>
</ListBox>

<ListBox x:Name="lstProxyDetails" ItemsSource="{Binding ProxyDetails}">
<ListBox
x:Name="lstProxyDetails"
ItemsSource="{Binding ProxyDetails}"
Theme="{StaticResource ButtonRadioGroupListBox}">
<ItemsControl.ContextMenu>
<ContextMenu>
<MenuItem x:Name="menuProxiesDelaytestPart" Header="{x:Static resx:ResUI.menuProxiesDelaytestPart}" />
Expand All @@ -138,7 +140,7 @@
<DataTemplate>
<Border
Width="160"
Margin="-6"
Margin="-12,-4"
Padding="0"
Theme="{StaticResource CardBorder}">
<DockPanel>
Expand Down
65 changes: 7 additions & 58 deletions v2rayN/v2rayN.Desktop/Views/MainWindow.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -150,71 +150,20 @@
x:Name="tabMain1"
Grid.Row="2"
TabStripPlacement="Left">
<TabItem x:Name="tabMsgView1">
<TabItem.Header>
<StackPanel>

<TextBlock HorizontalAlignment="Center" Text="{x:Static resx:ResUI.MsgInformationTitle}" />
</StackPanel>
</TabItem.Header>
</TabItem>
<TabItem x:Name="tabClashProxies1">
<TabItem.Header>
<StackPanel>

<TextBlock HorizontalAlignment="Center" Text="{x:Static resx:ResUI.TbProxies}" />
</StackPanel>
</TabItem.Header>
</TabItem>
<TabItem x:Name="tabClashConnections1">
<TabItem.Header>
<StackPanel>

<TextBlock HorizontalAlignment="Center" Text="{x:Static resx:ResUI.TbConnections}" />
</StackPanel>
</TabItem.Header>
</TabItem>
<TabItem x:Name="tabMsgView1" Header="{x:Static resx:ResUI.MsgInformationTitle}" />
<TabItem x:Name="tabClashProxies1" Header="{x:Static resx:ResUI.TbProxies}" />
<TabItem x:Name="tabClashConnections1" Header="{x:Static resx:ResUI.TbConnections}" />
</TabControl>
</Grid>
<Grid x:Name="gridMain2" IsVisible="False">
<TabControl x:Name="tabMain2" TabStripPlacement="Left">
<TabItem x:Name="tabProfiles2">
<TabItem.Header>
<StackPanel>

<TextBlock HorizontalAlignment="Center" Text="{x:Static resx:ResUI.menuServers}" />
</StackPanel>
</TabItem.Header>
</TabItem>
<TabItem x:Name="tabMsgView2">
<TabItem.Header>
<StackPanel>

<TextBlock HorizontalAlignment="Center" Text="{x:Static resx:ResUI.MsgInformationTitle}" />
</StackPanel>
</TabItem.Header>
</TabItem>
<TabItem x:Name="tabClashProxies2">
<TabItem.Header>
<StackPanel>

<TextBlock HorizontalAlignment="Center" Text="{x:Static resx:ResUI.TbProxies}" />
</StackPanel>
</TabItem.Header>
</TabItem>
<TabItem x:Name="tabClashConnections2">
<TabItem.Header>
<StackPanel>

<TextBlock HorizontalAlignment="Center" Text="{x:Static resx:ResUI.TbConnections}" />
</StackPanel>
</TabItem.Header>
</TabItem>
<TabItem x:Name="tabProfiles2" Header="{x:Static resx:ResUI.menuServers}" />
<TabItem x:Name="tabMsgView2" Header="{x:Static resx:ResUI.MsgInformationTitle}" />
<TabItem x:Name="tabClashProxies2" Header="{x:Static resx:ResUI.TbProxies}" />
<TabItem x:Name="tabClashConnections2" Header="{x:Static resx:ResUI.TbConnections}" />
</TabControl>
</Grid>

</Grid>

</DockPanel>
</dialogHost:DialogHost>
</Window>
7 changes: 6 additions & 1 deletion v2rayN/v2rayN.Desktop/Views/ProfilesView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,12 @@ namespace v2rayN.Desktop.Views
public partial class ProfilesView : ReactiveUserControl<ProfilesViewModel>
{
private static Config _config;
private Window _window;
private Window? _window;

public ProfilesView()
{
InitializeComponent();
}

public ProfilesView(Window window)
{
Expand Down
3 changes: 0 additions & 3 deletions v2rayN/v2rayN.Desktop/Views/QrcodeView.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,10 @@
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:resx="clr-namespace:ServiceLib.Resx;assembly=ServiceLib"
d:DesignHeight="480"
d:DesignWidth="400"
mc:Ignorable="d">
<Grid Margin="30" RowDefinitions="Auto,Auto">

<Image
Name="imgQrcode"
Width="300"
Expand All @@ -24,6 +22,5 @@
IsReadOnly="True"
MaxLines="1" />


</Grid>
</UserControl>
5 changes: 5 additions & 0 deletions v2rayN/v2rayN.Desktop/Views/QrcodeView.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ namespace v2rayN.Desktop.Views
{
public partial class QrcodeView : UserControl
{
public QrcodeView()
{
InitializeComponent();
}

public QrcodeView(string? url)
{
InitializeComponent();
Expand Down

0 comments on commit 127858d

Please sign in to comment.