From d1e5b5357c4cd2081818f4c8e8f40e5d87cb8a9b Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 13 May 2021 11:02:50 +0800 Subject: [PATCH] optimize: simplify PopupWidget xaml --- src/Views/Controls/PopupWidget.cs | 9 +++++++++ src/Views/Popups/AddSubmodule.xaml | 2 +- src/Views/Popups/Apply.xaml | 2 +- src/Views/Popups/CherryPick.xaml | 2 +- src/Views/Popups/Clone.xaml | 2 +- src/Views/Popups/Configure.xaml | 2 +- src/Views/Popups/CreateBranch.xaml | 2 +- src/Views/Popups/CreateTag.xaml | 2 +- src/Views/Popups/DeleteBranch.xaml | 2 +- src/Views/Popups/DeleteRemote.xaml | 2 +- src/Views/Popups/DeleteSubmodule.xaml | 2 +- src/Views/Popups/DeleteTag.xaml | 2 +- src/Views/Popups/Discard.xaml | 2 +- src/Views/Popups/Fetch.xaml | 2 +- src/Views/Popups/GitFlowFinish.xaml | 2 +- src/Views/Popups/GitFlowStart.xaml | 2 +- src/Views/Popups/Init.xaml | 2 +- src/Views/Popups/InitGitFlow.xaml | 2 +- src/Views/Popups/Merge.xaml | 2 +- src/Views/Popups/Pull.xaml | 2 +- src/Views/Popups/Push.xaml | 2 +- src/Views/Popups/PushTag.xaml | 2 +- src/Views/Popups/Rebase.xaml | 2 +- src/Views/Popups/Remote.xaml | 2 +- src/Views/Popups/RenameBranch.xaml | 2 +- src/Views/Popups/Reset.xaml | 2 +- src/Views/Popups/Revert.xaml | 2 +- src/Views/Popups/Stash.xaml | 2 +- 28 files changed, 36 insertions(+), 27 deletions(-) diff --git a/src/Views/Controls/PopupWidget.cs b/src/Views/Controls/PopupWidget.cs index f690256f..14d5729c 100644 --- a/src/Views/Controls/PopupWidget.cs +++ b/src/Views/Controls/PopupWidget.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using System.Threading.Tasks; +using System.Windows; using System.Windows.Controls; namespace SourceGit.Views.Controls { @@ -47,6 +48,14 @@ namespace SourceGit.Views.Controls { currentContainer = id; } + /// + /// 构造函数 + /// + public PopupWidget() { + Height = double.NaN; + Padding = new Thickness(1); + } + /// /// 显示 /// diff --git a/src/Views/Popups/AddSubmodule.xaml b/src/Views/Popups/AddSubmodule.xaml index 22ed319f..3b50799d 100644 --- a/src/Views/Popups/AddSubmodule.xaml +++ b/src/Views/Popups/AddSubmodule.xaml @@ -8,7 +8,7 @@ xmlns:controls="clr-namespace:SourceGit.Views.Controls" xmlns:validations="clr-namespace:SourceGit.Views.Validations" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/Apply.xaml b/src/Views/Popups/Apply.xaml index 1d4ef33b..77bc37ad 100644 --- a/src/Views/Popups/Apply.xaml +++ b/src/Views/Popups/Apply.xaml @@ -10,7 +10,7 @@ xmlns:models="clr-namespace:SourceGit.Models" xmlns:validations="clr-namespace:SourceGit.Views.Validations" mc:Ignorable="d" - d:DesignWidth="800" Height="Auto" Padding="1"> + d:DesignWidth="800"> diff --git a/src/Views/Popups/CherryPick.xaml b/src/Views/Popups/CherryPick.xaml index df8a2187..4d3e59ea 100644 --- a/src/Views/Popups/CherryPick.xaml +++ b/src/Views/Popups/CherryPick.xaml @@ -6,7 +6,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:SourceGit.Views.Controls" mc:Ignorable="d" - d:DesignWidth="800" Height="Auto" Padding="1"> + d:DesignWidth="800"> diff --git a/src/Views/Popups/Clone.xaml b/src/Views/Popups/Clone.xaml index fc9ca281..58b9fa26 100644 --- a/src/Views/Popups/Clone.xaml +++ b/src/Views/Popups/Clone.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:SourceGit.Views.Controls" xmlns:validations="clr-namespace:SourceGit.Views.Validations" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/Configure.xaml b/src/Views/Popups/Configure.xaml index b71d3050..3fe07e3d 100644 --- a/src/Views/Popups/Configure.xaml +++ b/src/Views/Popups/Configure.xaml @@ -7,7 +7,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:SourceGit.Views.Controls" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/CreateBranch.xaml b/src/Views/Popups/CreateBranch.xaml index aa9ca82d..d4f6a165 100644 --- a/src/Views/Popups/CreateBranch.xaml +++ b/src/Views/Popups/CreateBranch.xaml @@ -9,7 +9,7 @@ xmlns:converters="clr-namespace:SourceGit.Views.Converters" xmlns:validations="clr-namespace:SourceGit.Views.Validations" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/CreateTag.xaml b/src/Views/Popups/CreateTag.xaml index eee23174..42e6def3 100644 --- a/src/Views/Popups/CreateTag.xaml +++ b/src/Views/Popups/CreateTag.xaml @@ -8,7 +8,7 @@ xmlns:controls="clr-namespace:SourceGit.Views.Controls" xmlns:validations="clr-namespace:SourceGit.Views.Validations" mc:Ignorable="d" - d:DesignWidth="800" Height="Auto" Padding="1"> + d:DesignWidth="800"> diff --git a/src/Views/Popups/DeleteBranch.xaml b/src/Views/Popups/DeleteBranch.xaml index 4d6e408e..895011e0 100644 --- a/src/Views/Popups/DeleteBranch.xaml +++ b/src/Views/Popups/DeleteBranch.xaml @@ -6,7 +6,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:SourceGit.Views.Controls" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/DeleteRemote.xaml b/src/Views/Popups/DeleteRemote.xaml index 43ec49ac..e84a7047 100644 --- a/src/Views/Popups/DeleteRemote.xaml +++ b/src/Views/Popups/DeleteRemote.xaml @@ -6,7 +6,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:SourceGit.Views.Controls" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/DeleteSubmodule.xaml b/src/Views/Popups/DeleteSubmodule.xaml index 7746117b..b7a9c98f 100644 --- a/src/Views/Popups/DeleteSubmodule.xaml +++ b/src/Views/Popups/DeleteSubmodule.xaml @@ -6,7 +6,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:SourceGit.Views.Controls" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/DeleteTag.xaml b/src/Views/Popups/DeleteTag.xaml index 2700bf63..cda42d99 100644 --- a/src/Views/Popups/DeleteTag.xaml +++ b/src/Views/Popups/DeleteTag.xaml @@ -6,7 +6,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:SourceGit.Views.Controls" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/Discard.xaml b/src/Views/Popups/Discard.xaml index 9a50b9a3..9e9f6416 100644 --- a/src/Views/Popups/Discard.xaml +++ b/src/Views/Popups/Discard.xaml @@ -6,7 +6,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:SourceGit.Views.Controls" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/Fetch.xaml b/src/Views/Popups/Fetch.xaml index da8c96eb..ffa70f48 100644 --- a/src/Views/Popups/Fetch.xaml +++ b/src/Views/Popups/Fetch.xaml @@ -6,7 +6,7 @@ xmlns:converters="clr-namespace:SourceGit.Views.Converters" xmlns:controls="clr-namespace:SourceGit.Views.Controls" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/GitFlowFinish.xaml b/src/Views/Popups/GitFlowFinish.xaml index 9ea8d389..385712c0 100644 --- a/src/Views/Popups/GitFlowFinish.xaml +++ b/src/Views/Popups/GitFlowFinish.xaml @@ -6,7 +6,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:SourceGit.Views.Controls" mc:Ignorable="d" - d:DesignWidth="800" Height="Auto" Padding="1"> + d:DesignWidth="800"> diff --git a/src/Views/Popups/GitFlowStart.xaml b/src/Views/Popups/GitFlowStart.xaml index d0eb3fc9..3c6077f2 100644 --- a/src/Views/Popups/GitFlowStart.xaml +++ b/src/Views/Popups/GitFlowStart.xaml @@ -8,7 +8,7 @@ xmlns:controls="clr-namespace:SourceGit.Views.Controls" xmlns:validations="clr-namespace:SourceGit.Views.Validations" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/Init.xaml b/src/Views/Popups/Init.xaml index a315de10..e261ccba 100644 --- a/src/Views/Popups/Init.xaml +++ b/src/Views/Popups/Init.xaml @@ -6,7 +6,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:SourceGit.Views.Controls" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/InitGitFlow.xaml b/src/Views/Popups/InitGitFlow.xaml index 4dbbe1ec..bc5ef9f3 100644 --- a/src/Views/Popups/InitGitFlow.xaml +++ b/src/Views/Popups/InitGitFlow.xaml @@ -6,7 +6,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:SourceGit.Views.Controls" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/Merge.xaml b/src/Views/Popups/Merge.xaml index bd80f2e5..bd013311 100644 --- a/src/Views/Popups/Merge.xaml +++ b/src/Views/Popups/Merge.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:SourceGit.Views.Controls" xmlns:models="clr-namespace:SourceGit.Models" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/Pull.xaml b/src/Views/Popups/Pull.xaml index e18c122a..ce942d6f 100644 --- a/src/Views/Popups/Pull.xaml +++ b/src/Views/Popups/Pull.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:SourceGit.Views.Controls" xmlns:converters="clr-namespace:SourceGit.Views.Converters" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/Push.xaml b/src/Views/Popups/Push.xaml index 8761dad7..52ddfc4f 100644 --- a/src/Views/Popups/Push.xaml +++ b/src/Views/Popups/Push.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:SourceGit.Views.Controls" xmlns:converters="clr-namespace:SourceGit.Views.Converters" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/PushTag.xaml b/src/Views/Popups/PushTag.xaml index 26718f8e..5829509c 100644 --- a/src/Views/Popups/PushTag.xaml +++ b/src/Views/Popups/PushTag.xaml @@ -6,7 +6,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:SourceGit.Views.Controls" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/Rebase.xaml b/src/Views/Popups/Rebase.xaml index 142b9086..9ac72a3f 100644 --- a/src/Views/Popups/Rebase.xaml +++ b/src/Views/Popups/Rebase.xaml @@ -6,7 +6,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:SourceGit.Views.Controls" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/Remote.xaml b/src/Views/Popups/Remote.xaml index 25ed40a2..ce2216c0 100644 --- a/src/Views/Popups/Remote.xaml +++ b/src/Views/Popups/Remote.xaml @@ -8,7 +8,7 @@ xmlns:controls="clr-namespace:SourceGit.Views.Controls" xmlns:validations="clr-namespace:SourceGit.Views.Validations" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/RenameBranch.xaml b/src/Views/Popups/RenameBranch.xaml index 98a7b6de..4270a31b 100644 --- a/src/Views/Popups/RenameBranch.xaml +++ b/src/Views/Popups/RenameBranch.xaml @@ -8,7 +8,7 @@ xmlns:controls="clr-namespace:SourceGit.Views.Controls" xmlns:validations="clr-namespace:SourceGit.Views.Validations" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/Reset.xaml b/src/Views/Popups/Reset.xaml index c37f9973..3ac02faf 100644 --- a/src/Views/Popups/Reset.xaml +++ b/src/Views/Popups/Reset.xaml @@ -7,7 +7,7 @@ xmlns:controls="clr-namespace:SourceGit.Views.Controls" xmlns:models="clr-namespace:SourceGit.Models" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/Revert.xaml b/src/Views/Popups/Revert.xaml index a9b61a2b..50b5ca6f 100644 --- a/src/Views/Popups/Revert.xaml +++ b/src/Views/Popups/Revert.xaml @@ -6,7 +6,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:SourceGit.Views.Controls" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500"> diff --git a/src/Views/Popups/Stash.xaml b/src/Views/Popups/Stash.xaml index 9e2a7e54..48a2f661 100644 --- a/src/Views/Popups/Stash.xaml +++ b/src/Views/Popups/Stash.xaml @@ -6,7 +6,7 @@ xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:controls="clr-namespace:SourceGit.Views.Controls" mc:Ignorable="d" - d:DesignWidth="500" Height="Auto" Padding="1"> + d:DesignWidth="500">