Browse Source

Add category panel 👽

pull/17/head
oZ-Zo 5 years ago
parent
commit
fcb11b56c2
  1. 6
      W10SS_GUI_2/W10SS_GUI/App.xaml
  2. 4
      W10SS_GUI_2/W10SS_GUI/Brushes/brushes.xaml
  3. 2
      W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryButton.xaml
  4. 2
      W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryFlashButton.xaml
  5. 37
      W10SS_GUI_2/W10SS_GUI/Controls/TogglesCategoryPanel.xaml
  6. 44
      W10SS_GUI_2/W10SS_GUI/Controls/TogglesCategoryPanel.xaml.cs
  7. 42
      W10SS_GUI_2/W10SS_GUI/MainWindow.xaml
  8. 3
      W10SS_GUI_2/W10SS_GUI/MainWindow.xaml.cs
  9. 15
      W10SS_GUI_2/W10SS_GUI/Resource/constants.xaml
  10. 56
      W10SS_GUI_2/W10SS_GUI/Resource/controls.xaml
  11. 9
      W10SS_GUI_2/W10SS_GUI/Resource/controlsSize.xaml
  12. 11
      W10SS_GUI_2/W10SS_GUI/Resource/fonts.xaml
  13. 16
      W10SS_GUI_2/W10SS_GUI/Resource/tags.xaml
  14. 11
      W10SS_GUI_2/W10SS_GUI/W10SS_GUI.csproj

6
W10SS_GUI_2/W10SS_GUI/App.xaml

@ -7,12 +7,12 @@
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Localized/EN.xaml" />
<ResourceDictionary Source="pack://application:,,,/Brushes/brushes.xaml" />
<ResourceDictionary Source="pack://application:,,,/Resource/controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/Brushes/brushes.xaml" />
<ResourceDictionary Source="pack://application:,,,/Resource/controlsSize.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Resource/icons.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Resource/animations.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Resource/constants.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Resource/tags.xaml"/>
<ResourceDictionary Source="pack://application:,,,/Resource/fonts.xaml"/>
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</Application.Resources>

4
W10SS_GUI_2/W10SS_GUI/Brushes/brushes.xaml

@ -1,5 +1,9 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<SolidColorBrush x:Key="windowBackground" Color="#FFFFFF"/>
<SolidColorBrush x:Key="windowForeground" Color="#000000"/>
<SolidColorBrush x:Key="buttonHamburgerBackground" Color="#353535"/>
<SolidColorBrush x:Key="buttonHamburgerHover" Color="#4A4A4A"/>
<SolidColorBrush x:Key="textHamburgerForeground" Color="#FFFFFF"/>

2
W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryButton.xaml

@ -56,7 +56,7 @@
</StackPanel.Triggers>
<StackPanel Name="hamburgerContainer" Orientation="Horizontal">
<TextBlock Name="textIcon" FontFamily="Segoe MDL2 Assets" FontSize="{DynamicResource buttonHamburgerIconsSize}"
<TextBlock Name="textIcon" FontFamily="{StaticResource textHamburgerCategoryButtonIcon}" FontSize="{DynamicResource buttonHamburgerIconsSize}"
Margin="10 0 10 0"
VerticalAlignment="Center"
Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=Icon}"/>

2
W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryFlashButton.xaml

@ -67,7 +67,7 @@
</StackPanel.Triggers>
<StackPanel Name="hamburgerContainer" Orientation="Horizontal">
<TextBlock Name="textIcon" FontFamily="Segoe MDL2 Assets" FontSize="{DynamicResource buttonHamburgerIconsSize}"
<TextBlock Name="textIcon" FontFamily="{StaticResource textHamburgerCategoryFlashButtonIcon}" FontSize="{DynamicResource buttonHamburgerIconsSize}"
Margin="10 0 10 0"
VerticalAlignment="Center"
Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=Icon}"/>

37
W10SS_GUI_2/W10SS_GUI/Controls/TogglesCategoryPanel.xaml

