From fcb11b56c2117b6ab85566ea4b4da4a6dab6baf9 Mon Sep 17 00:00:00 2001 From: oZ-Zo <50652175+oz-zo@users.noreply.github.com> Date: Tue, 11 Feb 2020 17:49:16 +0300 Subject: [PATCH] Add category panel :alien: --- W10SS_GUI_2/W10SS_GUI/App.xaml | 6 +- W10SS_GUI_2/W10SS_GUI/Brushes/brushes.xaml | 4 ++ .../Controls/HamburgerCategoryButton.xaml | 2 +- .../HamburgerCategoryFlashButton.xaml | 2 +- .../Controls/TogglesCategoryPanel.xaml | 37 ++++++++++++ .../Controls/TogglesCategoryPanel.xaml.cs | 44 +++++++++++++++ W10SS_GUI_2/W10SS_GUI/MainWindow.xaml | 42 ++++++++------ W10SS_GUI_2/W10SS_GUI/MainWindow.xaml.cs | 3 +- W10SS_GUI_2/W10SS_GUI/Resource/constants.xaml | 15 ----- W10SS_GUI_2/W10SS_GUI/Resource/controls.xaml | 56 ------------------- .../W10SS_GUI/Resource/controlsSize.xaml | 9 ++- W10SS_GUI_2/W10SS_GUI/Resource/fonts.xaml | 11 ++++ W10SS_GUI_2/W10SS_GUI/Resource/tags.xaml | 16 ++++++ W10SS_GUI_2/W10SS_GUI/W10SS_GUI.csproj | 11 +++- 14 files changed, 161 insertions(+), 97 deletions(-) create mode 100644 W10SS_GUI_2/W10SS_GUI/Controls/TogglesCategoryPanel.xaml create mode 100644 W10SS_GUI_2/W10SS_GUI/Controls/TogglesCategoryPanel.xaml.cs delete mode 100644 W10SS_GUI_2/W10SS_GUI/Resource/constants.xaml delete mode 100644 W10SS_GUI_2/W10SS_GUI/Resource/controls.xaml create mode 100644 W10SS_GUI_2/W10SS_GUI/Resource/fonts.xaml create mode 100644 W10SS_GUI_2/W10SS_GUI/Resource/tags.xaml diff --git a/W10SS_GUI_2/W10SS_GUI/App.xaml b/W10SS_GUI_2/W10SS_GUI/App.xaml index 2675d38c..567f6a7b 100644 --- a/W10SS_GUI_2/W10SS_GUI/App.xaml +++ b/W10SS_GUI_2/W10SS_GUI/App.xaml @@ -7,12 +7,12 @@ - - + - + + diff --git a/W10SS_GUI_2/W10SS_GUI/Brushes/brushes.xaml b/W10SS_GUI_2/W10SS_GUI/Brushes/brushes.xaml index 8f51e1e8..55653231 100644 --- a/W10SS_GUI_2/W10SS_GUI/Brushes/brushes.xaml +++ b/W10SS_GUI_2/W10SS_GUI/Brushes/brushes.xaml @@ -1,5 +1,9 @@  + + + + diff --git a/W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryButton.xaml b/W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryButton.xaml index 3ac31873..aa7bebe3 100644 --- a/W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryButton.xaml +++ b/W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryButton.xaml @@ -56,7 +56,7 @@ - diff --git a/W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryFlashButton.xaml b/W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryFlashButton.xaml index 5e3a48c9..7fc9d52d 100644 --- a/W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryFlashButton.xaml +++ b/W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryFlashButton.xaml @@ -67,7 +67,7 @@ - diff --git a/W10SS_GUI_2/W10SS_GUI/Controls/TogglesCategoryPanel.xaml b/W10SS_GUI_2/W10SS_GUI/Controls/TogglesCategoryPanel.xaml new file mode 100644 index 00000000..a202ca79 --- /dev/null +++ b/W10SS_GUI_2/W10SS_GUI/Controls/TogglesCategoryPanel.xaml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + diff --git a/W10SS_GUI_2/W10SS_GUI/Controls/TogglesCategoryPanel.xaml.cs b/W10SS_GUI_2/W10SS_GUI/Controls/TogglesCategoryPanel.xaml.cs new file mode 100644 index 00000000..05326f45 --- /dev/null +++ b/W10SS_GUI_2/W10SS_GUI/Controls/TogglesCategoryPanel.xaml.cs @@ -0,0 +1,44 @@ +using System; +using System.Collections; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows; +using System.Windows.Controls; +using System.Windows.Data; +using System.Windows.Documents; +using System.Windows.Input; +using System.Windows.Markup; +using System.Windows.Media; +using System.Windows.Media.Imaging; +using System.Windows.Navigation; +using System.Windows.Shapes; + +namespace W10SS_GUI.Controls +{ + /// + /// Логика взаимодействия для TogglesCategoryPanel.xaml + /// + + public partial class TogglesCategoryPanel : UserControl + { + public TogglesCategoryPanel() + { + InitializeComponent(); + } + + + + public Thickness HeaderMargin + { + get { return (Thickness)GetValue(HeaderMarginProperty); } + set { SetValue(HeaderMarginProperty, value); } + } + + // Using a DependencyProperty as the backing store for HeaderMargin. This enables animation, styling, binding, etc... + public static readonly DependencyProperty HeaderMarginProperty = + DependencyProperty.Register("HeaderMargin", typeof(Thickness), typeof(TogglesCategoryPanel), new PropertyMetadata(default(Thickness))); + + } +} diff --git a/W10SS_GUI_2/W10SS_GUI/MainWindow.xaml b/W10SS_GUI_2/W10SS_GUI/MainWindow.xaml index 232ffacc..c0818b93 100644 --- a/W10SS_GUI_2/W10SS_GUI/MainWindow.xaml +++ b/W10SS_GUI_2/W10SS_GUI/MainWindow.xaml @@ -6,15 +6,17 @@ xmlns:local="clr-namespace:W10SS_GUI" xmlns:uc="clr-namespace:W10SS_GUI.Controls" mc:Ignorable="d" - Name="Window" Title="{StaticResource textWindowTitle}" MinHeight="{StaticResource windowMinHeight}" - Height="{StaticResource windowHeight}" + Name="Window" Title="{StaticResource textWindowTitle}" + MinHeight="{StaticResource windowMinHeight}" MinWidth="{StaticResource windowMinWidth}" + Height="{StaticResource windowHeight}" Width="{StaticResource windowWidth}" + FontFamily="{StaticResource windowFontFamily}" FontSize="{DynamicResource windowFontSize}" TextOptions.TextFormattingMode="Display" WindowStartupLocation="CenterScreen" SnapsToDevicePixels="True" ResizeMode="CanResize" ShowInTaskbar="True" - Background="{DynamicResource {x:Static SystemColors.WindowBrushKey}}" - Foreground="{DynamicResource {x:Static SystemColors.WindowTextBrushKey}}" + Background="{DynamicResource windowBackground}" + Foreground="{DynamicResource windowForeground}" Initialized="Window_Initialized" SizeToContent="WidthAndHeight"> @@ -145,21 +147,27 @@ - - + + - - + - - - - + + + + + + + + + + + diff --git a/W10SS_GUI_2/W10SS_GUI/MainWindow.xaml.cs b/W10SS_GUI_2/W10SS_GUI/MainWindow.xaml.cs index aa716623..d56df08a 100644 --- a/W10SS_GUI_2/W10SS_GUI/MainWindow.xaml.cs +++ b/W10SS_GUI_2/W10SS_GUI/MainWindow.xaml.cs @@ -13,6 +13,7 @@ using System.Windows.Media; using System.Windows.Media.Imaging; using System.Windows.Navigation; using System.Windows.Shapes; +using W10SS_GUI.Controls; namespace W10SS_GUI { @@ -23,7 +24,7 @@ namespace W10SS_GUI { public MainWindow() { - InitializeComponent(); + InitializeComponent(); } private void Window_Initialized(object sender, EventArgs e) diff --git a/W10SS_GUI_2/W10SS_GUI/Resource/constants.xaml b/W10SS_GUI_2/W10SS_GUI/Resource/constants.xaml deleted file mode 100644 index 9b687cb6..00000000 --- a/W10SS_GUI_2/W10SS_GUI/Resource/constants.xaml +++ /dev/null @@ -1,15 +0,0 @@ - - categoryPrivacy - categoryUi - categoryOneDrive - categorySystem - categoryStartMenu - categoryUwp - categoryWinGame - categoryTaskScheduler - categoryDefender - categoryContextMenu - \ No newline at end of file diff --git a/W10SS_GUI_2/W10SS_GUI/Resource/controls.xaml b/W10SS_GUI_2/W10SS_GUI/Resource/controls.xaml deleted file mode 100644 index b69da2bf..00000000 --- a/W10SS_GUI_2/W10SS_GUI/Resource/controls.xaml +++ /dev/null @@ -1,56 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/W10SS_GUI_2/W10SS_GUI/Resource/controlsSize.xaml b/W10SS_GUI_2/W10SS_GUI/Resource/controlsSize.xaml index 0cc6c6f8..84b787e4 100644 --- a/W10SS_GUI_2/W10SS_GUI/Resource/controlsSize.xaml +++ b/W10SS_GUI_2/W10SS_GUI/Resource/controlsSize.xaml @@ -15,5 +15,12 @@ 40 220 - 220 + 220 + + 500 + 40 + 20 + + + \ No newline at end of file diff --git a/W10SS_GUI_2/W10SS_GUI/Resource/fonts.xaml b/W10SS_GUI_2/W10SS_GUI/Resource/fonts.xaml new file mode 100644 index 00000000..b0977018 --- /dev/null +++ b/W10SS_GUI_2/W10SS_GUI/Resource/fonts.xaml @@ -0,0 +1,11 @@ + + + Calibri + Segoe MDL2 Assets + Segoe MDL2 Assets + Segoe UI + + \ No newline at end of file diff --git a/W10SS_GUI_2/W10SS_GUI/Resource/tags.xaml b/W10SS_GUI_2/W10SS_GUI/Resource/tags.xaml new file mode 100644 index 00000000..fe4a1c8d --- /dev/null +++ b/W10SS_GUI_2/W10SS_GUI/Resource/tags.xaml @@ -0,0 +1,16 @@ + + + Privacy & Telemetry + UI & Personalization + OneDrive + System + Start Menu + UWP Apps + Windows Game Recording + Task Scheduler + Microsoft Defender + Context Menu + \ No newline at end of file diff --git a/W10SS_GUI_2/W10SS_GUI/W10SS_GUI.csproj b/W10SS_GUI_2/W10SS_GUI/W10SS_GUI.csproj index e874e03d..d3c9956a 100644 --- a/W10SS_GUI_2/W10SS_GUI/W10SS_GUI.csproj +++ b/W10SS_GUI_2/W10SS_GUI/W10SS_GUI.csproj @@ -71,15 +71,19 @@ Designer MSBuild:Compile + + Designer + MSBuild:Compile + Designer MSBuild:Compile - + Designer MSBuild:Compile - + Designer MSBuild:Compile @@ -109,6 +113,9 @@ HamburgerCategoryFlashButton.xaml + + TogglesCategoryPanel.xaml + MainWindow.xaml Code