From 267c955c8880830e39908f22808d766636e823f3 Mon Sep 17 00:00:00 2001 From: leo Date: Fri, 8 Mar 2024 11:13:53 +0800 Subject: [PATCH] style: views supports Linux --- src/Resources/Locales/en_US.axaml | 1 - src/Resources/Locales/zh_CN.axaml | 1 - src/ViewModels/Preference.cs | 6 ----- src/Views/About.axaml | 19 +++++++++------ src/Views/AssumeUnchangedManager.axaml | 26 +++++++++++---------- src/Views/Blame.axaml | 32 +++++++++++++++----------- src/Views/FileHistories.axaml | 21 +++++++++-------- src/Views/Hotkeys.axaml | 19 +++++++++------ src/Views/Launcher.axaml | 19 ++++++++------- src/Views/Preference.axaml | 22 +++++++----------- src/Views/Preference.axaml.cs | 2 -- src/Views/Statistics.axaml | 14 +++++------ 12 files changed, 94 insertions(+), 88 deletions(-) diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml index 193b5094..809222d1 100644 --- a/src/Resources/Locales/en_US.axaml +++ b/src/Resources/Locales/en_US.axaml @@ -382,7 +382,6 @@ History Commits Restore windows Use fixed tab width in titlebar - Use macOS style titlebar GIT Install Path Git version diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml index a3d0201d..9e06fda4 100644 --- a/src/Resources/Locales/zh_CN.axaml +++ b/src/Resources/Locales/zh_CN.axaml @@ -381,7 +381,6 @@ 最大历史提交数 启动时恢复上次打开的仓库 使用固定宽度的标题栏标签 - 使用macOS风格的标题栏 GIT配置 安装路径 Git 版本 diff --git a/src/ViewModels/Preference.cs b/src/ViewModels/Preference.cs index 60f88d90..e9361e73 100644 --- a/src/ViewModels/Preference.cs +++ b/src/ViewModels/Preference.cs @@ -76,11 +76,6 @@ namespace SourceGit.ViewModels { set => SetProperty(ref _useFixedTabWidth, value); } - public bool UseMacOSStyle { - get => _useMacOSStyle; - set => SetProperty(ref _useMacOSStyle, value); - } - public bool UseTwoColumnsLayoutInHistories { get => _useTwoColumnsLayoutInHistories; set => SetProperty(ref _useTwoColumnsLayoutInHistories, value); @@ -285,7 +280,6 @@ namespace SourceGit.ViewModels { private int _maxHistoryCommits = 20000; private bool _restoreTabs = false; private bool _useFixedTabWidth = true; - private bool _useMacOSStyle = OperatingSystem.IsMacOS(); private bool _useTwoColumnsLayoutInHistories = false; private bool _useCombinedTextDiff = true; diff --git a/src/Views/About.axaml b/src/Views/About.axaml index fb18e474..9c13099c 100644 --- a/src/Views/About.axaml +++ b/src/Views/About.axaml @@ -13,17 +13,22 @@ SizeToContent="WidthAndHeight" CanResize="False" WindowStartupLocation="CenterScreen" - ExtendClientAreaToDecorationsHint="True" - ExtendClientAreaChromeHints="NoChrome"> - - + ExtendClientAreaToDecorationsHint="{OnPlatform True, Linux=False}" + ExtendClientAreaChromeHints="{OnPlatform NoChrome, Linux=Default}"> + + + + + IsVisible="{OnPlatform False, Windows=True}"/> - + diff --git a/src/Views/AssumeUnchangedManager.axaml b/src/Views/AssumeUnchangedManager.axaml index dfb0b758..3dfe06fd 100644 --- a/src/Views/AssumeUnchangedManager.axaml +++ b/src/Views/AssumeUnchangedManager.axaml @@ -14,18 +14,23 @@ Width="600" Height="400" CanResize="False" WindowStartupLocation="CenterOwner" - ExtendClientAreaToDecorationsHint="True" - ExtendClientAreaChromeHints="NoChrome"> - + ExtendClientAreaToDecorationsHint="{OnPlatform True, Linux=False}" + ExtendClientAreaChromeHints="{OnPlatform NoChrome, Linux=Default}"> + - + + + + IsVisible="{OnPlatform False, Windows=True}"/> - + - - - - + - + ExtendClientAreaToDecorationsHint="{OnPlatform True, Linux=False}" + ExtendClientAreaChromeHints="{OnPlatform NoChrome, Linux=Default}"> - + - + - + - - + + - + - + - - - - + + diff --git a/src/Views/FileHistories.axaml b/src/Views/FileHistories.axaml index 55e104df..86031d51 100644 --- a/src/Views/FileHistories.axaml +++ b/src/Views/FileHistories.axaml @@ -15,35 +15,38 @@ MinWidth="1280" MinHeight="720" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border0}" - Background="{DynamicResource Brush.TitleBar}" - ExtendClientAreaToDecorationsHint="True" - ExtendClientAreaChromeHints="NoChrome"> + Background="{DynamicResource Brush.Window}" + ExtendClientAreaToDecorationsHint="{OnPlatform True, Linux=False}" + ExtendClientAreaChromeHints="{OnPlatform NoChrome, Linux=Default}"> - + - + - + - - + + - + diff --git a/src/Views/Hotkeys.axaml b/src/Views/Hotkeys.axaml index 352188c8..c61f585f 100644 --- a/src/Views/Hotkeys.axaml +++ b/src/Views/Hotkeys.axaml @@ -11,17 +11,22 @@ SizeToContent="WidthAndHeight" CanResize="False" WindowStartupLocation="CenterOwner" - ExtendClientAreaToDecorationsHint="True" - ExtendClientAreaChromeHints="NoChrome"> - - + ExtendClientAreaToDecorationsHint="{OnPlatform True, Linux=False}" + ExtendClientAreaChromeHints="{OnPlatform NoChrome, Linux=Default}"> + + + + + IsVisible="{OnPlatform False, Windows=True}"/> - + diff --git a/src/Views/Launcher.axaml b/src/Views/Launcher.axaml index bfdd2551..de83a504 100644 --- a/src/Views/Launcher.axaml +++ b/src/Views/Launcher.axaml @@ -14,11 +14,11 @@ Title="SourceGit" BorderThickness="1" BorderBrush="{DynamicResource Brush.Border0}" - Background="{DynamicResource Brush.TitleBar}" + Background="{DynamicResource Brush.Window}" MinWidth="1280" MinHeight="720" WindowStartupLocation="CenterScreen" - ExtendClientAreaToDecorationsHint="True" - ExtendClientAreaChromeHints="NoChrome"> + ExtendClientAreaToDecorationsHint="{OnPlatform True, Linux=False}" + ExtendClientAreaChromeHints="{OnPlatform NoChrome, Linux=Default}"> @@ -27,10 +27,13 @@ - + - + @@ -39,7 +42,7 @@ Classes="icon_button" Margin="4,0,2,3" VerticalAlignment="Bottom" - IsVisible="{Binding Source={x:Static vm:Preference.Instance}, Path=UseMacOSStyle, Converter={x:Static BoolConverters.Not}}"> + IsVisible="{OnPlatform True, macOS=False}"> @@ -212,7 +215,7 @@ - + @@ -227,7 +230,7 @@ - + diff --git a/src/Views/Preference.axaml b/src/Views/Preference.axaml index d2e2431e..364bf5a4 100644 --- a/src/Views/Preference.axaml +++ b/src/Views/Preference.axaml @@ -17,10 +17,10 @@ Width="600" SizeToContent="Height" CanResize="False" WindowStartupLocation="CenterScreen" - ExtendClientAreaToDecorationsHint="True" - ExtendClientAreaChromeHints="NoChrome"> - - + ExtendClientAreaToDecorationsHint="{OnPlatform True, Linux=False}" + ExtendClientAreaChromeHints="{OnPlatform NoChrome, Linux=Default}"> + + + IsVisible="{OnPlatform False, Windows=True}"/> - + @@ -57,7 +57,7 @@ - + - - diff --git a/src/Views/Preference.axaml.cs b/src/Views/Preference.axaml.cs index f1e91c11..38f27a5b 100644 --- a/src/Views/Preference.axaml.cs +++ b/src/Views/Preference.axaml.cs @@ -6,8 +6,6 @@ using System.IO; namespace SourceGit.Views { public partial class Preference : Window { - public bool CanChangeTitleBarStyle => !OperatingSystem.IsMacOS(); - public string DefaultUser { get; set; diff --git a/src/Views/Statistics.axaml b/src/Views/Statistics.axaml index b90933bc..5bb06c25 100644 --- a/src/Views/Statistics.axaml +++ b/src/Views/Statistics.axaml @@ -13,11 +13,11 @@ Width="800" Height="450" WindowStartupLocation="CenterOwner" CanResize="False" - ExtendClientAreaToDecorationsHint="True" - ExtendClientAreaChromeHints="NoChrome"> - + ExtendClientAreaToDecorationsHint="{OnPlatform True, Linux=False}" + ExtendClientAreaChromeHints="{OnPlatform NoChrome, Linux=Default}"> + - + + IsVisible="{OnPlatform False, Windows=True}"/> - +