@ -0,0 +1,37 @@
<UserControl x:Class="W10SS_GUI.Controls.TogglesCategoryPanel"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:W10SS_GUI.Controls"
mc:Ignorable="d"
Name="togglesCategoryPanel">
<StackPanel Name="panelTogglesCategory"
Width="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=Width}"
Tag="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=Tag}"
Orientation="Vertical"
Background="{DynamicResource windowBackground}">
<StackPanel Name="panelTogglesHeader"
Height="{StaticResource togglesCategoryPanelHeaderHeight}"
Orientation="Horizontal">
<TextBlock Name="textTogglesHeader"
FontSize="{StaticResource togglesCategoryPanelHeaderFontSize}"
FontFamily="{StaticResource textTogglesHeaderFontFamily}"
Margin="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=HeaderMargin}"
VerticalAlignment="Center"
Text="{DynamicResource textHamburgerPrivacy}"/>
</StackPanel>
<ScrollViewer Name="scrollTogglesCategory"
HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto">
<StackPanel Name="Context" Orientation="Vertical" Margin="20" />
</ScrollViewer>
</StackPanel>
</UserControl>

44
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
{
/// <summary>
/// Логика взаимодействия для TogglesCategoryPanel.xaml
/// </summary>
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)));
}
}

42
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">
<Grid Name="gridWindow">
@ -145,21 +147,27 @@
</Canvas>
<!--#endregion Hamburger Panel-->
<!--#region Category Panels -->
<ScrollViewer Name="scrollCategory"
Grid.Column="1"
VerticalScrollBarVisibility="Auto"
HorizontalScrollBarVisibility="Disabled">
<!--#region Toggles Category Panels -->
<Grid Name="gridTogglesCategoryPanels" Grid.Column="1">
<Grid Name="gridCategoryPanels" Grid.Column="1"
Width="500"
HorizontalAlignment="Left">
</Grid>
<uc:TogglesCategoryPanel x:Name="panelTogglesCategoryPrivacy"
Width="{Binding ElementName=gridTogglesCategoryPanels, Path=ActualWidth}"
VerticalAlignment="Top"
HorizontalAlignment="Left"
HeaderMargin="20 0 20 6"
Tag="{StaticResource tagCategoryPrivacy}"/>
</ScrollViewer>
<!--#region Category Panels -->
</Grid>
<!--#endregion Toggles Category Panels -->
</Grid>
</Window>

3
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)

15
W10SS_GUI_2/W10SS_GUI/Resource/constants.xaml

@ -1,15 +0,0 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:W10SS_GUI.Resource">
<system:String x:Key="tagCategoryPrivacy">categoryPrivacy</system:String>
<system:String x:Key="tagCategoryUi">categoryUi</system:String>
<system:String x:Key="tagCategoryOneDrive">categoryOneDrive</system:String>
<system:String x:Key="tagCategorySystem">categorySystem</system:String>
<system:String x:Key="tagCategoryStartMenu">categoryStartMenu</system:String>
<system:String x:Key="tagCategoryUwp">categoryUwp</system:String>
<system:String x:Key="tagCategoryWinGame">categoryWinGame</system:String>
<system:String x:Key="tagCategoryTaskScheduler">categoryTaskScheduler</system:String>
<system:String x:Key="tagCategoryDefender">categoryDefender</system:String>
<system:String x:Key="tagCategoryContextMenu">categoryContextMenu</system:String>
</ResourceDictionary>

56
W10SS_GUI_2/W10SS_GUI/Resource/controls.xaml

@ -1,56 +0,0 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<!--#region Hamburger Button-->
<ControlTemplate x:Key="buttonHamburger" TargetType="Button">
<StackPanel Name="buttonHamburger" Background="{DynamicResource ResourceKey=buttonHamburgerBackground}" Width="{DynamicResource ResourceKey=buttonHamburgerWidth}"
Height="{DynamicResource ResourceKey=buttonHamburgerHeight}" Orientation="Horizontal">
<StackPanel Name="containerHamburger" Width="{DynamicResource ResourceKey=buttonHamburgerWidth}" Height="{DynamicResource ResourceKey=buttonHamburgerHeight}">
<TextBlock Name="textButtonHamburger" Text="{TemplateBinding Button.Content}" FontFamily="Segoe MDL2 Assets" FontSize="{DynamicResource buttonHamburgerFontSize}"
Margin="10" Foreground="{DynamicResource ResourceKey=ColorWhite}"/>
</StackPanel>
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="buttonHamburger" Property="Background" Value="{DynamicResource ResourceKey=buttonHamburgerHover}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ThicknessAnimation Storyboard.TargetName="containerHamburger" Storyboard.TargetProperty="Margin" Duration="0:0:0.5" From="0 0 0 0"
To="0 5 0 0" SpeedRatio="5" AutoReverse="True"/>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<!--#endregion Hamburger Button-->
<!--#region Hamburger Category Buttons-->
<!--<ControlTemplate x:Key="buttonHamburgerCategory" TargetType="Button">
<StackPanel Name="buttonHamburger" Background="{DynamicResource ResourceKey=buttonHamburgerBackground}" Width="{DynamicResource panelHamburgerMaxWidth}"
Height="{DynamicResource buttonHamburgerHeight}">
<StackPanel Name="containerHamburger">
<TextBlock Name="textButtonHamburger" Text="{TemplateBinding Button.Content}" FontFamily="Segoe MDL2 Assets" FontSize="{DynamicResource buttonHamburgerFontSize}"
Margin="10" Foreground="{DynamicResource ResourceKey=ColorWhite}"/>
</StackPanel>
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="buttonHamburger" Property="Background" Value="{DynamicResource ResourceKey=buttonHamburgerHover}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<ThicknessAnimation Storyboard.TargetName="containerHamburger" Storyboard.TargetProperty="Margin" Duration="0:0:0.5" From="0 0 0 0"
To="0 5 0 0" SpeedRatio="5" AutoReverse="True"/>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>-->
<!--#endregion Hamburger Category Buttons-->
</ResourceDictionary>

