Skip to content

Portable Tool for an Ideal Windows Setup

-edit description block

Greedeks9d59b7d1c901
diff --git a/.Source/GTweak/Assets/UserControl/Card.xaml.cs b/.Source/GTweak/Assets/UserControl/Card.xaml.cs
index 3b695c12..dd90e038 100644
--- a/.Source/GTweak/Assets/UserControl/Card.xaml.cs
+++ b/.Source/GTweak/Assets/UserControl/Card.xaml.cs
@@ -19,10 +19,10 @@ namespace GTweak.Assets.UserControl
internal DynamicResourceExtension BtnContent { set => CardButton.SetResourceReference(ContentProperty, new DynamicResourceExtensionConverter().ConvertToString(value.ResourceKey)); }
internal static readonly DependencyProperty TextProperty =
- DependencyProperty.Register("DescriptionBlock", typeof(string), typeof(TextBlock), new PropertyMetadata("", (s, e) => ((TextBlock)s).Text = (string)e.NewValue));
+ DependencyProperty.Register("DescriptionBlock", typeof(string), typeof(Card), new PropertyMetadata(string.Empty));
internal new static readonly DependencyProperty ContentProperty =
- DependencyProperty.Register("BtnContent", typeof(string), typeof(Button), new PropertyMetadata("", (s, e) => ((Button)s).Content = (string)e.NewValue));
+ DependencyProperty.Register("BtnContent", typeof(string), typeof(Button), new PropertyMetadata(string.Empty, (s, e) => ((Button)s).Content = (string)e.NewValue));
internal static readonly DependencyProperty ImageSourceProperty =
DependencyProperty.Register("ImageSource", typeof(ImageSource), typeof(Card), new PropertyMetadata(default(ImageSource)));
diff --git a/.Source/GTweak/Assets/UserControl/Comment.xaml b/.Source/GTweak/Assets/UserControl/Comment.xaml
new file mode 100644
index 00000000..53199e96
--- /dev/null
+++ b/.Source/GTweak/Assets/UserControl/Comment.xaml
@@ -0,0 +1,25 @@
+<UserControl x:Class="GTweak.Assets.UserControl.Comment"
+ 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:GTweak.Assets.UserControl"
+ mc:Ignorable="d"
+ d:DesignHeight="90" d:DesignWidth="1100" Loaded="Comment_Loaded">
+ <Viewbox>
+ <Grid Width="1100" Height="90">
+ <TextBlock x:Name="FunctionDescription" Style="{StaticResource Description}" Text="{Binding DefaultText, RelativeSource={RelativeSource AncestorType=local:Comment}}"/>
+
+ <Border Margin="20,0,0,0" Background="{StaticResource Color_ButtonOver}" Height="1" Width="50" HorizontalAlignment="Left" VerticalAlignment="Top" CornerRadius="0,15,15,0"/>
+ <Border Margin="20,0,0,0" Background="{StaticResource Color_ButtonOver}" Height="20" Width="1" HorizontalAlignment="Left" VerticalAlignment="Top" CornerRadius="0,0,15,15"/>
+ <Border Margin="20,0,0,5" Background="{StaticResource Color_ButtonOver}" Height="20" Width="1" HorizontalAlignment="Left" VerticalAlignment="Bottom" CornerRadius="15,15,0,0"/>
+ <Border Margin="20,0,0,5" Background="{StaticResource Color_ButtonOver}" Height="1" Width="50" HorizontalAlignment="Left" VerticalAlignment="Bottom" CornerRadius="0,15,15,0"/>
+
+ <Border Margin="0,0,20,0" Background="{StaticResource Color_ButtonOver}" Height="20" Width="1" HorizontalAlignment="Right" VerticalAlignment="Top" CornerRadius="0,0,15,15"/>
+ <Border Margin="0,0,20,0" Background="{StaticResource Color_ButtonOver}" Height="1" Width="50" HorizontalAlignment="Right" VerticalAlignment="Top" CornerRadius="15,0,0,15"/>
+ <Border Margin="0,0,20,5" Background="{StaticResource Color_ButtonOver}" Height="20" Width="1" HorizontalAlignment="Right" VerticalAlignment="Bottom" CornerRadius="15,15,0,0"/>
+ <Border Margin="0,0,20,5" Background="{StaticResource Color_ButtonOver}" Height="1" Width="50" HorizontalAlignment="Right" VerticalAlignment="Bottom" CornerRadius="15,0,0,15"/>
+ </Grid>
+
+ </Viewbox>
+</UserControl>
diff --git a/.Source/GTweak/Assets/UserControl/Comment.xaml.cs b/.Source/GTweak/Assets/UserControl/Comment.xaml.cs
new file mode 100644
index 00000000..740030a3
--- /dev/null
+++ b/.Source/GTweak/Assets/UserControl/Comment.xaml.cs
@@ -0,0 +1,33 @@
+using GTweak.Utilities.Helpers;
+using System;
+using System.Windows;
+
+namespace GTweak.Assets.UserControl
+{
+ public partial class Comment
+ {
+ internal string DefaultText
+ {
+ get { return (string)GetValue(DefaultTextProperty); }
+ set { SetValue(DefaultTextProperty, value); }
+ }
+
+ internal string Text
+ {
+ get { return FunctionDescription.Text; }
+ set { new TypewriterAnimation(value, FunctionDescription, value.Length < 200 ? TimeSpan.FromMilliseconds(400) : TimeSpan.FromMilliseconds(550)); }
+ }
+
+ public static readonly DependencyProperty DefaultTextProperty =
+ DependencyProperty.Register("DefaultText", typeof(string), typeof(Comment), new UIPropertyMetadata(string.Empty));
+
+ public Comment()
+ {
+ InitializeComponent();
+
+ App.LanguageChanged += delegate { new TypewriterAnimation((string)FindResource("defaultDescription"), FunctionDescription, TimeSpan.FromMilliseconds(0)); };
+ }
+
+ private void Comment_Loaded(object sender, RoutedEventArgs e) => new TypewriterAnimation(DefaultText, FunctionDescription, TimeSpan.FromMilliseconds(300));
+ }
+}
diff --git a/.Source/GTweak/GTweak.csproj b/.Source/GTweak/GTweak.csproj
index e7e320a2..39fe4e5b 100644
--- a/.Source/GTweak/GTweak.csproj
+++ b/.Source/GTweak/GTweak.csproj
@@ -242,6 +242,9 @@
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</ApplicationDefinition>
+ <Compile Include="Assets\UserControl\Comment.xaml.cs">
+ <DependentUpon>Comment.xaml</DependentUpon>
+ </Compile>
<Compile Include="Assets\UserControl\ProggressRing.xaml.cs">
<DependentUpon>ProggressRing.xaml</DependentUpon>
</Compile>
@@ -328,6 +331,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="Assets\UserControl\Comment.xaml">
+ <SubType>Designer</SubType>
+ <Generator>MSBuild:Compile</Generator>
+ </Page>
<Page Include="Assets\UserControl\ProggressRing.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
diff --git a/.Source/GTweak/Languages/ru/Localize.xaml b/.Source/GTweak/Languages/ru/Localize.xaml
index 925786e2..4e0b0e66 100644
--- a/.Source/GTweak/Languages/ru/Localize.xaml
+++ b/.Source/GTweak/Languages/ru/Localize.xaml
@@ -3,7 +3,7 @@
xmlns:v="clr-namespace:System;assembly=mscorlib">
<v:String x:Key="defaultDescription">Наведите указатель мыши на любой твик, чтобы получить его описание</v:String>
- <v:String x:Key="defaultDescriptionApp">Наведите указатель мыши на любую иконку приложения, чтобы получить его название</v:String>
+ <v:String x:Key="defaultDescriptionApp">Наведите указатель мыши на значок любого приложения, чтобы получить его название</v:String>
<!--#region Load Window -->
<v:String x:Key="title0_load">Загрузка</v:String>
diff --git a/.Source/GTweak/Styles/TextBlock.xaml b/.Source/GTweak/Styles/TextBlock.xaml
index ff41ae5f..276f6401 100644
--- a/.Source/GTweak/Styles/TextBlock.xaml
+++ b/.Source/GTweak/Styles/TextBlock.xaml
@@ -45,7 +45,7 @@
<Setter Property="Foreground" Value="{StaticResource Color_Highlighted}"/>
<Setter Property="FontFamily" Value="{StaticResource Jura}"/>
<Setter Property="FontWeight" Value="Normal"/>
- <Setter Property="FontSize" Value="16"/>
+ <Setter Property="FontSize" Value="16px"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
<Setter Property="TextAlignment" Value="Center"/>
<Setter Property="TextWrapping" Value="Wrap"/>
diff --git a/.Source/GTweak/View/ConfidentialityView.xaml b/.Source/GTweak/View/ConfidentialityView.xaml
index 1a641301..3ce8298c 100644
--- a/.Source/GTweak/View/ConfidentialityView.xaml
+++ b/.Source/GTweak/View/ConfidentialityView.xaml
@@ -33,7 +33,7 @@
<uc:ToggleButton x:Name="TglButton7" Height="25" Width="Auto" Margin="20,20,0,0" DynamicText="{DynamicResource tgl7_confidentiality}" MouseEnter="Tweak_MouseEnter" MouseLeave="Tweak_MouseLeave" ChangedState="TglButton_ChangedState"/>
<uc:ToggleButton x:Name="TglButton8" Height="25" Width="Auto" Margin="20,20,0,0" DynamicText="{DynamicResource tgl8_confidentiality}" MouseEnter="Tweak_MouseEnter" MouseLeave="Tweak_MouseLeave" ChangedState="TglButton_ChangedState"/>
<uc:ToggleButton x:Name="TglButton9" Height="25" Width="Auto" Margin="20,20,0,0" DynamicText="{DynamicResource tgl9_confidentiality}" MouseEnter="Tweak_MouseEnter" MouseLeave="Tweak_MouseLeave" ChangedState="TglButton_ChangedState"/>
-
+
</StackPanel>
</Grid>
@@ -55,6 +55,7 @@
</Grid>
</ScrollViewer>
+
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="40*"/>
@@ -62,12 +63,8 @@
</Grid.RowDefinitions>
<Grid Grid.Row="1">
- <Border Background="{StaticResource Color_Accent}" Height="1" Width="900" VerticalAlignment="Top" HorizontalAlignment="Center" CornerRadius="15"/>
- <TextBlock x:Name="TextDescription" Style="{StaticResource Description}" Text="{DynamicResource defaultDescription}"/>
+ <uc:Comment x:Name="CommentTweak" DefaultText="{DynamicResource defaultDescription}"/>
</Grid>
-
</Grid>
-
</Grid>
-
</UserControl>
diff --git a/.Source/GTweak/View/ConfidentialityView.xaml.cs b/.Source/GTweak/View/ConfidentialityView.xaml.cs
index ea04bc24..2424b0c3 100644
--- a/.Source/GTweak/View/ConfidentialityView.xaml.cs
+++ b/.Source/GTweak/View/ConfidentialityView.xaml.cs
@@ -1,6 +1,5 @@
using GTweak.Assets.UserControl;
using GTweak.Utilities.Control;
-using GTweak.Utilities.Helpers;
using GTweak.Utilities.Tweaks;
using System;
using System.Threading.Tasks;
@@ -15,23 +14,21 @@ namespace GTweak.View
public ConfidentialityView()
{
InitializeComponent();
-
- App.LanguageChanged += delegate { new TypewriterAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(0)); };
}
private void Tweak_MouseEnter(object sender, MouseEventArgs e)
{
ToggleButton toggleButton = (ToggleButton)sender;
- string _descriptionTweak = (string)FindResource(toggleButton.Name + "_description_confidentiality");
+ string descriptionTweak = (string)FindResource(toggleButton.Name + "_description_confidentiality");
- if (TextDescription.Text != _descriptionTweak)
- new TypewriterAnimation(_descriptionTweak, TextDescription, _descriptionTweak.Length < 200 ? TimeSpan.FromMilliseconds(400) : TimeSpan.FromMilliseconds(550));
+ if (CommentTweak.Text != descriptionTweak)
+ CommentTweak.Text = descriptionTweak;
}
private void Tweak_MouseLeave(object sender, MouseEventArgs e)
{
- if (TextDescription.Text != (string)FindResource("defaultDescription"))
- new TypewriterAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(250));
+ if (CommentTweak.Text != (string)FindResource("defaultDescription"))
+ CommentTweak.Text = (string)FindResource("defaultDescription");
}
private void TglButton_ChangedState(object sender, EventArgs e)
@@ -51,10 +48,7 @@ namespace GTweak.View
Parallel.Invoke(async delegate { await Task.Delay(1000); new ConfidentialityTweaks().ViewСonfidentiality(this); });
}
- private void Page_Loaded(object sender, RoutedEventArgs e)
- {
- new TypewriterAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(300));
- Parallel.Invoke(() => new ConfidentialityTweaks().ViewСonfidentiality(this));
- }
+ private void Page_Loaded(object sender, RoutedEventArgs e) => Parallel.Invoke(() => new ConfidentialityTweaks().ViewСonfidentiality(this));
+
}
}
diff --git a/.Source/GTweak/View/DataSystemView.xaml b/.Source/GTweak/View/DataSystemView.xaml
index 95a5e584..4b35f1a4 100644
--- a/.Source/GTweak/View/DataSystemView.xaml
+++ b/.Source/GTweak/View/DataSystemView.xaml
@@ -32,9 +32,9 @@
<Grid Grid.Row="0">
<Grid HorizontalAlignment="Left" Margin="50,10,0,0" Width="110" Height="110">
- <Ellipse Height="95" Width="95" Stroke="{StaticResource Color_Background_RadialProgressBar}" StrokeThickness="4.5" VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="0.2"/>
+ <Ellipse Height="90" Width="90" Stroke="{StaticResource Color_Background_RadialProgressBar}" StrokeThickness="4.5" VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="0.2"/>
- <xrpb:RadialProgressBar x:Name="CPULoad" Value="0" Maximum="100" Width="106" Height="104" ArcWidth="4" VerticalAlignment="Center" HorizontalAlignment="Center">
+ <xrpb:RadialProgressBar x:Name="CPULoad" Value="0" Maximum="100" Width="100" Height="100" ArcWidth="4" VerticalAlignment="Center" HorizontalAlignment="Center">
<xrpb:RadialProgressBar.Foreground>
<LinearGradientBrush EndPoint="0,0.3" StartPoint="0.9,0" ColorInterpolationMode="ScRgbLinearInterpolation" MappingMode="RelativeToBoundingBox" SpreadMethod="Pad">
<GradientStop Color="{StaticResource Color_Border_Gradient_2}" Offset="0.7"/>
@@ -75,9 +75,9 @@
</Grid>
<Grid HorizontalAlignment="Right" Margin="0,10,50,0" Width="110" Height="110">
- <Ellipse Height="95" Width="95" Stroke="{StaticResource Color_Background_RadialProgressBar}" StrokeThickness="4.5" VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="0.2"/>
+ <Ellipse Height="90" Width="90" Stroke="{StaticResource Color_Background_RadialProgressBar}" StrokeThickness="4.5" VerticalAlignment="Center" HorizontalAlignment="Center" Opacity="0.2"/>
- <xrpb:RadialProgressBar x:Name="RAMLoad" Value="0" Maximum="100" Width="106" Height="104" ArcWidth="4" VerticalAlignment="Center" HorizontalAlignment="Center" Cursor="Arrow">
+ <xrpb:RadialProgressBar x:Name="RAMLoad" Value="0" Maximum="100" Width="100" Height="100" ArcWidth="4" VerticalAlignment="Center" HorizontalAlignment="Center" Cursor="Arrow">
<xrpb:RadialProgressBar.Foreground>
<LinearGradientBrush EndPoint="0,0.3" StartPoint="0.9,0" ColorInterpolationMode="ScRgbLinearInterpolation" MappingMode="RelativeToBoundingBox" SpreadMethod="Pad">
<GradientStop Color="{StaticResource Color_Border_Gradient_2}" Offset="0.7"/>
diff --git a/.Source/GTweak/View/DataSystemView.xaml.cs b/.Source/GTweak/View/DataSystemView.xaml.cs
index a8d0dd70..3833d92e 100644
--- a/.Source/GTweak/View/DataSystemView.xaml.cs
+++ b/.Source/GTweak/View/DataSystemView.xaml.cs
@@ -151,15 +151,21 @@ namespace GTweak.View
if (e.LeftButton == MouseButtonState.Pressed && e.ClickCount >= 2)
{
Clipboard.Clear();
- if (sender.GetType().Name == "TextBlock")
+ switch (sender.GetType().Name)
{
- TextBlock textBlock = (TextBlock)sender;
- Clipboard.SetData(DataFormats.UnicodeText, textBlock.Text.Replace('\n', ' '));
- }
- else if (sender.GetType().Name == "Run")
- {
- Run runtext = (Run)sender;
- Clipboard.SetData(DataFormats.UnicodeText, runtext.Text.Replace('\n', ' '));
+ case "TextBlock":
+ {
+ TextBlock textBlock = (TextBlock)sender;
+ Clipboard.SetData(DataFormats.UnicodeText, textBlock.Text.Replace('\n', ' '));
+ break;
+ }
+
+ case "Run":
+ {
+ Run runtext = (Run)sender;
+ Clipboard.SetData(DataFormats.UnicodeText, runtext.Text.Replace('\n', ' '));
+ break;
+ }
}
if (!PopupCopy.IsOpen)
diff --git a/.Source/GTweak/View/InterfaceView.xaml b/.Source/GTweak/View/InterfaceView.xaml
index d40ace2e..ce37f135 100644
--- a/.Source/GTweak/View/InterfaceView.xaml
+++ b/.Source/GTweak/View/InterfaceView.xaml
@@ -77,8 +77,7 @@
</Grid.RowDefinitions>
<Grid Grid.Row="1">
- <Border Background="{StaticResource Color_Accent}" Height="1" Width="900" VerticalAlignment="Top" HorizontalAlignment="Center" CornerRadius="15"/>
- <TextBlock x:Name="TextDescription" Style="{StaticResource Description}" Text="{DynamicResource defaultDescription}"/>
+ <uc:Comment x:Name="CommentTweak" DefaultText="{DynamicResource defaultDescription}"/>
<TextBlock x:Name="TextViewColor" Style="{StaticResource Description}" Text="{DynamicResource textcolor_interface}" VerticalAlignment="Top" Foreground="#505050" Visibility="Hidden" Margin="0,28,0,0"/>
<StackPanel x:Name="PreviewFlick" Orientation="Horizontal" VerticalAlignment="Top" Margin="0,28,0,0" HorizontalAlignment="Center" Visibility="Hidden">
<StackPanel.Style>
@@ -133,8 +132,6 @@
</Border>
</StackPanel>
</Grid>
-
</Grid>
-
</Grid>
</UserControl>
diff --git a/.Source/GTweak/View/InterfaceView.xaml.cs b/.Source/GTweak/View/InterfaceView.xaml.cs
index c2a2f54e..18427bf4 100644
--- a/.Source/GTweak/View/InterfaceView.xaml.cs
+++ b/.Source/GTweak/View/InterfaceView.xaml.cs
@@ -17,8 +17,6 @@ namespace GTweak.View
{
InitializeComponent();
- App.LanguageChanged += delegate { new TypewriterAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(0)); };
-
if (!WindowsLicense.IsWindowsActivated)
new ViewNotification().Show("", "info", (string)Application.Current.Resources["viewlicense_notification"]);
}
@@ -26,11 +24,11 @@ namespace GTweak.View
private void Tweak_MouseEnter(object sender, MouseEventArgs e)
{
ToggleButton toggleButton = (ToggleButton)sender;
- string _descriptionTweak = (string)FindResource(toggleButton.Name + "_description_interface");
+ string descriptionTweak = (string)FindResource(toggleButton.Name + "_description_interface");
- if (TextDescription.Text != _descriptionTweak)
+ if (CommentTweak.Text != descriptionTweak)
{
- new TypewriterAnimation(_descriptionTweak, TextDescription, _descriptionTweak.Length < 200 ? TimeSpan.FromMilliseconds(400) : TimeSpan.FromMilliseconds(550));
+ CommentTweak.Text = descriptionTweak;
if (toggleButton.Name == "TglButton1")
{
@@ -56,8 +54,8 @@ namespace GTweak.View
TextViewColor.Visibility = Visibility.Hidden;
else if (PreviewFlick.Visibility == Visibility.Visible)
PreviewFlick.Visibility = Visibility.Hidden;
- if (TextDescription.Text != (string)FindResource("defaultDescription"))
- new TypewriterAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(250));
+ if (CommentTweak.Text != (string)FindResource("defaultDescription"))
+ CommentTweak.Text = (string)FindResource("defaultDescription");
}
private void TglButton_ChangedState(object sender, EventArgs e)
@@ -88,10 +86,7 @@ namespace GTweak.View
Parallel.Invoke(async delegate { await Task.Delay(1000); new InterfaceTweaks().ViewInterface(this); });
}
- private void Page_Loaded(object sender, RoutedEventArgs e)
- {
- new TypewriterAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(300));
- Parallel.Invoke(() => new InterfaceTweaks().ViewInterface(this));
- }
+ private void Page_Loaded(object sender, RoutedEventArgs e) => Parallel.Invoke(() => new InterfaceTweaks().ViewInterface(this));
+
}
}
diff --git a/.Source/GTweak/View/PakagesView.xaml b/.Source/GTweak/View/PakagesView.xaml
index 5b0d4b69..569b25f5 100644
--- a/.Source/GTweak/View/PakagesView.xaml
+++ b/.Source/GTweak/View/PakagesView.xaml
@@ -3,6 +3,7 @@
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:uc="clr-namespace:GTweak.Assets.UserControl"
xmlns:local="clr-namespace:GTweak.View"
mc:Ignorable="d"
d:DesignHeight="550" d:DesignWidth="1100"
@@ -373,14 +374,8 @@
</Grid.RowDefinitions>
<Grid Grid.Row="1">
- <Border Background="{StaticResource Color_Accent}" Height="1" Width="900" VerticalAlignment="Top" HorizontalAlignment="Center" CornerRadius="15"/>
- <TextBlock x:Name="TextDescription" Style="{StaticResource Description}" Text="{DynamicResource defaultDescriptionApp}" Cursor="Arrow"/>
+ <uc:Comment x:Name="CommentApp" DefaultText="{DynamicResource defaultDescriptionApp}"/>
</Grid>
-
</Grid>
-
-
-
-
</Grid>
</UserControl>
diff --git a/.Source/GTweak/View/PakagesView.xaml.cs b/.Source/GTweak/View/PakagesView.xaml.cs
index dd93194e..36e9897b 100644
--- a/.Source/GTweak/View/PakagesView.xaml.cs
+++ b/.Source/GTweak/View/PakagesView.xaml.cs
@@ -22,8 +22,6 @@ namespace GTweak.View
{
InitializeComponent();
- App.LanguageChanged += delegate { new TypewriterAnimation((string)FindResource("defaultDescriptionApp"), TextDescription, TimeSpan.FromMilliseconds(0)); };
-
DispatcherTimer timer = new DispatcherTimer(new TimeSpan(0, 0, 1), DispatcherPriority.Normal, delegate
{
if (time.TotalSeconds % 4 == 0)
@@ -81,23 +79,20 @@ namespace GTweak.View
{
Image imageApp = (Image)sender;
- string _descriptionApps = (string)FindResource(imageApp.Name + "_applications");
+ string descriptionApp = (string)FindResource(imageApp.Name + "_applications");
- if (TextDescription.Text != _descriptionApps)
- new TypewriterAnimation(_descriptionApps, TextDescription, TimeSpan.FromMilliseconds(250));
+ if (CommentApp.Text != descriptionApp)
+ CommentApp.Text = descriptionApp;
}
private void Apps_MouseLeave(object sender, MouseEventArgs e)
{
- if (TextDescription.Text != (string)FindResource("defaultDescriptionApp"))
- new TypewriterAnimation((string)FindResource("defaultDescriptionApp"), TextDescription, TimeSpan.FromMilliseconds(250));
+ if (CommentApp.Text != (string)FindResource("defaultDescriptionApp"))
+ CommentApp.Text = (string)FindResource("defaultDescriptionApp");
}
- private void Page_Loaded(object sender, RoutedEventArgs e)
- {
- UpdateViewStatePakages();
- new TypewriterAnimation((string)FindResource("defaultDescriptionApp"), TextDescription, TimeSpan.FromMilliseconds(300));
- }
+ private void Page_Loaded(object sender, RoutedEventArgs e) => UpdateViewStatePakages();
+
private ImageSource AvailabilityInstalledPackage(string packageName, string partName, bool isOneDrive = false)
{
diff --git a/.Source/GTweak/View/ServicesView.xaml b/.Source/GTweak/View/ServicesView.xaml
index 5248ea69..cf4d1b6a 100644
--- a/.Source/GTweak/View/ServicesView.xaml
+++ b/.Source/GTweak/View/ServicesView.xaml
@@ -21,7 +21,7 @@
<ColumnDefinition/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
-
+
<Grid Grid.Column="0">
<StackPanel Orientation="Vertical" VerticalAlignment="Top" Width="Auto" Height="Auto">
<uc:ToggleButton x:Name="TglButton1" Height="25" Width="Auto" Margin="20,15,0,0" DynamicText="{DynamicResource tgl1_services}" MouseEnter="Tweak_MouseEnter" MouseLeave="Tweak_MouseLeave" ChangedState="TglButton_ChangedState"/>
@@ -62,6 +62,7 @@
</Grid>
</ScrollViewer>
+
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="40*"/>
@@ -69,11 +70,8 @@
</Grid.RowDefinitions>
<Grid Grid.Row="1">
- <Border Background="{StaticResource Color_Accent}" Height="1" Width="900" VerticalAlignment="Top" HorizontalAlignment="Center" CornerRadius="15"/>
- <TextBlock x:Name="TextDescription" Style="{StaticResource Description}" Text="{DynamicResource defaultDescription}"/>
+ <uc:Comment x:Name="CommentTweak" DefaultText="{DynamicResource defaultDescription}"/>
</Grid>
-
</Grid>
-
</Grid>
</UserControl>
diff --git a/.Source/GTweak/View/ServicesView.xaml.cs b/.Source/GTweak/View/ServicesView.xaml.cs
index 4653a732..8e214fcd 100644
--- a/.Source/GTweak/View/ServicesView.xaml.cs
+++ b/.Source/GTweak/View/ServicesView.xaml.cs
@@ -1,6 +1,5 @@
using GTweak.Assets.UserControl;
using GTweak.Utilities.Control;
-using GTweak.Utilities.Helpers;
using GTweak.Utilities.Tweaks;
using System;
using System.Threading.Tasks;
@@ -14,23 +13,21 @@ namespace GTweak.View
public ServicesView()
{
InitializeComponent();
-
- App.LanguageChanged += delegate { new TypewriterAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(0)); };
}
private void Tweak_MouseEnter(object sender, MouseEventArgs e)
{
ToggleButton toggleButton = (ToggleButton)sender;
- string _descriptionTweak = (string)FindResource(toggleButton.Name + "_description_services");
+ string descriptionTweak = (string)FindResource(toggleButton.Name + "_description_services");
- if (TextDescription.Text != _descriptionTweak)
- new TypewriterAnimation(_descriptionTweak, TextDescription, _descriptionTweak.Length < 200 ? TimeSpan.FromMilliseconds(400) : TimeSpan.FromMilliseconds(550));
+ if (CommentTweak.Text != descriptionTweak)
+ CommentTweak.Text = descriptionTweak;
}
private void Tweak_MouseLeave(object sender, MouseEventArgs e)
{
- if (TextDescription.Text != (string)FindResource("defaultDescription"))
- new TypewriterAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(250));
+ if (CommentTweak.Text != (string)FindResource("defaultDescription"))
+ CommentTweak.Text = (string)FindResource("defaultDescription");
}
private void TglButton_ChangedState(object sender, EventArgs e)
@@ -43,10 +40,6 @@ namespace GTweak.View
Parallel.Invoke(async delegate { await Task.Delay(1000); new ServicesTweaks().ViewServices(this); });
}
- private void Page_Loaded(object sender, System.Windows.RoutedEventArgs e)
- {
- new TypewriterAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(300));
- Parallel.Invoke(() => new ServicesTweaks().ViewServices(this));
- }
+ private void Page_Loaded(object sender, System.Windows.RoutedEventArgs e) => Parallel.Invoke(() => new ServicesTweaks().ViewServices(this));
}
}
diff --git a/.Source/GTweak/View/SystemView.xaml b/.Source/GTweak/View/SystemView.xaml
index 95659557..13ffaa95 100644
--- a/.Source/GTweak/View/SystemView.xaml
+++ b/.Source/GTweak/View/SystemView.xaml
@@ -79,10 +79,8 @@
</Grid.RowDefinitions>
<Grid Grid.Row="1">
- <Border Background="{StaticResource Color_Accent}" Height="1" Width="900" VerticalAlignment="Top" HorizontalAlignment="Center" CornerRadius="15"/>
- <TextBlock x:Name="TextDescription" Style="{StaticResource Description}" Text="{DynamicResource defaultDescription}"/>
+ <uc:Comment x:Name="CommentTweak" DefaultText="{DynamicResource defaultDescription}"/>
</Grid>
</Grid>
-
</Grid>
</UserControl>
diff --git a/.Source/GTweak/View/SystemView.xaml.cs b/.Source/GTweak/View/SystemView.xaml.cs
index 46fc9bc0..bf89a0c0 100644
--- a/.Source/GTweak/View/SystemView.xaml.cs
+++ b/.Source/GTweak/View/SystemView.xaml.cs
@@ -15,32 +15,30 @@ namespace GTweak.View
public SystemView()
{
InitializeComponent();
-
- App.LanguageChanged += delegate { new TypewriterAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(0)); };
}
private void Tweak_MouseEnter(object sender, MouseEventArgs e)
{
ToggleButton toggleButton = (ToggleButton)sender;
- string _descriptionTweak = (string)FindResource(toggleButton.Name + "_description_system");
+ string descriptionTweak = (string)FindResource(toggleButton.Name + "_description_system");
- if (TextDescription.Text != _descriptionTweak)
- new TypewriterAnimation(_descriptionTweak, TextDescription, _descriptionTweak.Length < 200 ? TimeSpan.FromMilliseconds(400) : TimeSpan.FromMilliseconds(550));
+ if (CommentTweak.Text != descriptionTweak)
+ CommentTweak.Text = descriptionTweak;
}
private void TweakSlider_MouseEnter(object sender, MouseEventArgs e)
{
StackPanel stackPanel = (StackPanel)sender;
- string _descriptionTweak = (string)FindResource(stackPanel.Name + "_description_system");
+ string descriptionTweak = (string)FindResource(stackPanel.Name + "_description_system");
- if (TextDescription.Text != (string)FindResource(stackPanel.Name + "_description_system"))
- new TypewriterAnimation(_descriptionTweak, TextDescription, _descriptionTweak.Length < 200 ? TimeSpan.FromMilliseconds(400) : TimeSpan.FromMilliseconds(550));
+ if (CommentTweak.Text != descriptionTweak)
+ CommentTweak.Text = descriptionTweak;
}
private void Tweak_MouseLeave(object sender, MouseEventArgs e)
{
- if (TextDescription.Text != (string)FindResource("defaultDescription"))
- new TypewriterAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(250));
+ if (CommentTweak.Text != (string)FindResource("defaultDescription"))
+ CommentTweak.Text = (string)FindResource("defaultDescription");
}
private void Sliders_PreviewMouseUp(object sender, MouseButtonEventArgs e)
@@ -95,10 +93,6 @@ namespace GTweak.View
}
}
- private void Page_Loaded(object sender, RoutedEventArgs e)
- {
- new TypewriterAnimation((string)FindResource("defaultDescription"), TextDescription, TimeSpan.FromMilliseconds(300));
- Parallel.Invoke(() => new SystemTweaks().ViewSystem(this));
- }
+ private void Page_Loaded(object sender, RoutedEventArgs e) => Parallel.Invoke(() => new SystemTweaks().ViewSystem(this));
}
}