Skip to content

Portable Tool for an Ideal Windows Setup

upd. button hover animation with float & shadow effect

Greedekse1ec5ee7a1b9
diff --git a/.Source/GTweak/Assets/ShaderEffects/ColorWheelEffect.cs b/.Source/GTweak/Assets/ShaderEffects/ColorWheelEffect.cs
index 125ca8b5..f88aedb0 100644
--- a/.Source/GTweak/Assets/ShaderEffects/ColorWheelEffect.cs
+++ b/.Source/GTweak/Assets/ShaderEffects/ColorWheelEffect.cs
@@ -5,8 +5,19 @@ using System.Windows.Media.Effects;
namespace GTweak.Assets.ShaderEffects
{
- public class ColorWheelEffect : ShaderEffect
+ public sealed class ColorWheelEffect : ShaderEffect
{
+ protected override Freezable CreateInstanceCore() => new ColorWheelEffect();
+
+ internal static readonly DependencyProperty InputProperty =
+ RegisterPixelShaderSamplerProperty("Input", typeof(ColorWheelEffect), 0);
+
+ internal Brush Input
+ {
+ get => (Brush)GetValue(InputProperty);
+ set => SetValue(InputProperty, value);
+ }
+
private static readonly PixelShader _shader = new PixelShader()
{
UriSource = new Uri("/GTweak;component/Assets/ShaderEffects/ColorWheelEffect.ps", UriKind.Relative)
@@ -17,13 +28,5 @@ namespace GTweak.Assets.ShaderEffects
PixelShader = _shader;
UpdateShaderValue(InputProperty);
}
-
- public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(ColorWheelEffect), 0);
-
- public Brush Input
- {
- get => (Brush)GetValue(InputProperty);
- set => SetValue(InputProperty, value);
- }
}
}
diff --git a/.Source/GTweak/Properties/AssemblyInfo.cs b/.Source/GTweak/Properties/AssemblyInfo.cs
index 0e21bb79..c582984f 100644
--- a/.Source/GTweak/Properties/AssemblyInfo.cs
+++ b/.Source/GTweak/Properties/AssemblyInfo.cs
@@ -7,9 +7,9 @@ using System.Windows;
[assembly: AssemblyProduct("GTweak")]
[assembly: AssemblyCopyright("� 2024-2026 Greedeks")]
[assembly: AssemblyTrademark("Greedeks")]
-[assembly: AssemblyInformationalVersion("Build: 5.5.0")]
-[assembly: AssemblyVersion("5.5.20.401")]
-[assembly: AssemblyFileVersion("5.5.20.401")]
+[assembly: AssemblyInformationalVersion("Build: 5.5.1")]
+[assembly: AssemblyVersion("5.5.43.15")]
+[assembly: AssemblyFileVersion("5.5.43.15")]
[assembly: ComVisible(false)]
diff --git a/.Source/GTweak/Properties/AssemblyInfo.tt b/.Source/GTweak/Properties/AssemblyInfo.tt
index cb2e3b08..054f75f4 100644
--- a/.Source/GTweak/Properties/AssemblyInfo.tt
+++ b/.Source/GTweak/Properties/AssemblyInfo.tt
@@ -22,7 +22,7 @@ using System.Windows;
[assembly: AssemblyMetadata("RepositoryType", "git")]
<#+
- private const string majorVersion = "Build: 5.5.0";
+ private const string majorVersion = "Build: 5.5.1";
private string GenerateVersion()
{
diff --git a/.Source/GTweak/Styles/Buttons/Buttons.xaml b/.Source/GTweak/Styles/Buttons/Buttons.xaml
index 8b257b92..c3a9f6c0 100644
--- a/.Source/GTweak/Styles/Buttons/Buttons.xaml
+++ b/.Source/GTweak/Styles/Buttons/Buttons.xaml
@@ -139,7 +139,7 @@
<Setter Property="FontFamily" Value="{StaticResource Jura}"/>
<Setter Property="FontWeight" Value="Normal"/>
<Setter Property="Cursor" Value="Hand"/>
- <Setter Property="FocusVisualStyle" Value="{x:Null}" />
+ <Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="Focusable" Value="False"/>
<Setter Property="Padding" Value="12,6"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
@@ -147,75 +147,51 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
- <Grid x:Name="ButtonRoot">
- <ContentPresenter x:Name="RootContent" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" IsHitTestVisible="False"/>
- <Border Background="{TemplateBinding Background}" CornerRadius="7">
- <Border x:Name="HoverBackground" Background="{TemplateBinding BorderBrush}" CornerRadius="7" Opacity="0" />
+ <Grid>
+ <Border CornerRadius="7" Opacity="0.5" Background="{StaticResource Brush_ShadowOverlay}" IsHitTestVisible="False" HorizontalAlignment="Stretch" VerticalAlignment="Stretch">
+ <Border.RenderTransform>
+ <TranslateTransform X="3" Y="6"/>
+ </Border.RenderTransform>
</Border>
- <Border CornerRadius="7" ClipToBounds="True" IsHitTestVisible="False">
- <Rectangle x:Name="ContentView">
- <Rectangle.Fill>
- <VisualBrush x:Name="AnimatedBrush" Visual="{Binding ElementName=RootContent}" Stretch="None" TileMode="Tile" Viewport="0,0,1,1" />
- </Rectangle.Fill>
- </Rectangle>
+ <Border Background="{TemplateBinding Background}" CornerRadius="7">
+ <Border x:Name="RollTarget" Background="Transparent" RenderTransformOrigin="0.5,0.5">
+ <Border.RenderTransform>
+ <TranslateTransform x:Name="Translate" Y="0"/>
+ </Border.RenderTransform>
+ <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" IsHitTestVisible="False"/>
+ </Border>
</Border>
</Grid>
-
<ControlTemplate.Triggers>
- <Trigger Property="IsMouseOver" Value="True">
- <Trigger.EnterActions>
- <BeginStoryboard>
+ <MultiDataTrigger>
+ <MultiDataTrigger.Conditions>
+ <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="True"/>
+ <Condition Binding="{Binding Tag, RelativeSource={RelativeSource Self}}" Value="{x:Null}"/>
+ </MultiDataTrigger.Conditions>
+ <MultiDataTrigger.EnterActions>
+ <BeginStoryboard x:Name="EnterFloat">
<Storyboard Timeline.DesiredFrameRate="120">
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonRoot" Storyboard.TargetProperty="CacheMode">
- <DiscreteObjectKeyFrame KeyTime="0:0:0">
- <DiscreteObjectKeyFrame.Value>
- <BitmapCache RenderAtScale="1"/>
- </DiscreteObjectKeyFrame.Value>
- </DiscreteObjectKeyFrame>
- </ObjectAnimationUsingKeyFrames>
- <RectAnimation Storyboard.TargetName="AnimatedBrush" Storyboard.TargetProperty="Viewport" To="0,-1,1,1" Duration="0:0:0.9">
- <RectAnimation.EasingFunction>
- <BackEase EasingMode="EaseOut" Amplitude="0.5"/>
- </RectAnimation.EasingFunction>
- </RectAnimation>
- <DoubleAnimation Storyboard.TargetName="HoverBackground" Storyboard.TargetProperty="Opacity" To="1" Duration="0:0:0.4">
+ <DoubleAnimation Storyboard.TargetName="Translate" Storyboard.TargetProperty="Y" To="-4" Duration="0:0:0.6">
<DoubleAnimation.EasingFunction>
- <CubicEase EasingMode="EaseOut"/>
+ <BackEase EasingMode="EaseOut" Amplitude="0.4"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonRoot" Storyboard.TargetProperty="CacheMode">
- <DiscreteObjectKeyFrame KeyTime="0:0:1.0" Value="{x:Null}"/>
- </ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
- </Trigger.EnterActions>
- <Trigger.ExitActions>
- <BeginStoryboard>
+ </MultiDataTrigger.EnterActions>
+ <MultiDataTrigger.ExitActions>
+ <StopStoryboard BeginStoryboardName="EnterFloat"/>
+ <BeginStoryboard x:Name="LeaveFloat">
<Storyboard Timeline.DesiredFrameRate="120">
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonRoot" Storyboard.TargetProperty="CacheMode">
- <DiscreteObjectKeyFrame KeyTime="0:0:0">
- <DiscreteObjectKeyFrame.Value>
- <BitmapCache RenderAtScale="1"/>
- </DiscreteObjectKeyFrame.Value>
- </DiscreteObjectKeyFrame>
- </ObjectAnimationUsingKeyFrames>
- <RectAnimation Storyboard.TargetName="AnimatedBrush" Storyboard.TargetProperty="Viewport" To="0,0,1,1" Duration="0:0:0.8">
- <RectAnimation.EasingFunction>
- <BackEase EasingMode="EaseOut" Amplitude="0.5"/>
- </RectAnimation.EasingFunction>
- </RectAnimation>
- <DoubleAnimation Storyboard.TargetName="HoverBackground" Storyboard.TargetProperty="Opacity" To="0" Duration="0:0:0.4">
+ <DoubleAnimation Storyboard.TargetName="Translate" Storyboard.TargetProperty="Y" To="0" Duration="0:0:0.5">
<DoubleAnimation.EasingFunction>
- <CubicEase EasingMode="EaseOut"/>
+ <BackEase EasingMode="EaseOut" Amplitude="0.3"/>
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
- <ObjectAnimationUsingKeyFrames Storyboard.TargetName="ButtonRoot" Storyboard.TargetProperty="CacheMode">
- <DiscreteObjectKeyFrame KeyTime="0:0:0.9" Value="{x:Null}"/>
- </ObjectAnimationUsingKeyFrames>
</Storyboard>
</BeginStoryboard>
- </Trigger.ExitActions>
- </Trigger>
+ </MultiDataTrigger.ExitActions>
+ </MultiDataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
@@ -223,15 +199,25 @@
</Style>
<Style x:Key="ButtonContent" TargetType="{x:Type Button}" BasedOn="{StaticResource BaseButtonStyle}">
- <Setter Property="Foreground" Value="{StaticResource Brush_Highlighted}"/>
- <Setter Property="Background" Value="{StaticResource Brush_Button}"/>
+ <Setter Property="Foreground" Value="{StaticResource Brush_Highlighted}"/>
+ <Setter Property="Background" Value="{StaticResource Brush_Button}"/>
<Setter Property="BorderBrush" Value="{StaticResource Brush_Button_Hover}"/>
+ <Style.Triggers>
+ <Trigger Property="IsMouseOver" Value="True">
+ <Setter Property="Background" Value="{StaticResource Brush_Button_Hover}"/>
+ </Trigger>
+ </Style.Triggers>
</Style>
<Style x:Key="ButtonContent_Inverted" TargetType="{x:Type Button}" BasedOn="{StaticResource BaseButtonStyle}">
- <Setter Property="Foreground" Value="{StaticResource Brush_Highlighted_Inverted}"/>
- <Setter Property="Background" Value="{StaticResource Brush_Button_Inverted}"/>
+ <Setter Property="Foreground" Value="{StaticResource Brush_Highlighted_Inverted}"/>
+ <Setter Property="Background" Value="{StaticResource Brush_Button_Inverted}"/>
<Setter Property="BorderBrush" Value="{StaticResource Brush_Button_Hover_Inverted}"/>
+ <Style.Triggers>
+ <Trigger Property="IsMouseOver" Value="True">
+ <Setter Property="Background" Value="{StaticResource Brush_Button_Hover_Inverted}"/>
+ </Trigger>
+ </Style.Triggers>
</Style>
-
+
</ResourceDictionary>
\ No newline at end of file
diff --git a/.Source/GTweak/Windows/MainWindow.xaml b/.Source/GTweak/Windows/MainWindow.xaml
index 81d5b75f..e35869cb 100644
--- a/.Source/GTweak/Windows/MainWindow.xaml
+++ b/.Source/GTweak/Windows/MainWindow.xaml
@@ -105,7 +105,7 @@
</Border.OpacityMask>
<ScrollViewer VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Disabled">
- <Grid Width="400" Margin="0" VirtualizingStackPanel.IsVirtualizing="True">
+ <Grid Width="400" Margin="0">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>