mirror of
https://github.com/2dust/v2rayN.git
synced 2026-04-16 04:25:45 +00:00
Apply Linux custom title bars to dialog windows
This commit is contained in:
parent
10fc87ca12
commit
c56df24b5d
18 changed files with 545 additions and 83 deletions
|
|
@ -22,6 +22,24 @@
|
|||
<StyleInclude Source="Assets/GlobalStyles.axaml" />
|
||||
<StyleInclude Source="avares://Semi.Avalonia.DataGrid/Index.axaml" />
|
||||
<dialogHost:DialogHostStyles />
|
||||
<Style Selector="Border.windowTitleBar">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultTertiaryForeground}" />
|
||||
<Setter Property="BorderThickness" Value="0,0,0,1" />
|
||||
</Style>
|
||||
<Style Selector="Button.windowTitleBarButton">
|
||||
<Setter Property="Width" Value="36" />
|
||||
<Setter Property="Height" Value="32" />
|
||||
<Setter Property="MinWidth" Value="36" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="Theme" Value="{DynamicResource BorderlessButton}" />
|
||||
</Style>
|
||||
<Style Selector="TextBlock.windowTitleBarGlyph">
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</Application.Styles>
|
||||
|
||||
<TrayIcon.Icons>
|
||||
|
|
|
|||
|
|
@ -2,8 +2,17 @@ namespace v2rayN.Desktop.Base;
|
|||
|
||||
public class WindowBase<TViewModel> : ReactiveWindow<TViewModel> where TViewModel : class
|
||||
{
|
||||
private Border? _linuxTitleBar;
|
||||
private Control? _linuxTitleBarDragRegion;
|
||||
private Button? _linuxTitleBarCloseButton;
|
||||
|
||||
public WindowBase()
|
||||
{
|
||||
if (Utils.IsLinux())
|
||||
{
|
||||
SystemDecorations = SystemDecorations.BorderOnly;
|
||||
}
|
||||
|
||||
Loaded += OnLoaded;
|
||||
}
|
||||
|
||||
|
|
@ -34,10 +43,13 @@ public class WindowBase<TViewModel> : ReactiveWindow<TViewModel> where TViewMode
|
|||
Position = new PixelPoint((int)x, (int)y);
|
||||
}
|
||||
catch { }
|
||||
|
||||
ConfigureLinuxTitleBar();
|
||||
}
|
||||
|
||||
protected override void OnClosed(EventArgs e)
|
||||
{
|
||||
ReleaseLinuxTitleBar();
|
||||
base.OnClosed(e);
|
||||
try
|
||||
{
|
||||
|
|
@ -45,4 +57,67 @@ public class WindowBase<TViewModel> : ReactiveWindow<TViewModel> where TViewMode
|
|||
}
|
||||
catch { }
|
||||
}
|
||||
|
||||
protected virtual void HandleLinuxTitleBarClose()
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
private void ConfigureLinuxTitleBar()
|
||||
{
|
||||
if (!Utils.IsLinux())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_linuxTitleBar ??= this.FindControl<Border>("linuxTitleBar");
|
||||
if (_linuxTitleBar == null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
_linuxTitleBar.IsVisible = true;
|
||||
|
||||
_linuxTitleBarDragRegion ??= this.FindControl<Control>("linuxTitleBarDragRegion");
|
||||
if (_linuxTitleBarDragRegion != null)
|
||||
{
|
||||
_linuxTitleBarDragRegion.PointerPressed -= LinuxTitleBar_PointerPressed;
|
||||
_linuxTitleBarDragRegion.PointerPressed += LinuxTitleBar_PointerPressed;
|
||||
}
|
||||
|
||||
_linuxTitleBarCloseButton ??= this.FindControl<Button>("btnLinuxClose");
|
||||
if (_linuxTitleBarCloseButton != null)
|
||||
{
|
||||
_linuxTitleBarCloseButton.Click -= LinuxTitleBarClose_Click;
|
||||
_linuxTitleBarCloseButton.Click += LinuxTitleBarClose_Click;
|
||||
}
|
||||
}
|
||||
|
||||
private void ReleaseLinuxTitleBar()
|
||||
{
|
||||
if (_linuxTitleBarDragRegion != null)
|
||||
{
|
||||
_linuxTitleBarDragRegion.PointerPressed -= LinuxTitleBar_PointerPressed;
|
||||
}
|
||||
|
||||
if (_linuxTitleBarCloseButton != null)
|
||||
{
|
||||
_linuxTitleBarCloseButton.Click -= LinuxTitleBarClose_Click;
|
||||
}
|
||||
}
|
||||
|
||||
private void LinuxTitleBar_PointerPressed(object? sender, PointerPressedEventArgs e)
|
||||
{
|
||||
if (e.GetCurrentPoint(this).Properties.IsLeftButtonPressed == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BeginMoveDrag(e);
|
||||
}
|
||||
|
||||
private void LinuxTitleBarClose_Click(object? sender, RoutedEventArgs e)
|
||||
{
|
||||
HandleLinuxTitleBarClose();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
using Avalonia.Platform.Storage;
|
||||
using MsBox.Avalonia;
|
||||
using MsBox.Avalonia.Dto;
|
||||
|
||||
namespace v2rayN.Desktop.Common;
|
||||
|
||||
|
|
@ -9,7 +10,17 @@ internal class UI
|
|||
|
||||
public static async Task<ButtonResult> ShowYesNo(Window owner, string msg)
|
||||
{
|
||||
var box = MessageBoxManager.GetMessageBoxStandard(caption, msg, ButtonEnum.YesNo);
|
||||
var messageBoxParams = new MessageBoxStandardParams
|
||||
{
|
||||
ContentTitle = caption,
|
||||
ContentMessage = msg,
|
||||
ButtonDefinitions = ButtonEnum.YesNo,
|
||||
WindowStartupLocation = WindowStartupLocation.CenterOwner,
|
||||
CanResize = false,
|
||||
Topmost = false,
|
||||
SystemDecorations = Utils.IsLinux() ? SystemDecorations.BorderOnly : SystemDecorations.Full
|
||||
};
|
||||
var box = MessageBoxManager.GetMessageBoxStandard(messageBoxParams);
|
||||
return await box.ShowWindowDialogAsync(owner);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -13,8 +13,37 @@
|
|||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<DockPanel Margin="{StaticResource Margin8}">
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<Border
|
||||
x:Name="linuxTitleBar"
|
||||
Classes="windowTitleBar"
|
||||
IsVisible="False">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" Height="36">
|
||||
<Border
|
||||
x:Name="linuxTitleBarDragRegion"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="Transparent" />
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
Margin="12,0,0,0"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Image
|
||||
Width="16"
|
||||
Height="16"
|
||||
Source="/Assets/NotifyIcon1.ico" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Title, RelativeSource={RelativeSource AncestorType=Window}}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<Button x:Name="btnLinuxClose" Classes="windowTitleBarButton">
|
||||
<TextBlock Classes="windowTitleBarGlyph" Text="×" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
<DockPanel Grid.Row="1" Margin="{StaticResource Margin8}">
|
||||
<StackPanel
|
||||
Margin="{StaticResource Margin4}"
|
||||
HorizontalAlignment="Center"
|
||||
|
|
@ -252,5 +281,6 @@
|
|||
</DataGrid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</DockPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,37 @@
|
|||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<DockPanel Margin="{StaticResource Margin8}">
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<Border
|
||||
x:Name="linuxTitleBar"
|
||||
Classes="windowTitleBar"
|
||||
IsVisible="False">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" Height="36">
|
||||
<Border
|
||||
x:Name="linuxTitleBarDragRegion"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="Transparent" />
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
Margin="12,0,0,0"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Image
|
||||
Width="16"
|
||||
Height="16"
|
||||
Source="/Assets/NotifyIcon1.ico" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Title, RelativeSource={RelativeSource AncestorType=Window}}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<Button x:Name="btnLinuxClose" Classes="windowTitleBarButton">
|
||||
<TextBlock Classes="windowTitleBarGlyph" Text="×" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
<DockPanel Grid.Row="1" Margin="{StaticResource Margin8}">
|
||||
<StackPanel
|
||||
Margin="{StaticResource Margin4}"
|
||||
HorizontalAlignment="Center"
|
||||
|
|
@ -154,5 +184,6 @@
|
|||
</StackPanel>
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</DockPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,37 @@
|
|||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<DockPanel Margin="{StaticResource Margin8}">
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<Border
|
||||
x:Name="linuxTitleBar"
|
||||
Classes="windowTitleBar"
|
||||
IsVisible="False">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" Height="36">
|
||||
<Border
|
||||
x:Name="linuxTitleBarDragRegion"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="Transparent" />
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
Margin="12,0,0,0"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Image
|
||||
Width="16"
|
||||
Height="16"
|
||||
Source="/Assets/NotifyIcon1.ico" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Title, RelativeSource={RelativeSource AncestorType=Window}}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<Button x:Name="btnLinuxClose" Classes="windowTitleBarButton">
|
||||
<TextBlock Classes="windowTitleBarGlyph" Text="×" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
<DockPanel Grid.Row="1" Margin="{StaticResource Margin8}">
|
||||
<StackPanel
|
||||
Margin="{StaticResource Margin4}"
|
||||
HorizontalAlignment="Center"
|
||||
|
|
@ -1131,5 +1161,6 @@
|
|||
<Separator Grid.Row="9" Margin="{StaticResource MarginTb8}" />
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</DockPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,37 @@
|
|||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<DockPanel Margin="{StaticResource Margin8}">
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<Border
|
||||
x:Name="linuxTitleBar"
|
||||
Classes="windowTitleBar"
|
||||
IsVisible="False">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" Height="36">
|
||||
<Border
|
||||
x:Name="linuxTitleBarDragRegion"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="Transparent" />
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
Margin="12,0,0,0"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Image
|
||||
Width="16"
|
||||
Height="16"
|
||||
Source="/Assets/NotifyIcon1.ico" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Title, RelativeSource={RelativeSource AncestorType=Window}}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<Button x:Name="btnLinuxClose" Classes="windowTitleBarButton">
|
||||
<TextBlock Classes="windowTitleBarGlyph" Text="×" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
<DockPanel Grid.Row="1" Margin="{StaticResource Margin8}">
|
||||
<StackPanel
|
||||
Margin="{StaticResource Margin4}"
|
||||
HorizontalAlignment="Center"
|
||||
|
|
@ -486,5 +516,6 @@
|
|||
</DockPanel>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</DockPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -14,7 +14,37 @@
|
|||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<DockPanel Margin="{StaticResource Margin8}">
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<Border
|
||||
x:Name="linuxTitleBar"
|
||||
Classes="windowTitleBar"
|
||||
IsVisible="False">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" Height="36">
|
||||
<Border
|
||||
x:Name="linuxTitleBarDragRegion"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="Transparent" />
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
Margin="12,0,0,0"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Image
|
||||
Width="16"
|
||||
Height="16"
|
||||
Source="/Assets/NotifyIcon1.ico" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Title, RelativeSource={RelativeSource AncestorType=Window}}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<Button x:Name="btnLinuxClose" Classes="windowTitleBarButton">
|
||||
<TextBlock Classes="windowTitleBarGlyph" Text="×" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
<DockPanel Grid.Row="1" Margin="{StaticResource Margin8}">
|
||||
<StackPanel
|
||||
Margin="{StaticResource Margin4}"
|
||||
HorizontalAlignment="Center"
|
||||
|
|
@ -178,5 +208,6 @@
|
|||
</DockPanel>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</DockPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,37 @@
|
|||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<DockPanel Margin="{StaticResource Margin8}">
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<Border
|
||||
x:Name="linuxTitleBar"
|
||||
Classes="windowTitleBar"
|
||||
IsVisible="False">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" Height="36">
|
||||
<Border
|
||||
x:Name="linuxTitleBarDragRegion"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="Transparent" />
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
Margin="12,0,0,0"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Image
|
||||
Width="16"
|
||||
Height="16"
|
||||
Source="/Assets/NotifyIcon1.ico" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Title, RelativeSource={RelativeSource AncestorType=Window}}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<Button x:Name="btnLinuxClose" Classes="windowTitleBarButton">
|
||||
<TextBlock Classes="windowTitleBarGlyph" Text="×" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
<DockPanel Grid.Row="1" Margin="{StaticResource Margin8}">
|
||||
<StackPanel
|
||||
Margin="{StaticResource Margin4}"
|
||||
HorizontalAlignment="Center"
|
||||
|
|
@ -127,5 +157,6 @@
|
|||
Text="{x:Static resx:ResUI.TbGlobalHotkeySettingTip}" />
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</DockPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -18,26 +18,6 @@
|
|||
ShowInTaskbar="True"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<Window.Styles>
|
||||
<Style Selector="Border.windowTitleBar">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultTertiaryForeground}" />
|
||||
<Setter Property="BorderThickness" Value="0,0,0,1" />
|
||||
</Style>
|
||||
<Style Selector="Button.windowTitleBarButton">
|
||||
<Setter Property="Width" Value="36" />
|
||||
<Setter Property="Height" Value="32" />
|
||||
<Setter Property="MinWidth" Value="36" />
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="Theme" Value="{DynamicResource BorderlessButton}" />
|
||||
</Style>
|
||||
<Style Selector="TextBlock.windowTitleBarGlyph">
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultTertiaryForeground}" />
|
||||
<Setter Property="HorizontalAlignment" Value="Center" />
|
||||
<Setter Property="VerticalAlignment" Value="Center" />
|
||||
</Style>
|
||||
</Window.Styles>
|
||||
<dialogHost:DialogHost
|
||||
Background="Gray"
|
||||
CloseOnClickAway="True"
|
||||
|
|
@ -50,9 +30,9 @@
|
|||
IsVisible="False">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" Height="36">
|
||||
<Border
|
||||
x:Name="linuxTitleBarDragRegion"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="Transparent"
|
||||
PointerPressed="LinuxTitleBar_PointerPressed" />
|
||||
Background="Transparent" />
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
Margin="12,0,0,0"
|
||||
|
|
@ -72,8 +52,7 @@
|
|||
Orientation="Horizontal">
|
||||
<Button
|
||||
x:Name="btnLinuxClose"
|
||||
Classes="windowTitleBarButton"
|
||||
Click="BtnLinuxClose_Click">
|
||||
Classes="windowTitleBarButton">
|
||||
<TextBlock Classes="windowTitleBarGlyph" Text="×" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
|
|
|
|||
|
|
@ -162,7 +162,6 @@ public partial class MainWindow : WindowBase<MainWindowViewModel>
|
|||
else
|
||||
{
|
||||
Title = $"{Utils.GetVersion()}";
|
||||
ConfigureLinuxTitleBar();
|
||||
}
|
||||
menuAddServerViaScan.IsVisible = false;
|
||||
|
||||
|
|
@ -396,28 +395,7 @@ public partial class MainWindow : WindowBase<MainWindowViewModel>
|
|||
await AppManager.Instance.AppExitAsync(true);
|
||||
}
|
||||
|
||||
private void ConfigureLinuxTitleBar()
|
||||
{
|
||||
if (!Utils.IsLinux())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
linuxTitleBar.IsVisible = true;
|
||||
SystemDecorations = SystemDecorations.BorderOnly;
|
||||
}
|
||||
|
||||
private void LinuxTitleBar_PointerPressed(object? sender, PointerPressedEventArgs e)
|
||||
{
|
||||
if (!Utils.IsLinux() || e.GetCurrentPoint(this).Properties.IsLeftButtonPressed == false)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
BeginMoveDrag(e);
|
||||
}
|
||||
|
||||
private void BtnLinuxClose_Click(object? sender, RoutedEventArgs e)
|
||||
protected override void HandleLinuxTitleBarClose()
|
||||
{
|
||||
HideToTray();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -13,7 +13,37 @@
|
|||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<DockPanel Margin="{StaticResource Margin8}">
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<Border
|
||||
x:Name="linuxTitleBar"
|
||||
Classes="windowTitleBar"
|
||||
IsVisible="False">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" Height="36">
|
||||
<Border
|
||||
x:Name="linuxTitleBarDragRegion"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="Transparent" />
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
Margin="12,0,0,0"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Image
|
||||
Width="16"
|
||||
Height="16"
|
||||
Source="/Assets/NotifyIcon1.ico" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Title, RelativeSource={RelativeSource AncestorType=Window}}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<Button x:Name="btnLinuxClose" Classes="windowTitleBarButton">
|
||||
<TextBlock Classes="windowTitleBarGlyph" Text="×" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
<DockPanel Grid.Row="1" Margin="{StaticResource Margin8}">
|
||||
<StackPanel
|
||||
Margin="{StaticResource Margin4}"
|
||||
HorizontalAlignment="Center"
|
||||
|
|
@ -965,5 +995,6 @@
|
|||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</DockPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -12,8 +12,37 @@
|
|||
x:DataType="vms:ProfilesSelectViewModel"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<DockPanel Margin="8">
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<Border
|
||||
x:Name="linuxTitleBar"
|
||||
Classes="windowTitleBar"
|
||||
IsVisible="False">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" Height="36">
|
||||
<Border
|
||||
x:Name="linuxTitleBarDragRegion"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="Transparent" />
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
Margin="12,0,0,0"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Image
|
||||
Width="16"
|
||||
Height="16"
|
||||
Source="/Assets/NotifyIcon1.ico" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Title, RelativeSource={RelativeSource AncestorType=Window}}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<Button x:Name="btnLinuxClose" Classes="windowTitleBarButton">
|
||||
<TextBlock Classes="windowTitleBarGlyph" Text="×" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
<DockPanel Grid.Row="1" Margin="8">
|
||||
<!-- Bottom buttons -->
|
||||
<StackPanel
|
||||
Margin="4"
|
||||
|
|
@ -123,5 +152,6 @@
|
|||
</DataGrid>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,37 @@
|
|||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<DockPanel>
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<Border
|
||||
x:Name="linuxTitleBar"
|
||||
Classes="windowTitleBar"
|
||||
IsVisible="False">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" Height="36">
|
||||
<Border
|
||||
x:Name="linuxTitleBarDragRegion"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="Transparent" />
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
Margin="12,0,0,0"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Image
|
||||
Width="16"
|
||||
Height="16"
|
||||
Source="/Assets/NotifyIcon1.ico" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Title, RelativeSource={RelativeSource AncestorType=Window}}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<Button x:Name="btnLinuxClose" Classes="windowTitleBarButton">
|
||||
<TextBlock Classes="windowTitleBarGlyph" Text="×" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
<DockPanel Grid.Row="1">
|
||||
<Grid
|
||||
Margin="{StaticResource Margin4}"
|
||||
ColumnDefinitions="Auto,Auto,Auto"
|
||||
|
|
@ -250,5 +280,6 @@
|
|||
TextWrapping="Wrap" />
|
||||
</HeaderedContentControl>
|
||||
</Grid>
|
||||
</DockPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -13,7 +13,37 @@
|
|||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<DockPanel>
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<Border
|
||||
x:Name="linuxTitleBar"
|
||||
Classes="windowTitleBar"
|
||||
IsVisible="False">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" Height="36">
|
||||
<Border
|
||||
x:Name="linuxTitleBarDragRegion"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="Transparent" />
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
Margin="12,0,0,0"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Image
|
||||
Width="16"
|
||||
Height="16"
|
||||
Source="/Assets/NotifyIcon1.ico" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Title, RelativeSource={RelativeSource AncestorType=Window}}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<Button x:Name="btnLinuxClose" Classes="windowTitleBarButton">
|
||||
<TextBlock Classes="windowTitleBarGlyph" Text="×" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
<DockPanel Grid.Row="1">
|
||||
<Menu Margin="{StaticResource Margin4}" DockPanel.Dock="Top">
|
||||
<MenuItem x:Name="menuRuleAdd" Header="{x:Static resx:ResUI.menuRuleAdd}" />
|
||||
<MenuItem x:Name="menuImportRulesFromFile" Header="{x:Static resx:ResUI.menuImportRulesFromFile}" />
|
||||
|
|
@ -253,5 +283,6 @@
|
|||
</DataGrid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</DockPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -13,8 +13,37 @@
|
|||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
|
||||
<DockPanel>
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<Border
|
||||
x:Name="linuxTitleBar"
|
||||
Classes="windowTitleBar"
|
||||
IsVisible="False">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" Height="36">
|
||||
<Border
|
||||
x:Name="linuxTitleBarDragRegion"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="Transparent" />
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
Margin="12,0,0,0"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Image
|
||||
Width="16"
|
||||
Height="16"
|
||||
Source="/Assets/NotifyIcon1.ico" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Title, RelativeSource={RelativeSource AncestorType=Window}}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<Button x:Name="btnLinuxClose" Classes="windowTitleBarButton">
|
||||
<TextBlock Classes="windowTitleBarGlyph" Text="×" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
<DockPanel Grid.Row="1">
|
||||
<Menu Margin="{StaticResource Margin4}" DockPanel.Dock="Top">
|
||||
<MenuItem x:Name="menuRoutingAdvancedAdd2" Header="{x:Static resx:ResUI.menuRoutingAdvancedAdd}" />
|
||||
<MenuItem x:Name="menuRoutingAdvancedImportRules2" Header="{x:Static resx:ResUI.menuRoutingAdvancedImportRules}" />
|
||||
|
|
@ -138,5 +167,6 @@
|
|||
</DataGrid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</DockPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -12,7 +12,37 @@
|
|||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<DockPanel Margin="{StaticResource Margin8}">
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<Border
|
||||
x:Name="linuxTitleBar"
|
||||
Classes="windowTitleBar"
|
||||
IsVisible="False">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" Height="36">
|
||||
<Border
|
||||
x:Name="linuxTitleBarDragRegion"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="Transparent" />
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
Margin="12,0,0,0"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Image
|
||||
Width="16"
|
||||
Height="16"
|
||||
Source="/Assets/NotifyIcon1.ico" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Title, RelativeSource={RelativeSource AncestorType=Window}}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<Button x:Name="btnLinuxClose" Classes="windowTitleBarButton">
|
||||
<TextBlock Classes="windowTitleBarGlyph" Text="×" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
<DockPanel Grid.Row="1" Margin="{StaticResource Margin8}">
|
||||
<StackPanel
|
||||
Margin="{StaticResource Margin4}"
|
||||
HorizontalAlignment="Center"
|
||||
|
|
@ -266,5 +296,6 @@
|
|||
|
||||
</Grid>
|
||||
</ScrollViewer>
|
||||
</DockPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
|
|
@ -14,12 +14,43 @@
|
|||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<dialogHost:DialogHost
|
||||
Background="Gray"
|
||||
CloseOnClickAway="True"
|
||||
DisableOpeningAnimation="True"
|
||||
Identifier="dialogHostSub">
|
||||
<DockPanel Margin="{StaticResource Margin8}">
|
||||
<Grid RowDefinitions="Auto,*">
|
||||
<Border
|
||||
x:Name="linuxTitleBar"
|
||||
Classes="windowTitleBar"
|
||||
IsVisible="False">
|
||||
<Grid ColumnDefinitions="Auto,*,Auto" Height="36">
|
||||
<Border
|
||||
x:Name="linuxTitleBarDragRegion"
|
||||
Grid.ColumnSpan="2"
|
||||
Background="Transparent" />
|
||||
<StackPanel
|
||||
Grid.Column="0"
|
||||
Margin="12,0,0,0"
|
||||
Orientation="Horizontal"
|
||||
Spacing="8">
|
||||
<Image
|
||||
Width="16"
|
||||
Height="16"
|
||||
Source="/Assets/NotifyIcon1.ico" />
|
||||
<TextBlock
|
||||
VerticalAlignment="Center"
|
||||
Text="{Binding Title, RelativeSource={RelativeSource AncestorType=Window}}" />
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<Button x:Name="btnLinuxClose" Classes="windowTitleBarButton">
|
||||
<TextBlock Classes="windowTitleBarGlyph" Text="×" />
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
<dialogHost:DialogHost
|
||||
Grid.Row="1"
|
||||
Background="Gray"
|
||||
CloseOnClickAway="True"
|
||||
DisableOpeningAnimation="True"
|
||||
Identifier="dialogHostSub">
|
||||
<DockPanel Margin="{StaticResource Margin8}">
|
||||
<Menu Margin="{StaticResource Margin4}" DockPanel.Dock="Top">
|
||||
<MenuItem x:Name="menuSubAdd" Header="{x:Static resx:ResUI.menuSubAdd}" />
|
||||
<MenuItem x:Name="menuSubDelete" Header="{x:Static resx:ResUI.menuSubDelete}" />
|
||||
|
|
@ -75,6 +106,7 @@
|
|||
Header="{x:Static resx:ResUI.LvSort}" />
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
</DockPanel>
|
||||
</dialogHost:DialogHost>
|
||||
</DockPanel>
|
||||
</dialogHost:DialogHost>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
|
|
|||
Loading…
Reference in a new issue