Skip to content

Portable Tool for an Ideal Windows Setup

add clear button for textbox & fix duration anim for toolsetcard

Greedeksdf8a68aa41a7
diff --git a/.Source/GTweak/Assets/UserControls/ToolsetCard.xaml b/.Source/GTweak/Assets/UserControls/ToolsetCard.xaml
index ef133669..d08be9ae 100644
--- a/.Source/GTweak/Assets/UserControls/ToolsetCard.xaml
+++ b/.Source/GTweak/Assets/UserControls/ToolsetCard.xaml
@@ -25,14 +25,14 @@
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard Timeline.DesiredFrameRate="120">
- <ColorAnimation Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" To="{StaticResource Color_Border_Hover_CheckBox}" Duration="0:0:0.2"/>
+ <ColorAnimation Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" To="{StaticResource Color_Border_Hover_CheckBox}" Duration="0:0:0.05"/>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard Timeline.DesiredFrameRate="120">
- <ColorAnimation Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" To="{StaticResource Color_Separator}" Duration="0:0:0.1"/>
+ <ColorAnimation Storyboard.TargetProperty="(Border.BorderBrush).(SolidColorBrush.Color)" To="{StaticResource Color_Separator}" Duration="0:0:0.05"/>
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
diff --git a/.Source/GTweak/Core/ViewModel/ToolsetViewModel.cs b/.Source/GTweak/Core/ViewModel/ToolsetViewModel.cs
index cd56ade1..e90b5144 100644
--- a/.Source/GTweak/Core/ViewModel/ToolsetViewModel.cs
+++ b/.Source/GTweak/Core/ViewModel/ToolsetViewModel.cs
@@ -21,9 +21,9 @@ namespace GTweak.Core.ViewModel
private string _searchText;
public ICollectionView ToolsView { get; }
-
public ICommand SelectFolderCommand { get; }
public ICommand OpenFolderCommand { get; }
+ public ICommand ClearCommand { get; }
public string SearchText
{
@@ -43,6 +43,7 @@ namespace GTweak.Core.ViewModel
{
SelectFolderCommand = new RelayCommand(_ => SelectFolder());
OpenFolderCommand = new RelayCommand(_ => OpenFolder());
+ ClearCommand = new RelayCommand(obj => { SearchText = string.Empty; });
LoadApps();
diff --git a/.Source/GTweak/Styles/Buttons/Buttons.xaml b/.Source/GTweak/Styles/Buttons/Buttons.xaml
index 38792823..ba49cd0d 100644
--- a/.Source/GTweak/Styles/Buttons/Buttons.xaml
+++ b/.Source/GTweak/Styles/Buttons/Buttons.xaml
@@ -107,6 +107,32 @@
</Setter.Value>
</Setter>
</Style>
+
+ <Style x:Key="ButtonClearTextBox" TargetType="Button">
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="Button">
+ <Grid Background="Transparent" Cursor="Hand">
+ <Border x:Name="BackgroundBorder" Background="Transparent" CornerRadius="4"/>
+ <Border x:Name="Icon" Width="14" Height="14" Background="{StaticResource Brush_Inactive}"/>
+ </Grid>
+ <ControlTemplate.Triggers>
+ <Trigger Property="IsEnabled" Value="True">
+ <Setter TargetName="Icon" Property="OpacityMask">
+ <Setter.Value>
+ <ImageBrush ImageSource="{StaticResource Icon_Close}" />
+ </Setter.Value>
+ </Setter>
+ </Trigger>
+ <Trigger Property="IsMouseOver" Value="True">
+ <Setter TargetName="Icon" Property="Background" Value="{StaticResource Brush_Accent}"/>
+ <Setter TargetName="BackgroundBorder" Property="Background" Value="{StaticResource Brush_TitleBtnBG_Pressed}"/>
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
<Style x:Key="ButtonContent" TargetType="{x:Type Button}">
<Setter Property="Foreground" Value="{StaticResource Brush_Highlighted}"/>
diff --git a/.Source/GTweak/Styles/Inputs/TextBox.xaml b/.Source/GTweak/Styles/Inputs/TextBox.xaml
index f8fb28fb..3212ae1f 100644
--- a/.Source/GTweak/Styles/Inputs/TextBox.xaml
+++ b/.Source/GTweak/Styles/Inputs/TextBox.xaml
@@ -17,21 +17,26 @@
<Setter Property="Cursor" Value="IBeam" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="CaretBrush" Value="{StaticResource Brush_Highlighted}"/>
+ <Setter Property="SelectionBrush" Value="{StaticResource Brush_Accent}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Grid>
- <Border x:Name="border" Background="{StaticResource Brush_Background_TextBox}" BorderBrush="{StaticResource Brush_Accent}" BorderThickness="0,0,0,1" CornerRadius="5"/>
- <ScrollViewer x:Name="PART_ContentHost" Margin="5,0,0,0" VerticalAlignment="Center" />
- <Label Margin="5,0,5,0" x:Name="WaterMarkLabel" Content="{TemplateBinding Tag}" VerticalAlignment="Center" Visibility="Collapsed" Foreground="{StaticResource Brush_Inactive}" FontFamily="{StaticResource Jura}"/>
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition Width="*"/>
+ <ColumnDefinition Width="Auto"/>
+ </Grid.ColumnDefinitions>
+
+ <Border Grid.ColumnSpan="2" x:Name="border" Background="{StaticResource Brush_Background_TextBox}" BorderBrush="{StaticResource Brush_Accent}" BorderThickness="0,0,0,1" CornerRadius="5"/>
+ <ScrollViewer Grid.Column="0" x:Name="PART_ContentHost" Margin="5,0,0,0" VerticalAlignment="Center" />
+ <Label Grid.Column="0" Margin="5,0,5,0" x:Name="WaterMarkLabel" Content="{TemplateBinding Tag}" VerticalAlignment="Center" Visibility="Collapsed" Foreground="{StaticResource Brush_Inactive}" FontFamily="{StaticResource Jura}"/>
+ <Button Grid.Column="1" x:Name="PART_ClearButton" Command="{Binding DataContext.ClearCommand, RelativeSource={RelativeSource AncestorType=UserControl}}" Style="{StaticResource ButtonClearTextBox}" Width="20" Height="20" Margin="0,0,5,0" Visibility="Visible"/>
</Grid>
<ControlTemplate.Triggers>
- <MultiTrigger>
- <MultiTrigger.Conditions>
- <Condition Property="Text" Value=""/>
- </MultiTrigger.Conditions>
+ <Trigger Property="Text" Value="">
<Setter Property="Visibility" TargetName="WaterMarkLabel" Value="Visible"/>
- </MultiTrigger>
+ <Setter Property="Visibility" TargetName="PART_ClearButton" Value="Collapsed"/>
+ </Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Foreground" Value="{StaticResource Brush_Highlighted}"/>
<Setter Property="BorderBrush" Value="{StaticResource Brush_TextBox_Border}" TargetName="border"/>
@@ -49,5 +54,4 @@
</Setter.Value>
</Setter>
</Style>
-
</ResourceDictionary>
\ No newline at end of file
diff --git a/.Source/GTweak/View/ToolsetView.xaml b/.Source/GTweak/View/ToolsetView.xaml
index 9d656058..83916494 100644
--- a/.Source/GTweak/View/ToolsetView.xaml
+++ b/.Source/GTweak/View/ToolsetView.xaml
@@ -20,29 +20,32 @@
<uc:FlowPanel Grid.Row="0" HorizontalAlignment="Left" Margin="10,5,10,0" ContentAlignment="Left" Orientation="Horizontal" HorizontalSpacing="10" VerticalSpacing="5">
- <TextBox Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged, Delay=250}" Width="300" MaxLength="50" HorizontalAlignment="Left" Height="28">
+ <TextBox Text="{Binding SearchText, UpdateSourceTrigger=PropertyChanged, Delay=250}" Width="300" MaxLength="55" HorizontalAlignment="Left" Height="28">
<TextBox.Tag>
- <TextBlock>
- <Run Text="🔍"/> <Run Text="{DynamicResource text_ts}"/>
- </TextBlock>
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
+ <ui:SymbolIcon Symbol="Search20" FontSize="14" Margin="0,0,6,0" VerticalAlignment="Center"/>
+ <TextBlock VerticalAlignment="Center"><Run Text="{DynamicResource text_ts}"/><Run Text="..."/></TextBlock>
+ </StackPanel>
</TextBox.Tag>
</TextBox>
- <Button Command="{Binding SelectFolderCommand}" Style="{StaticResource ButtonContent}" HorizontalAlignment="Right">
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
- <ui:SymbolIcon Symbol="FolderOpen20" FontSize="15" Margin="0,0,5,0"/>
- <TextBlock VerticalAlignment="Center">
+ <StackPanel Orientation="Horizontal">
+ <Button Command="{Binding SelectFolderCommand}" Style="{StaticResource ButtonContent}" HorizontalAlignment="Left" Margin="0,0,10,0">
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
+ <ui:SymbolIcon Symbol="FolderOpen20" FontSize="15" Margin="0,0,5,0"/>
+ <TextBlock VerticalAlignment="Center">
<Run Text="{DynamicResource btn_select_dir}"/><Run Text="..."/>
- </TextBlock>
- </StackPanel>
- </Button>
+ </TextBlock>
+ </StackPanel>
+ </Button>
- <Button Command="{Binding OpenFolderCommand}" Style="{StaticResource ButtonContent}" HorizontalAlignment="Right">
- <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
- <ui:SymbolIcon Symbol="CloudArrowDown20" FontSize="15" Margin="0,0,5,0"/>
- <TextBlock VerticalAlignment="Center" Text="{DynamicResource btn_open_dir}"/>
- </StackPanel>
- </Button>
+ <Button Command="{Binding OpenFolderCommand}" Style="{StaticResource ButtonContent}" HorizontalAlignment="Right">
+ <StackPanel Orientation="Horizontal" VerticalAlignment="Center">
+ <ui:SymbolIcon Symbol="CloudArrowDown20" FontSize="15" Margin="0,0,5,0"/>
+ <TextBlock VerticalAlignment="Center" Text="{DynamicResource btn_open_dir}"/>
+ </StackPanel>
+ </Button>
+ </StackPanel>
</uc:FlowPanel>