diff --git a/Hamburger Icons.txt b/Hamburger Icons.txt index 37cef7ae..2113becb 100644 --- a/Hamburger Icons.txt +++ b/Hamburger Icons.txt @@ -8,6 +8,13 @@ "Task Scheduler" U+E823 "Microsoft Defender" U+E83D "Context Menu" U+E292 + +Сменить язык U+F2B7 +Перейти на Github U+E71B +Применить U+E8FB +Сохранить U+E74E +Загрузить U+E896 + -------------------------------------- Конфиденциальность и телеметрия UI и персонализация @@ -27,11 +34,11 @@ Microsoft Defender +Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=Icon}" - - +Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=Text}" diff --git a/W10SS_GUI_2/W10SS_GUI/AnimationFactory.cs b/W10SS_GUI_2/W10SS_GUI/AnimationFactory.cs deleted file mode 100644 index 99153c86..00000000 --- a/W10SS_GUI_2/W10SS_GUI/AnimationFactory.cs +++ /dev/null @@ -1,45 +0,0 @@ -using System; -using System.Collections; -using System.Collections.Generic; -using System.Windows; -using System.Windows.Media.Animation; - -namespace W10SS_GUI -{ - internal class AnimationFactory - { - private struct Duration - { - internal const int ButtonHamburger = 1; - } - - private struct Speed - { - internal const int ButtonHamburger = 5; - } - - internal Dictionary Storyboards = new Dictionary(); - internal Dictionary Animations = new Dictionary(); - - public AnimationFactory() - { - #region Hamburger Animation - - DoubleAnimation animation = new DoubleAnimation - { - Duration = new System.Windows.Duration(new TimeSpan(hours: 0, minutes: 0, seconds: Duration.ButtonHamburger)), - SpeedRatio = Speed.ButtonHamburger - }; - - Storyboard storyboard = new Storyboard(); - Storyboard.SetTargetProperty(animation, new PropertyPath(FrameworkElement.WidthProperty)); - storyboard.Children.Add(animation); - - Animations.Add("Hamburger", animation); - Storyboards.Add("Hamburger", storyboard); - - #endregion Hamburger Animation - } - - } -} \ No newline at end of file diff --git a/W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryButton.xaml b/W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryButton.xaml index ebdf68c3..5fcda437 100644 --- a/W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryButton.xaml +++ b/W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryButton.xaml @@ -44,11 +44,12 @@ + Margin="10 0 10 0" Foreground="{DynamicResource textHamburgerForeground}" + VerticalAlignment="Center" + Text="{Binding RelativeSource={RelativeSource AncestorType={x:Type UserControl}}, Path=Icon}"/> diff --git a/W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryButton.xaml.cs b/W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryButton.xaml.cs index b23de312..401567ae 100644 --- a/W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryButton.xaml.cs +++ b/W10SS_GUI_2/W10SS_GUI/Controls/HamburgerCategoryButton.xaml.cs @@ -46,7 +46,21 @@ namespace W10SS_GUI.Controls // Using a DependencyProperty as the backing store for IconText. This enables animation, styling, binding, etc... public static readonly DependencyProperty IconProperty = - DependencyProperty.Register("IconText", typeof(string), typeof(HamburgerCategoryButton), new PropertyMetadata(default (string))); + DependencyProperty.Register("Icon", typeof(string), typeof(HamburgerCategoryButton), new PropertyMetadata(default(string))); + + + + public Thickness TextMargin + { + get { return (Thickness)GetValue(TextMarginProperty); } + set { SetValue(TextMarginProperty, value); } + } + + // Using a DependencyProperty as the backing store for TextMargin. This enables animation, styling, binding, etc... + public static readonly DependencyProperty TextMarginProperty = + DependencyProperty.Register("TextMargin", typeof(Thickness), typeof(HamburgerCategoryButton), new PropertyMetadata(default(Thickness))); + + } diff --git a/W10SS_GUI_2/W10SS_GUI/Localized/EN.xaml b/W10SS_GUI_2/W10SS_GUI/Localized/EN.xaml index 357cf2df..455cd307 100644 --- a/W10SS_GUI_2/W10SS_GUI/Localized/EN.xaml +++ b/W10SS_GUI_2/W10SS_GUI/Localized/EN.xaml @@ -7,8 +7,7 @@ System Start Menu UWP Apps - Windows Game -Recording + Windows Game Task Scheduler Microsoft Defender Context Menu diff --git a/W10SS_GUI_2/W10SS_GUI/MainWindow.xaml b/W10SS_GUI_2/W10SS_GUI/MainWindow.xaml index 2fd6a516..50ed7991 100644 --- a/W10SS_GUI_2/W10SS_GUI/MainWindow.xaml +++ b/W10SS_GUI_2/W10SS_GUI/MainWindow.xaml @@ -15,14 +15,19 @@ Initialized="Window_Initialized" SizeToContent="WidthAndHeight"> + + + + - + HorizontalAlignment="Left"> @@ -35,56 +40,80 @@ - + + + + + + + + + + diff --git a/W10SS_GUI_2/W10SS_GUI/MainWindow.xaml.cs b/W10SS_GUI_2/W10SS_GUI/MainWindow.xaml.cs index 159f7af7..aa716623 100644 --- a/W10SS_GUI_2/W10SS_GUI/MainWindow.xaml.cs +++ b/W10SS_GUI_2/W10SS_GUI/MainWindow.xaml.cs @@ -21,9 +21,6 @@ namespace W10SS_GUI /// public partial class MainWindow : Window { - //TODO: УДАЛИТЬ Animation Factory - AnimationFactory AnimationFactory = new AnimationFactory(); - public MainWindow() { InitializeComponent(); @@ -31,13 +28,8 @@ namespace W10SS_GUI private void Window_Initialized(object sender, EventArgs e) { - SetLanguageDictionary(); - //buttonHamburger.Click += ButtonHamburger_Click; - } - - private void ButtonWindowMinimize_Click(object sender, RoutedEventArgs e) => Application.Current.MainWindow.WindowState = WindowState.Minimized; - - private void ButtonWindowClose_Click(object sender, RoutedEventArgs e) => Application.Current.MainWindow.Close(); + SetLanguageDictionary(); + } private void SetLanguageDictionary() { @@ -51,18 +43,6 @@ namespace W10SS_GUI } Resources.MergedDictionaries.Add(dict); - } - - private void ButtonHamburger_Click(object sender, RoutedEventArgs e) - { - //AnimationFactory.Animations["Hamburger"].To = panelHamburger.ActualWidth == panelHamburger.MinWidth ? - // panelHamburger.MaxWidth : panelHamburger.MinWidth; - //AnimationFactory.Storyboards["Hamburger"].Begin(panelHamburger); - } - - private void HamburgerCategoryButton_Loaded(object sender, RoutedEventArgs e) - { - - } + } } } diff --git a/W10SS_GUI_2/W10SS_GUI/W10SS_GUI.csproj b/W10SS_GUI_2/W10SS_GUI/W10SS_GUI.csproj index de9b3cd4..3aa41389 100644 --- a/W10SS_GUI_2/W10SS_GUI/W10SS_GUI.csproj +++ b/W10SS_GUI_2/W10SS_GUI/W10SS_GUI.csproj @@ -40,6 +40,7 @@ + @@ -90,7 +91,6 @@ MSBuild:Compile Designer - App.xaml Code @@ -134,6 +134,8 @@ - + + + \ No newline at end of file