9
W10SS_GUI_2/W10SS_GUI/Resource/controlsSize.xaml

@ -15,5 +15,12 @@
<system:Double x:Key="panelHamburgerMinWidth">40</system:Double>
<system:Double x:Key="panelHamburgerWidth">220</system:Double>
<system:Double x:Key="panelHamburgerMaxWidth">220</system:Double>
<system:Double x:Key="panelHamburgerMaxWidth">220</system:Double>
<system:Double x:Key="togglesCategoryPanelWidth">500</system:Double>
<system:Double x:Key="togglesCategoryPanelHeaderHeight">40</system:Double>
<system:Double x:Key="togglesCategoryPanelHeaderFontSize">20</system:Double>
</ResourceDictionary>

11
W10SS_GUI_2/W10SS_GUI/Resource/fonts.xaml

@ -0,0 +1,11 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:W10SS_GUI.Resource"
xmlns:system="clr-namespace:System;assembly=mscorlib">
<FontFamily x:Key="textTogglesHeaderFontFamily">Calibri</FontFamily>
<FontFamily x:Key="textHamburgerCategoryButtonIcon">Segoe MDL2 Assets</FontFamily>
<FontFamily x:Key="textHamburgerCategoryFlashButtonIcon">Segoe MDL2 Assets</FontFamily>
<FontFamily x:Key="windowFontFamily">Segoe UI</FontFamily>
</ResourceDictionary>

16
W10SS_GUI_2/W10SS_GUI/Resource/tags.xaml

@ -0,0 +1,16 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:local="clr-namespace:W10SS_GUI.Resource">
<system:String x:Key="tagCategoryPrivacy">Privacy &amp; Telemetry</system:String>
<system:String x:Key="tagCategoryUi">UI &amp; Personalization</system:String>
<system:String x:Key="tagCategoryOneDrive">OneDrive</system:String>
<system:String x:Key="tagCategorySystem">System</system:String>
<system:String x:Key="tagCategoryStartMenu">Start Menu</system:String>
<system:String x:Key="tagCategoryUwp">UWP Apps</system:String>
<system:String x:Key="tagCategoryWinGame">Windows Game Recording</system:String>
<system:String x:Key="tagCategoryTaskScheduler">Task Scheduler</system:String>
<system:String x:Key="tagCategoryDefender">Microsoft Defender</system:String>
<system:String x:Key="tagCategoryContextMenu">Context Menu</system:String>
</ResourceDictionary>

11
W10SS_GUI_2/W10SS_GUI/W10SS_GUI.csproj

@ -71,15 +71,19 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Controls\TogglesCategoryPanel.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Resource\animations.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Resource\constants.xaml">
<Page Include="Resource\fonts.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="Resource\controls.xaml">
<Page Include="Resource\tags.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
@ -109,6 +113,9 @@
<Compile Include="Controls\HamburgerCategoryFlashButton.xaml.cs">
<DependentUpon>HamburgerCategoryFlashButton.xaml</DependentUpon>
</Compile>
<Compile Include="Controls\TogglesCategoryPanel.xaml.cs">
<DependentUpon>TogglesCategoryPanel.xaml</DependentUpon>
</Compile>
<Compile Include="MainWindow.xaml.cs">
<DependentUpon>MainWindow.xaml</DependentUpon>
<SubType>Code</SubType>

Loading…
Cancel
Save