Compare commits
19 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
e8525e8f55 | ||
|
|
f8d0ca9dd7 | ||
|
|
780f3fa038 | ||
|
|
6b758d4c95 | ||
|
|
ad68fade24 | ||
|
|
c5f4fe2d0e | ||
|
|
8760d96310 | ||
|
|
f3955b0ffc | ||
|
|
15a7f81a28 | ||
|
|
832f7f3012 | ||
|
|
3bd58af9d9 | ||
|
|
28689bbd16 | ||
|
|
1511aae219 | ||
|
|
84e89ec11c | ||
|
|
fb9258d339 | ||
|
|
8211200fcc | ||
|
|
b0fc1b4679 | ||
|
|
835ce2159b | ||
|
|
c35d687751 |
@@ -2,8 +2,8 @@
|
|||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
Title="About Taskbar Launcher"
|
Title="About Taskbar Launcher"
|
||||||
Height="410"
|
Height="430"
|
||||||
Width="560"
|
Width="580"
|
||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
WindowStartupLocation="CenterOwner"
|
WindowStartupLocation="CenterOwner"
|
||||||
Background="{DynamicResource AppWindowBrush}"
|
Background="{DynamicResource AppWindowBrush}"
|
||||||
@@ -15,6 +15,11 @@
|
|||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Border Background="{DynamicResource AppPanelBrush}"
|
||||||
|
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="16"
|
||||||
|
Padding="16">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="96"/>
|
<ColumnDefinition Width="96"/>
|
||||||
@@ -25,7 +30,8 @@
|
|||||||
Height="76"
|
Height="76"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
BorderBrush="{DynamicResource AppAccentBrush}"
|
BorderBrush="{DynamicResource AppAccentBrush}"
|
||||||
Background="{DynamicResource AppSurfaceBrush}"
|
Background="{DynamicResource AppOrangeSoftBrush}"
|
||||||
|
CornerRadius="14"
|
||||||
HorizontalAlignment="Left"
|
HorizontalAlignment="Left"
|
||||||
VerticalAlignment="Top">
|
VerticalAlignment="Top">
|
||||||
<Image Source="pack://application:,,,/Assets/AboutLogo.png"
|
<Image Source="pack://application:,,,/Assets/AboutLogo.png"
|
||||||
@@ -42,13 +48,15 @@
|
|||||||
TextWrapping="Wrap"/>
|
TextWrapping="Wrap"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
<Border Grid.Row="1"
|
<Border Grid.Row="1"
|
||||||
Margin="0,22,0,18"
|
Margin="0,22,0,18"
|
||||||
Padding="14"
|
Padding="14"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
BorderBrush="{DynamicResource AppBorderBrush}"
|
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||||
Background="{DynamicResource AppSurfaceBrush}">
|
Background="{DynamicResource AppSurfaceBrush}"
|
||||||
|
CornerRadius="14">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="120"/>
|
<ColumnDefinition Width="120"/>
|
||||||
@@ -89,6 +97,7 @@
|
|||||||
<Button Grid.Row="2"
|
<Button Grid.Row="2"
|
||||||
Content="Close"
|
Content="Close"
|
||||||
Click="Close_Click"
|
Click="Close_Click"
|
||||||
|
Padding="18,8"
|
||||||
HorizontalAlignment="Right"/>
|
HorizontalAlignment="Right"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
</Window>
|
</Window>
|
||||||
|
|||||||
164
App.xaml
164
App.xaml
@@ -5,8 +5,10 @@
|
|||||||
<Application.Resources>
|
<Application.Resources>
|
||||||
<Style TargetType="Button">
|
<Style TargetType="Button">
|
||||||
<Setter Property="Margin" Value="0,2"/>
|
<Setter Property="Margin" Value="0,2"/>
|
||||||
<Setter Property="Padding" Value="10,8"/>
|
<Setter Property="Padding" Value="12,8"/>
|
||||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
<Setter Property="MinHeight" Value="34"/>
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||||
<Setter Property="Background" Value="{DynamicResource AppControlBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource AppControlBrush}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderBrush}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderBrush}"/>
|
||||||
@@ -17,6 +19,7 @@
|
|||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
|
CornerRadius="10"
|
||||||
Padding="{TemplateBinding Padding}">
|
Padding="{TemplateBinding Padding}">
|
||||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||||
@@ -24,11 +27,11 @@
|
|||||||
</Border>
|
</Border>
|
||||||
<ControlTemplate.Triggers>
|
<ControlTemplate.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter TargetName="ButtonBorder" Property="Background" Value="{DynamicResource AppControlBrush}"/>
|
<Setter TargetName="ButtonBorder" Property="Background" Value="{DynamicResource AppControlHoverBrush}"/>
|
||||||
<Setter TargetName="ButtonBorder" Property="BorderBrush" Value="{DynamicResource AppAccentBrush}"/>
|
<Setter TargetName="ButtonBorder" Property="BorderBrush" Value="{DynamicResource AppAccentBrush}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsPressed" Value="True">
|
<Trigger Property="IsPressed" Value="True">
|
||||||
<Setter TargetName="ButtonBorder" Property="Background" Value="{DynamicResource AppSurfaceBrush}"/>
|
<Setter TargetName="ButtonBorder" Property="Background" Value="{DynamicResource AppAccentSoftBrush}"/>
|
||||||
<Setter TargetName="ButtonBorder" Property="BorderBrush" Value="{DynamicResource AppAccentBrush}"/>
|
<Setter TargetName="ButtonBorder" Property="BorderBrush" Value="{DynamicResource AppAccentBrush}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsEnabled" Value="False">
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
@@ -44,13 +47,42 @@
|
|||||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderBrush}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderBrush}"/>
|
||||||
<Setter Property="CaretBrush" Value="{DynamicResource AppAccentBrush}"/>
|
<Setter Property="CaretBrush" Value="{DynamicResource AppAccentBrush}"/>
|
||||||
|
<Setter Property="Padding" Value="9,6"/>
|
||||||
|
<Setter Property="MinHeight" Value="34"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="TextBox">
|
||||||
|
<Border x:Name="TextBoxBorder"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="10">
|
||||||
|
<ScrollViewer x:Name="PART_ContentHost"
|
||||||
|
Margin="{TemplateBinding Padding}"/>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter TargetName="TextBoxBorder" Property="Background" Value="{DynamicResource AppPanelBrush}"/>
|
||||||
|
<Setter TargetName="TextBoxBorder" Property="BorderBrush" Value="{DynamicResource AppAccentBrush}"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsKeyboardFocused" Value="True">
|
||||||
|
<Setter TargetName="TextBoxBorder" Property="Background" Value="{DynamicResource AppSurfaceBrush}"/>
|
||||||
|
<Setter TargetName="TextBoxBorder" Property="BorderBrush" Value="{DynamicResource AppAccentBrush}"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
|
<Setter Property="Opacity" Value="0.55"/>
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
<Style TargetType="ComboBox">
|
<Style TargetType="ComboBox">
|
||||||
<Setter Property="Background" Value="{DynamicResource AppSurfaceBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource AppSurfaceBrush}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderBrush}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderBrush}"/>
|
||||||
<Setter Property="Padding" Value="6,4"/>
|
<Setter Property="Padding" Value="9,6"/>
|
||||||
<Setter Property="MinHeight" Value="28"/>
|
<Setter Property="MinHeight" Value="34"/>
|
||||||
<Setter Property="Template">
|
<Setter Property="Template">
|
||||||
<Setter.Value>
|
<Setter.Value>
|
||||||
<ControlTemplate TargetType="ComboBox">
|
<ControlTemplate TargetType="ComboBox">
|
||||||
@@ -66,20 +98,21 @@
|
|||||||
<Border x:Name="ComboToggleBorder"
|
<Border x:Name="ComboToggleBorder"
|
||||||
Background="{TemplateBinding Background}"
|
Background="{TemplateBinding Background}"
|
||||||
BorderBrush="{TemplateBinding BorderBrush}"
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
BorderThickness="1">
|
BorderThickness="1"
|
||||||
|
CornerRadius="10">
|
||||||
<ContentPresenter/>
|
<ContentPresenter/>
|
||||||
</Border>
|
</Border>
|
||||||
<ControlTemplate.Triggers>
|
<ControlTemplate.Triggers>
|
||||||
<Trigger Property="IsMouseOver" Value="True">
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
<Setter TargetName="ComboToggleBorder" Property="Background" Value="{DynamicResource AppSurfaceBrush}"/>
|
<Setter TargetName="ComboToggleBorder" Property="Background" Value="{DynamicResource AppPanelBrush}"/>
|
||||||
<Setter TargetName="ComboToggleBorder" Property="BorderBrush" Value="{DynamicResource AppAccentBrush}"/>
|
<Setter TargetName="ComboToggleBorder" Property="BorderBrush" Value="{DynamicResource AppAccentBrush}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsPressed" Value="True">
|
<Trigger Property="IsPressed" Value="True">
|
||||||
<Setter TargetName="ComboToggleBorder" Property="Background" Value="{DynamicResource AppSurfaceBrush}"/>
|
<Setter TargetName="ComboToggleBorder" Property="Background" Value="{DynamicResource AppAccentSoftBrush}"/>
|
||||||
<Setter TargetName="ComboToggleBorder" Property="BorderBrush" Value="{DynamicResource AppAccentBrush}"/>
|
<Setter TargetName="ComboToggleBorder" Property="BorderBrush" Value="{DynamicResource AppAccentBrush}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsChecked" Value="True">
|
<Trigger Property="IsChecked" Value="True">
|
||||||
<Setter TargetName="ComboToggleBorder" Property="Background" Value="{DynamicResource AppSurfaceBrush}"/>
|
<Setter TargetName="ComboToggleBorder" Property="Background" Value="{DynamicResource AppAccentSoftBrush}"/>
|
||||||
<Setter TargetName="ComboToggleBorder" Property="BorderBrush" Value="{DynamicResource AppAccentBrush}"/>
|
<Setter TargetName="ComboToggleBorder" Property="BorderBrush" Value="{DynamicResource AppAccentBrush}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</ControlTemplate.Triggers>
|
</ControlTemplate.Triggers>
|
||||||
@@ -114,6 +147,8 @@
|
|||||||
<Border Background="{DynamicResource AppSurfaceBrush}"
|
<Border Background="{DynamicResource AppSurfaceBrush}"
|
||||||
BorderBrush="{DynamicResource AppBorderBrush}"
|
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
|
CornerRadius="10"
|
||||||
|
Padding="3"
|
||||||
MinWidth="{TemplateBinding ActualWidth}"
|
MinWidth="{TemplateBinding ActualWidth}"
|
||||||
MaxHeight="{TemplateBinding MaxDropDownHeight}">
|
MaxHeight="{TemplateBinding MaxDropDownHeight}">
|
||||||
<ScrollViewer>
|
<ScrollViewer>
|
||||||
@@ -127,11 +162,11 @@
|
|||||||
<Setter Property="Opacity" Value="0.55"/>
|
<Setter Property="Opacity" Value="0.55"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger SourceName="ToggleButton" Property="IsMouseOver" Value="True">
|
<Trigger SourceName="ToggleButton" Property="IsMouseOver" Value="True">
|
||||||
<Setter TargetName="ToggleButton" Property="Background" Value="{DynamicResource AppSurfaceBrush}"/>
|
<Setter TargetName="ToggleButton" Property="Background" Value="{DynamicResource AppPanelBrush}"/>
|
||||||
<Setter TargetName="ToggleButton" Property="BorderBrush" Value="{DynamicResource AppAccentBrush}"/>
|
<Setter TargetName="ToggleButton" Property="BorderBrush" Value="{DynamicResource AppAccentBrush}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger SourceName="ToggleButton" Property="IsPressed" Value="True">
|
<Trigger SourceName="ToggleButton" Property="IsPressed" Value="True">
|
||||||
<Setter TargetName="ToggleButton" Property="Background" Value="{DynamicResource AppSurfaceBrush}"/>
|
<Setter TargetName="ToggleButton" Property="Background" Value="{DynamicResource AppAccentSoftBrush}"/>
|
||||||
<Setter TargetName="ToggleButton" Property="BorderBrush" Value="{DynamicResource AppAccentBrush}"/>
|
<Setter TargetName="ToggleButton" Property="BorderBrush" Value="{DynamicResource AppAccentBrush}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</ControlTemplate.Triggers>
|
</ControlTemplate.Triggers>
|
||||||
@@ -142,21 +177,24 @@
|
|||||||
<Style TargetType="ComboBoxItem">
|
<Style TargetType="ComboBoxItem">
|
||||||
<Setter Property="Background" Value="{DynamicResource AppSurfaceBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource AppSurfaceBrush}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||||
<Setter Property="Padding" Value="6,4"/>
|
<Setter Property="Padding" Value="9,7"/>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="IsHighlighted" Value="True">
|
<Trigger Property="IsHighlighted" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource AppAccentBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource AppAccentSoftBrush}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource AppSelectedTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<Trigger Property="IsSelected" Value="True">
|
<Trigger Property="IsSelected" Value="True">
|
||||||
<Setter Property="Background" Value="{DynamicResource AppAccentBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource AppAccentSoftBrush}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource AppSelectedTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
<Style TargetType="TreeView">
|
<Style TargetType="TreeView">
|
||||||
<Setter Property="Background" Value="{DynamicResource AppSurfaceBrush}"/>
|
<Setter Property="Background" Value="{DynamicResource AppSurfaceBrush}"/>
|
||||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderBrush}"/>
|
||||||
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
|
<Setter Property="Padding" Value="8"/>
|
||||||
</Style>
|
</Style>
|
||||||
<Style TargetType="TreeViewItem">
|
<Style TargetType="TreeViewItem">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||||
@@ -168,12 +206,104 @@
|
|||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
<Style TargetType="ContextMenu">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource AppSurfaceBrush}"/>
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderBrush}"/>
|
||||||
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
|
<Setter Property="Padding" Value="2"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="ContextMenu">
|
||||||
|
<Border Background="{TemplateBinding Background}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="{TemplateBinding BorderThickness}"
|
||||||
|
CornerRadius="10"
|
||||||
|
Padding="{TemplateBinding Padding}">
|
||||||
|
<ItemsPresenter/>
|
||||||
|
</Border>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="MenuItem">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource AppSurfaceBrush}"/>
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||||
|
<Setter Property="Padding" Value="12,8"/>
|
||||||
|
<Setter Property="MinWidth" Value="190"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="MenuItem">
|
||||||
|
<Border x:Name="MenuItemBorder"
|
||||||
|
Background="{TemplateBinding Background}"
|
||||||
|
Padding="{TemplateBinding Padding}"
|
||||||
|
CornerRadius="8">
|
||||||
|
<ContentPresenter ContentSource="Header"
|
||||||
|
RecognizesAccessKey="True"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsHighlighted" Value="True">
|
||||||
|
<Setter TargetName="MenuItemBorder" Property="Background" Value="{DynamicResource AppAccentSoftBrush}"/>
|
||||||
|
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
|
<Setter Property="Opacity" Value="0.55"/>
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
|
<Style TargetType="Separator">
|
||||||
|
<Setter Property="Margin" Value="6,4"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="Separator">
|
||||||
|
<Border Height="1" Background="{DynamicResource AppBorderBrush}"/>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
</Style>
|
||||||
<Style TargetType="GroupBox">
|
<Style TargetType="GroupBox">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||||
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderBrush}"/>
|
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderBrush}"/>
|
||||||
|
<Setter Property="Padding" Value="12"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="GroupBox">
|
||||||
|
<Grid>
|
||||||
|
<Grid.RowDefinitions>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="*"/>
|
||||||
|
</Grid.RowDefinitions>
|
||||||
|
<Border Grid.Row="1"
|
||||||
|
Margin="0,8,0,0"
|
||||||
|
Background="{DynamicResource AppSurfaceBrush}"
|
||||||
|
BorderBrush="{TemplateBinding BorderBrush}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="14"
|
||||||
|
Padding="{TemplateBinding Padding}">
|
||||||
|
<ContentPresenter/>
|
||||||
|
</Border>
|
||||||
|
<Border Grid.Row="0"
|
||||||
|
HorizontalAlignment="Left"
|
||||||
|
Background="{DynamicResource AppOrangeSoftBrush}"
|
||||||
|
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="999"
|
||||||
|
Padding="10,4">
|
||||||
|
<ContentPresenter ContentSource="Header"
|
||||||
|
RecognizesAccessKey="True"/>
|
||||||
|
</Border>
|
||||||
|
</Grid>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
<Style TargetType="CheckBox">
|
<Style TargetType="CheckBox">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||||
</Style>
|
</Style>
|
||||||
<Style TargetType="Expander">
|
<Style TargetType="Expander">
|
||||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||||
|
|||||||
@@ -10,7 +10,6 @@ public partial class App : System.Windows.Application
|
|||||||
{
|
{
|
||||||
base.OnStartup(e);
|
base.OnStartup(e);
|
||||||
|
|
||||||
ThemeService.Apply();
|
|
||||||
controller = new LauncherController();
|
controller = new LauncherController();
|
||||||
controller.Start();
|
controller.Start();
|
||||||
|
|
||||||
|
|||||||
BIN
Assets/HeaderLogo.png
Normal file
BIN
Assets/HeaderLogo.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 102 KiB |
128
MainWindow.xaml
128
MainWindow.xaml
@@ -4,30 +4,77 @@
|
|||||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
Title="Taskbar Launcher Settings" Height="700" Width="940"
|
Title="Taskbar Launcher Settings" Height="740" Width="980"
|
||||||
MinHeight="620" MinWidth="820"
|
MinHeight="660" MinWidth="860"
|
||||||
Background="{DynamicResource AppWindowBrush}"
|
Background="{DynamicResource AppWindowBrush}"
|
||||||
Foreground="{DynamicResource AppTextBrush}">
|
Foreground="{DynamicResource AppTextBrush}">
|
||||||
<DockPanel Margin="18">
|
<DockPanel Margin="18">
|
||||||
<StackPanel DockPanel.Dock="Top" Margin="0,0,0,14">
|
<Border DockPanel.Dock="Top"
|
||||||
<TextBlock Text="Taskbar Launcher" FontSize="22" FontWeight="SemiBold"/>
|
Margin="0,0,0,16"
|
||||||
<TextBlock x:Name="VersionText"
|
Padding="16,14"
|
||||||
Foreground="{DynamicResource AppMutedTextBrush}"/>
|
Background="{DynamicResource AppPanelBrush}"
|
||||||
<TextBlock Text="Portable launcher settings are stored beside the app in config.json."
|
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||||
Foreground="{DynamicResource AppMutedTextBrush}"/>
|
BorderThickness="1"
|
||||||
</StackPanel>
|
CornerRadius="16">
|
||||||
|
<Grid>
|
||||||
|
<Grid.ColumnDefinitions>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Border Width="56"
|
||||||
|
Height="56"
|
||||||
|
Margin="0,0,12,0"
|
||||||
|
Background="{DynamicResource AppOrangeSoftBrush}"
|
||||||
|
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="14">
|
||||||
|
<Image Source="pack://application:,,,/Assets/HeaderLogo.png"
|
||||||
|
Width="48"
|
||||||
|
Height="48"
|
||||||
|
Stretch="Uniform"/>
|
||||||
|
</Border>
|
||||||
|
<StackPanel Grid.Column="1" VerticalAlignment="Center">
|
||||||
|
<TextBlock Text="Taskbar Launcher" FontSize="23" FontWeight="SemiBold"/>
|
||||||
|
<TextBlock x:Name="VersionText"
|
||||||
|
Margin="0,2,0,0"
|
||||||
|
Foreground="{DynamicResource AppMutedTextBrush}"/>
|
||||||
|
<TextBlock Text="Portable launcher settings are stored beside the app in config.json."
|
||||||
|
Margin="0,2,0,0"
|
||||||
|
Foreground="{DynamicResource AppMutedTextBrush}"/>
|
||||||
|
</StackPanel>
|
||||||
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
<Border DockPanel.Dock="Bottom" BorderThickness="1,0,0,0" Padding="0,12,0,0"
|
<Border DockPanel.Dock="Bottom"
|
||||||
BorderBrush="{DynamicResource AppBorderBrush}">
|
Margin="0,16,0,0"
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
Padding="12"
|
||||||
|
Background="{DynamicResource AppPanelBrush}"
|
||||||
|
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="14">
|
||||||
|
<WrapPanel HorizontalAlignment="Right">
|
||||||
<Button Content="Save" Click="Save_Click" Margin="0,0,8,0"/>
|
<Button Content="Save" Click="Save_Click" Margin="0,0,8,0"/>
|
||||||
<Button Content="Backup Config" Click="BackupConfig_Click" Margin="0,0,8,0"/>
|
<Button x:Name="ConfigMenuButton"
|
||||||
<Button Content="Restore Config" Click="RestoreConfig_Click" Margin="0,0,8,0"/>
|
Content="Config..."
|
||||||
<Button Content="Reload Config" Click="ReloadConfig_Click" Margin="0,0,8,0"/>
|
Click="ConfigMenuButton_Click"
|
||||||
<Button Content="Open Config Folder" Click="OpenConfigFolder_Click" Margin="0,0,8,0"/>
|
Margin="0,0,8,0">
|
||||||
|
<Button.ContextMenu>
|
||||||
|
<ContextMenu>
|
||||||
|
<MenuItem Header="Backup Config" Click="BackupConfig_Click"/>
|
||||||
|
<MenuItem Header="Restore from Backup" Click="RestoreConfig_Click"/>
|
||||||
|
<Separator/>
|
||||||
|
<MenuItem Header="Export Config" Click="ExportConfig_Click"/>
|
||||||
|
<MenuItem Header="Import Config" Click="ImportConfig_Click"/>
|
||||||
|
<Separator/>
|
||||||
|
<MenuItem Header="Reset to Defaults" Click="ResetConfig_Click"/>
|
||||||
|
<MenuItem Header="Reload Config" Click="ReloadConfig_Click"/>
|
||||||
|
<MenuItem Header="Open Config Folder" Click="OpenConfigFolder_Click"/>
|
||||||
|
</ContextMenu>
|
||||||
|
</Button.ContextMenu>
|
||||||
|
</Button>
|
||||||
<Button Content="About" Click="About_Click" Margin="0,0,8,0"/>
|
<Button Content="About" Click="About_Click" Margin="0,0,8,0"/>
|
||||||
<Button Content="Close" Click="Close_Click"/>
|
<Button Content="Close" Click="Close_Click"/>
|
||||||
</StackPanel>
|
</WrapPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|
||||||
<Grid>
|
<Grid>
|
||||||
@@ -36,9 +83,9 @@
|
|||||||
<ColumnDefinition Width="3*"/>
|
<ColumnDefinition Width="3*"/>
|
||||||
</Grid.ColumnDefinitions>
|
</Grid.ColumnDefinitions>
|
||||||
|
|
||||||
<GroupBox Header="Launcher Items" Margin="0,0,12,0">
|
<GroupBox Header="Launcher Items" Margin="0,0,14,0">
|
||||||
<DockPanel Margin="8">
|
<DockPanel>
|
||||||
<UniformGrid DockPanel.Dock="Bottom" Columns="2" Margin="0,8,0,0">
|
<UniformGrid DockPanel.Dock="Bottom" Columns="2" Margin="0,10,0,0">
|
||||||
<Button Content="Add Root" Click="AddRoot_Click"/>
|
<Button Content="Add Root" Click="AddRoot_Click"/>
|
||||||
<Button Content="Add Top Menu" Click="AddTopMenu_Click"/>
|
<Button Content="Add Top Menu" Click="AddTopMenu_Click"/>
|
||||||
<Button Content="Add Child" Click="AddChild_Click"/>
|
<Button Content="Add Child" Click="AddChild_Click"/>
|
||||||
@@ -51,6 +98,7 @@
|
|||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
<TreeView x:Name="ItemsTree"
|
<TreeView x:Name="ItemsTree"
|
||||||
AllowDrop="True"
|
AllowDrop="True"
|
||||||
|
Margin="0"
|
||||||
SelectedItemChanged="ItemsTree_SelectedItemChanged"
|
SelectedItemChanged="ItemsTree_SelectedItemChanged"
|
||||||
PreviewMouseMove="ItemsTree_PreviewMouseMove"
|
PreviewMouseMove="ItemsTree_PreviewMouseMove"
|
||||||
DragOver="ItemsTree_DragOver"
|
DragOver="ItemsTree_DragOver"
|
||||||
@@ -59,7 +107,7 @@
|
|||||||
</GroupBox>
|
</GroupBox>
|
||||||
|
|
||||||
<GroupBox Header="Settings" Grid.Column="1">
|
<GroupBox Header="Settings" Grid.Column="1">
|
||||||
<Grid Margin="12">
|
<Grid>
|
||||||
<Grid.RowDefinitions>
|
<Grid.RowDefinitions>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="16"/>
|
<RowDefinition Height="16"/>
|
||||||
@@ -67,6 +115,11 @@
|
|||||||
<RowDefinition Height="*"/>
|
<RowDefinition Height="*"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
|
<Border Background="{DynamicResource AppPanelBrush}"
|
||||||
|
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="12"
|
||||||
|
Padding="12">
|
||||||
<Grid>
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="110"/>
|
<ColumnDefinition Width="110"/>
|
||||||
@@ -76,25 +129,38 @@
|
|||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
<RowDefinition Height="Auto"/>
|
<RowDefinition Height="Auto"/>
|
||||||
|
<RowDefinition Height="Auto"/>
|
||||||
</Grid.RowDefinitions>
|
</Grid.RowDefinitions>
|
||||||
|
|
||||||
<TextBlock Text="Hotkey" VerticalAlignment="Center" Margin="0,0,8,8"/>
|
<TextBlock Text="Hotkey" VerticalAlignment="Center" Margin="0,0,8,8"/>
|
||||||
<TextBox x:Name="HotkeyBox" Grid.Column="1" Margin="0,0,0,8"/>
|
<TextBox x:Name="HotkeyBox" Grid.Column="1" Margin="0,0,0,8"
|
||||||
|
PreviewKeyDown="HotkeyBox_PreviewKeyDown"/>
|
||||||
|
|
||||||
<TextBlock Text="Default for New Items" Grid.Row="1" VerticalAlignment="Center" Margin="0,0,8,0"/>
|
<TextBlock Text="Default for New Items" Grid.Row="1" VerticalAlignment="Center" Margin="0,0,8,0"/>
|
||||||
<ComboBox x:Name="DisplayModeBox" Grid.Row="1" Grid.Column="1"/>
|
<ComboBox x:Name="DisplayModeBox" Grid.Row="1" Grid.Column="1" Margin="0,0,0,8"/>
|
||||||
|
|
||||||
<TextBlock Text="Startup" Grid.Row="2" VerticalAlignment="Center" Margin="0,8,8,0"/>
|
<TextBlock Text="Color Scheme" Grid.Row="2" VerticalAlignment="Center" Margin="0,0,8,8"/>
|
||||||
<CheckBox x:Name="StartWithWindowsBox" Grid.Row="2" Grid.Column="1"
|
<ComboBox x:Name="ThemeSchemeBox" Grid.Row="2" Grid.Column="1" Margin="0,0,0,8"
|
||||||
|
SelectionChanged="ThemeSchemeBox_SelectionChanged"/>
|
||||||
|
|
||||||
|
<TextBlock Text="Startup" Grid.Row="3" VerticalAlignment="Center" Margin="0,8,8,0"/>
|
||||||
|
<CheckBox x:Name="StartWithWindowsBox" Grid.Row="3" Grid.Column="1"
|
||||||
Content="Start with Windows"
|
Content="Start with Windows"
|
||||||
Margin="0,8,0,0"
|
Margin="0,8,0,0"
|
||||||
Checked="StartWithWindowsBox_Changed"
|
Checked="StartWithWindowsBox_Changed"
|
||||||
Unchecked="StartWithWindowsBox_Changed"/>
|
Unchecked="StartWithWindowsBox_Changed"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
<Separator Grid.Row="1" VerticalAlignment="Center"/>
|
<Separator Grid.Row="1" VerticalAlignment="Center"/>
|
||||||
|
|
||||||
<Grid Grid.Row="2">
|
<Border Grid.Row="2"
|
||||||
|
Background="{DynamicResource AppPanelBrush}"
|
||||||
|
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||||
|
BorderThickness="1"
|
||||||
|
CornerRadius="12"
|
||||||
|
Padding="12">
|
||||||
|
<Grid>
|
||||||
<Grid.ColumnDefinitions>
|
<Grid.ColumnDefinitions>
|
||||||
<ColumnDefinition Width="110"/>
|
<ColumnDefinition Width="110"/>
|
||||||
<ColumnDefinition Width="*"/>
|
<ColumnDefinition Width="*"/>
|
||||||
@@ -140,14 +206,15 @@
|
|||||||
|
|
||||||
<TextBlock Text="Selected Item Display" Grid.Row="5" VerticalAlignment="Center" Margin="0,0,8,8"/>
|
<TextBlock Text="Selected Item Display" Grid.Row="5" VerticalAlignment="Center" Margin="0,0,8,8"/>
|
||||||
<ComboBox x:Name="ItemDisplayModeBox" Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2"
|
<ComboBox x:Name="ItemDisplayModeBox" Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
Margin="0,0,0,8" SelectionChanged="PreviewField_Changed"/>
|
Margin="0,0,0,8" SelectionChanged="ItemDisplayModeBox_SelectionChanged"/>
|
||||||
|
|
||||||
<TextBlock Text="Preview" Grid.Row="6" VerticalAlignment="Top" Margin="0,4,8,0"/>
|
<TextBlock Text="Preview" Grid.Row="6" VerticalAlignment="Top" Margin="0,4,8,0"/>
|
||||||
<Border Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="2"
|
<Border Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="2"
|
||||||
BorderThickness="1"
|
BorderThickness="1"
|
||||||
BorderBrush="{DynamicResource AppBorderBrush}"
|
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||||
Background="{DynamicResource AppControlBrush}"
|
Background="{DynamicResource AppSurfaceBrush}"
|
||||||
Padding="8" MinHeight="72">
|
CornerRadius="12"
|
||||||
|
Padding="10" MinHeight="76">
|
||||||
<StackPanel>
|
<StackPanel>
|
||||||
<ContentControl x:Name="PreviewHost"/>
|
<ContentControl x:Name="PreviewHost"/>
|
||||||
<TextBlock x:Name="PreviewNote" Margin="0,8,0,0"
|
<TextBlock x:Name="PreviewNote" Margin="0,8,0,0"
|
||||||
@@ -156,8 +223,9 @@
|
|||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
</Border>
|
||||||
|
|
||||||
<TextBlock x:Name="StatusText" Grid.Row="3" Margin="0,14,0,0"
|
<TextBlock x:Name="StatusText" Grid.Row="3" Margin="4,14,4,0"
|
||||||
Foreground="{DynamicResource AppMutedTextBrush}"
|
Foreground="{DynamicResource AppMutedTextBrush}"
|
||||||
TextWrapping="Wrap"/>
|
TextWrapping="Wrap"/>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ public partial class MainWindow : Window
|
|||||||
this.controller = controller;
|
this.controller = controller;
|
||||||
DisplayModeBox.ItemsSource = Enum.GetValues<LauncherDisplayMode>();
|
DisplayModeBox.ItemsSource = Enum.GetValues<LauncherDisplayMode>();
|
||||||
ItemDisplayModeBox.ItemsSource = Enum.GetValues<LauncherDisplayMode>();
|
ItemDisplayModeBox.ItemsSource = Enum.GetValues<LauncherDisplayMode>();
|
||||||
|
ThemeSchemeBox.ItemsSource = Enum.GetValues<LauncherThemeScheme>();
|
||||||
TypeBox.ItemsSource = Enum.GetValues<LauncherItemType>();
|
TypeBox.ItemsSource = Enum.GetValues<LauncherItemType>();
|
||||||
VersionText.Text = $"Version {AppInfo.Version} Build {AppInfo.Build}";
|
VersionText.Text = $"Version {AppInfo.Version} Build {AppInfo.Build}";
|
||||||
RefreshView();
|
RefreshView();
|
||||||
@@ -53,6 +54,7 @@ public partial class MainWindow : Window
|
|||||||
|
|
||||||
HotkeyBox.Text = controller.Config.Hotkey;
|
HotkeyBox.Text = controller.Config.Hotkey;
|
||||||
DisplayModeBox.SelectedItem = controller.Config.DisplayMode;
|
DisplayModeBox.SelectedItem = controller.Config.DisplayMode;
|
||||||
|
ThemeSchemeBox.SelectedItem = controller.Config.ThemeScheme;
|
||||||
LoadStartupState();
|
LoadStartupState();
|
||||||
StatusText.Text = "Config file: config.json beside TaskbarLauncher.exe";
|
StatusText.Text = "Config file: config.json beside TaskbarLauncher.exe";
|
||||||
if (itemToSelect is not null && SelectTreeItem(itemToSelect))
|
if (itemToSelect is not null && SelectTreeItem(itemToSelect))
|
||||||
@@ -114,6 +116,11 @@ public partial class MainWindow : Window
|
|||||||
|
|
||||||
private void ItemsTree_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
|
private void ItemsTree_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs<object> e)
|
||||||
{
|
{
|
||||||
|
if (!isLoadingSelection && selectedItem is not null)
|
||||||
|
{
|
||||||
|
ApplyCurrentItem();
|
||||||
|
}
|
||||||
|
|
||||||
if (e.NewValue is not TreeViewItem treeItem || treeItem.Tag is not LauncherItem item)
|
if (e.NewValue is not TreeViewItem treeItem || treeItem.Tag is not LauncherItem item)
|
||||||
{
|
{
|
||||||
selectedItem = null;
|
selectedItem = null;
|
||||||
@@ -295,9 +302,10 @@ public partial class MainWindow : Window
|
|||||||
: ArgumentsBox.Text.Trim();
|
: ArgumentsBox.Text.Trim();
|
||||||
EnsureAutomaticIconPath();
|
EnsureAutomaticIconPath();
|
||||||
selectedItem.IconPath = string.IsNullOrWhiteSpace(IconPathBox.Text) ? null : IconPathBox.Text.Trim();
|
selectedItem.IconPath = string.IsNullOrWhiteSpace(IconPathBox.Text) ? null : IconPathBox.Text.Trim();
|
||||||
selectedItem.DisplayMode = ItemDisplayModeBox.SelectedItem is LauncherDisplayMode itemMode
|
if (ItemDisplayModeBox.SelectedItem is LauncherDisplayMode itemMode)
|
||||||
? itemMode
|
{
|
||||||
: controller?.Config.DisplayMode ?? LauncherDisplayMode.LargeIconWithText;
|
selectedItem.DisplayMode = itemMode;
|
||||||
|
}
|
||||||
|
|
||||||
if (selectedItem.Type != LauncherItemType.Menu)
|
if (selectedItem.Type != LauncherItemType.Menu)
|
||||||
{
|
{
|
||||||
@@ -312,13 +320,81 @@ public partial class MainWindow : Window
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
controller.Config.Hotkey = string.IsNullOrWhiteSpace(HotkeyBox.Text) ? "Ctrl+Alt+Space" : HotkeyBox.Text.Trim();
|
controller.Config.Hotkey = string.IsNullOrWhiteSpace(HotkeyBox.Text)
|
||||||
|
? "Ctrl+Alt+Space"
|
||||||
|
: HotkeyService.Normalize(HotkeyBox.Text.Trim());
|
||||||
controller.Config.DisplayMode = DisplayModeBox.SelectedItem is LauncherDisplayMode mode
|
controller.Config.DisplayMode = DisplayModeBox.SelectedItem is LauncherDisplayMode mode
|
||||||
? mode
|
? mode
|
||||||
: LauncherDisplayMode.LargeIconWithText;
|
: LauncherDisplayMode.CompactList;
|
||||||
|
controller.Config.ThemeScheme = ThemeSchemeBox.SelectedItem is LauncherThemeScheme scheme
|
||||||
|
? scheme
|
||||||
|
: LauncherThemeScheme.MarkHaven;
|
||||||
ApplyCurrentItem();
|
ApplyCurrentItem();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void HotkeyBox_PreviewKeyDown(object sender, System.Windows.Input.KeyEventArgs e)
|
||||||
|
{
|
||||||
|
Key key = e.Key == Key.System ? e.SystemKey : e.Key;
|
||||||
|
if (key == Key.ImeProcessed)
|
||||||
|
{
|
||||||
|
key = e.ImeProcessedKey;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key is Key.LeftCtrl or Key.RightCtrl or Key.LeftAlt or Key.RightAlt or Key.LeftShift or Key.RightShift
|
||||||
|
or Key.LWin or Key.RWin)
|
||||||
|
{
|
||||||
|
e.Handled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key is Key.Back or Key.Delete or Key.Escape)
|
||||||
|
{
|
||||||
|
HotkeyBox.Text = "";
|
||||||
|
e.Handled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ModifierKeys modifiers = Keyboard.Modifiers;
|
||||||
|
if (modifiers == ModifierKeys.None)
|
||||||
|
{
|
||||||
|
StatusText.Text = "Press a hotkey with Ctrl, Alt, Shift, or Win plus another key.";
|
||||||
|
e.Handled = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
HotkeyBox.Text = FormatHotkey(modifiers, key);
|
||||||
|
HotkeyBox.CaretIndex = HotkeyBox.Text.Length;
|
||||||
|
StatusText.Text = "Click Save to apply the new hotkey.";
|
||||||
|
e.Handled = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static string FormatHotkey(ModifierKeys modifiers, Key key)
|
||||||
|
{
|
||||||
|
List<string> parts = [];
|
||||||
|
if (modifiers.HasFlag(ModifierKeys.Control))
|
||||||
|
{
|
||||||
|
parts.Add("Ctrl");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (modifiers.HasFlag(ModifierKeys.Alt))
|
||||||
|
{
|
||||||
|
parts.Add("Alt");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (modifiers.HasFlag(ModifierKeys.Shift))
|
||||||
|
{
|
||||||
|
parts.Add("Shift");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (modifiers.HasFlag(ModifierKeys.Windows))
|
||||||
|
{
|
||||||
|
parts.Add("Win");
|
||||||
|
}
|
||||||
|
|
||||||
|
parts.Add(key.ToString());
|
||||||
|
return string.Join("+", parts);
|
||||||
|
}
|
||||||
|
|
||||||
private void LoadStartupState()
|
private void LoadStartupState()
|
||||||
{
|
{
|
||||||
isLoadingStartupState = true;
|
isLoadingStartupState = true;
|
||||||
@@ -569,9 +645,24 @@ public partial class MainWindow : Window
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
ApplyConfigFields();
|
string previousHotkey = controller.Config.Hotkey;
|
||||||
ConfigService.Save(controller.Config);
|
try
|
||||||
controller.ReloadConfig();
|
{
|
||||||
|
ApplyConfigFields();
|
||||||
|
ConfigService.Save(controller.Config);
|
||||||
|
controller.ReloadConfig();
|
||||||
|
}
|
||||||
|
catch (Exception ex) when (ex is FormatException or InvalidOperationException)
|
||||||
|
{
|
||||||
|
controller.Config.Hotkey = previousHotkey;
|
||||||
|
ConfigService.Save(controller.Config);
|
||||||
|
controller.ReloadConfig();
|
||||||
|
HotkeyBox.Text = previousHotkey;
|
||||||
|
MessageBox.Show($"Could not apply hotkey.\n\n{ex.Message}", "Taskbar Launcher");
|
||||||
|
StatusText.Text = $"Hotkey was not changed. Current hotkey: {previousHotkey}";
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
LauncherItem? reloadedSelection = selectedPath is null ? null : FindItemByPath(controller.Config.Items, selectedPath);
|
LauncherItem? reloadedSelection = selectedPath is null ? null : FindItemByPath(controller.Config.Items, selectedPath);
|
||||||
RefreshView(reloadedSelection);
|
RefreshView(reloadedSelection);
|
||||||
StatusText.Text = reloadedSelection is null
|
StatusText.Text = reloadedSelection is null
|
||||||
@@ -636,6 +727,115 @@ public partial class MainWindow : Window
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ConfigMenuButton_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (ConfigMenuButton.ContextMenu is null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ConfigMenuButton.ContextMenu.PlacementTarget = ConfigMenuButton;
|
||||||
|
ConfigMenuButton.ContextMenu.IsOpen = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ExportConfig_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
if (controller is null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ApplyConfigFields();
|
||||||
|
using SaveFileDialog dialog = new()
|
||||||
|
{
|
||||||
|
Title = "Export launcher config",
|
||||||
|
Filter = "JSON config files|*.json|All files|*.*",
|
||||||
|
FileName = $"TaskbarLauncher-config-{DateTime.Now:yyyyMMdd-HHmmss}.json",
|
||||||
|
InitialDirectory = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)
|
||||||
|
};
|
||||||
|
|
||||||
|
if (dialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string exportPath = ConfigService.ExportTo(dialog.FileName, controller.Config);
|
||||||
|
StatusText.Text = $"Exported config to {exportPath}";
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"Could not export config.\n\n{ex.Message}", "Taskbar Launcher");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ImportConfig_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
using OpenFileDialog dialog = new()
|
||||||
|
{
|
||||||
|
Title = "Import launcher config",
|
||||||
|
Filter = "JSON config files|*.json|All files|*.*",
|
||||||
|
InitialDirectory = Directory.Exists(ConfigService.BackupFolder) ? ConfigService.BackupFolder : ConfigService.AppFolder
|
||||||
|
};
|
||||||
|
|
||||||
|
if (dialog.ShowDialog() != System.Windows.Forms.DialogResult.OK)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
MessageBoxResult result = MessageBox.Show(
|
||||||
|
"Import this config file and replace the current launcher config?\n\nA local backup will be created first.",
|
||||||
|
"Taskbar Launcher",
|
||||||
|
MessageBoxButton.YesNo,
|
||||||
|
MessageBoxImage.Question);
|
||||||
|
|
||||||
|
if (result != MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string backupPath = ConfigService.Backup();
|
||||||
|
ConfigService.ImportFrom(dialog.FileName);
|
||||||
|
controller?.ReloadConfig();
|
||||||
|
RefreshView();
|
||||||
|
StatusText.Text = $"Imported config from {dialog.FileName}. Previous config backed up to {backupPath}";
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"Could not import config.\n\n{ex.Message}", "Taskbar Launcher");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ResetConfig_Click(object sender, RoutedEventArgs e)
|
||||||
|
{
|
||||||
|
MessageBoxResult result = MessageBox.Show(
|
||||||
|
"Reset launcher config to the default folders and apps?\n\nA local backup will be created first.",
|
||||||
|
"Taskbar Launcher",
|
||||||
|
MessageBoxButton.YesNo,
|
||||||
|
MessageBoxImage.Warning);
|
||||||
|
|
||||||
|
if (result != MessageBoxResult.Yes)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
try
|
||||||
|
{
|
||||||
|
string backupPath = ConfigService.Backup();
|
||||||
|
ConfigService.ResetToDefaults();
|
||||||
|
controller?.ReloadConfig();
|
||||||
|
RefreshView();
|
||||||
|
StatusText.Text = $"Reset config to defaults. Previous config backed up to {backupPath}";
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
MessageBox.Show($"Could not reset config.\n\n{ex.Message}", "Taskbar Launcher");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private List<int>? FindItemPath(LauncherItem item)
|
private List<int>? FindItemPath(LauncherItem item)
|
||||||
{
|
{
|
||||||
if (controller is null)
|
if (controller is null)
|
||||||
@@ -795,6 +995,33 @@ public partial class MainWindow : Window
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void ItemDisplayModeBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (isLoadingSelection)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (selectedItem is not null && ItemDisplayModeBox.SelectedItem is LauncherDisplayMode itemMode)
|
||||||
|
{
|
||||||
|
selectedItem.DisplayMode = itemMode;
|
||||||
|
selectedPath = FindItemPath(selectedItem);
|
||||||
|
StatusText.Text = "Click Save to keep the selected item display mode.";
|
||||||
|
}
|
||||||
|
|
||||||
|
UpdatePreview();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void ThemeSchemeBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||||
|
{
|
||||||
|
if (controller is null || ThemeSchemeBox.SelectedItem is not LauncherThemeScheme scheme)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ThemeService.Apply(scheme);
|
||||||
|
}
|
||||||
|
|
||||||
private void EnsureAutomaticIconPath()
|
private void EnsureAutomaticIconPath()
|
||||||
{
|
{
|
||||||
if (TypeBox.SelectedItem is LauncherItemType.Menu)
|
if (TypeBox.SelectedItem is LauncherItemType.Menu)
|
||||||
@@ -872,7 +1099,9 @@ public partial class MainWindow : Window
|
|||||||
Target = TargetBox.Text.Trim(),
|
Target = TargetBox.Text.Trim(),
|
||||||
Arguments = string.IsNullOrWhiteSpace(ArgumentsBox.Text) ? null : ArgumentsBox.Text.Trim(),
|
Arguments = string.IsNullOrWhiteSpace(ArgumentsBox.Text) ? null : ArgumentsBox.Text.Trim(),
|
||||||
IconPath = string.IsNullOrWhiteSpace(IconPathBox.Text) ? null : IconPathBox.Text.Trim(),
|
IconPath = string.IsNullOrWhiteSpace(IconPathBox.Text) ? null : IconPathBox.Text.Trim(),
|
||||||
DisplayMode = ItemDisplayModeBox.SelectedItem is LauncherDisplayMode mode ? mode : LauncherDisplayMode.CompactList
|
DisplayMode = ItemDisplayModeBox.SelectedItem is LauncherDisplayMode mode
|
||||||
|
? mode
|
||||||
|
: selectedItem.DisplayMode
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ public sealed class LauncherConfig
|
|||||||
|
|
||||||
public LauncherDisplayMode DisplayMode { get; set; } = LauncherDisplayMode.CompactList;
|
public LauncherDisplayMode DisplayMode { get; set; } = LauncherDisplayMode.CompactList;
|
||||||
|
|
||||||
|
public LauncherThemeScheme ThemeScheme { get; set; } = LauncherThemeScheme.MarkHaven;
|
||||||
|
|
||||||
public List<LauncherItem> Items { get; set; } = [];
|
public List<LauncherItem> Items { get; set; } = [];
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -42,3 +44,12 @@ public enum LauncherDisplayMode
|
|||||||
LargeIconWithText,
|
LargeIconWithText,
|
||||||
CompactList
|
CompactList
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public enum LauncherThemeScheme
|
||||||
|
{
|
||||||
|
MarkHaven,
|
||||||
|
MGETBlueOrange,
|
||||||
|
MGETOrange,
|
||||||
|
System,
|
||||||
|
WindowsClassic
|
||||||
|
}
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ public static class ConfigService
|
|||||||
|
|
||||||
string json = File.ReadAllText(ConfigPath);
|
string json = File.ReadAllText(ConfigPath);
|
||||||
LauncherConfig config = JsonSerializer.Deserialize<LauncherConfig>(json, JsonOptions) ?? CreateDefaultConfig();
|
LauncherConfig config = JsonSerializer.Deserialize<LauncherConfig>(json, JsonOptions) ?? CreateDefaultConfig();
|
||||||
NormalizeDisplayModes(config);
|
NormalizeConfig(config);
|
||||||
Save(config);
|
Save(config);
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
@@ -61,18 +61,42 @@ public static class ConfigService
|
|||||||
return backupPath;
|
return backupPath;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static LauncherConfig Restore(string sourcePath)
|
public static string ExportTo(string destinationPath, LauncherConfig config)
|
||||||
{
|
{
|
||||||
if (!File.Exists(sourcePath))
|
if (string.IsNullOrWhiteSpace(destinationPath))
|
||||||
{
|
{
|
||||||
throw new FileNotFoundException("The selected config file was not found.", sourcePath);
|
throw new ArgumentException("Choose a destination path for the exported config.", nameof(destinationPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
string json = File.ReadAllText(sourcePath);
|
string? destinationFolder = Path.GetDirectoryName(destinationPath);
|
||||||
LauncherConfig config = JsonSerializer.Deserialize<LauncherConfig>(json, JsonOptions)
|
if (!string.IsNullOrWhiteSpace(destinationFolder))
|
||||||
?? throw new InvalidDataException("The selected config file could not be read.");
|
{
|
||||||
|
Directory.CreateDirectory(destinationFolder);
|
||||||
|
}
|
||||||
|
|
||||||
NormalizeDisplayModes(config);
|
NormalizeConfig(config);
|
||||||
|
string json = JsonSerializer.Serialize(config, JsonOptions);
|
||||||
|
File.WriteAllText(destinationPath, json);
|
||||||
|
return destinationPath;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LauncherConfig ImportFrom(string sourcePath)
|
||||||
|
{
|
||||||
|
LauncherConfig config = ReadConfigFile(sourcePath);
|
||||||
|
Save(config);
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LauncherConfig ResetToDefaults()
|
||||||
|
{
|
||||||
|
LauncherConfig config = CreateDefaultConfig();
|
||||||
|
Save(config);
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static LauncherConfig Restore(string sourcePath)
|
||||||
|
{
|
||||||
|
LauncherConfig config = ReadConfigFile(sourcePath);
|
||||||
Save(config);
|
Save(config);
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
@@ -131,12 +155,77 @@ public static class ConfigService
|
|||||||
]
|
]
|
||||||
};
|
};
|
||||||
|
|
||||||
NormalizeDisplayModes(config);
|
NormalizeConfig(config);
|
||||||
return config;
|
return config;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static void NormalizeDisplayModes(LauncherConfig config)
|
private static LauncherConfig ReadConfigFile(string sourcePath)
|
||||||
{
|
{
|
||||||
|
if (!File.Exists(sourcePath))
|
||||||
|
{
|
||||||
|
throw new FileNotFoundException("The selected config file was not found.", sourcePath);
|
||||||
|
}
|
||||||
|
|
||||||
|
string json = File.ReadAllText(sourcePath);
|
||||||
|
LauncherConfig config;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
config = JsonSerializer.Deserialize<LauncherConfig>(json, JsonOptions)
|
||||||
|
?? throw new InvalidDataException("The selected config file could not be read.");
|
||||||
|
}
|
||||||
|
catch (JsonException ex)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("The selected file is not a valid Taskbar Launcher config.", ex);
|
||||||
|
}
|
||||||
|
|
||||||
|
ValidateConfig(config);
|
||||||
|
NormalizeConfig(config);
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void ValidateConfig(LauncherConfig config)
|
||||||
|
{
|
||||||
|
if (config.Items is null)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException("The selected config is missing launcher items.");
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (LauncherItem item in config.Items)
|
||||||
|
{
|
||||||
|
ValidateItem(item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void ValidateItem(LauncherItem item)
|
||||||
|
{
|
||||||
|
if (item.Children is null)
|
||||||
|
{
|
||||||
|
throw new InvalidDataException($"The item '{item.Title}' has an invalid children list.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Enum.IsDefined(item.Type))
|
||||||
|
{
|
||||||
|
throw new InvalidDataException($"The item '{item.Title}' has an invalid type.");
|
||||||
|
}
|
||||||
|
|
||||||
|
foreach (LauncherItem child in item.Children)
|
||||||
|
{
|
||||||
|
ValidateItem(child);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static void NormalizeConfig(LauncherConfig config)
|
||||||
|
{
|
||||||
|
if (!Enum.IsDefined(config.DisplayMode))
|
||||||
|
{
|
||||||
|
config.DisplayMode = LauncherDisplayMode.CompactList;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!Enum.IsDefined(config.ThemeScheme))
|
||||||
|
{
|
||||||
|
config.ThemeScheme = LauncherThemeScheme.MarkHaven;
|
||||||
|
}
|
||||||
|
|
||||||
foreach (LauncherItem item in config.Items)
|
foreach (LauncherItem item in config.Items)
|
||||||
{
|
{
|
||||||
NormalizeDisplayModes(item);
|
NormalizeDisplayModes(item);
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
using System.Runtime.InteropServices;
|
using System.Runtime.InteropServices;
|
||||||
|
using System.ComponentModel;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Interop;
|
using System.Windows.Interop;
|
||||||
@@ -17,6 +18,7 @@ public sealed class HotkeyService : IDisposable
|
|||||||
|
|
||||||
public void Register(string hotkey)
|
public void Register(string hotkey)
|
||||||
{
|
{
|
||||||
|
ParseHotkey(hotkey, out uint modifiers, out uint key);
|
||||||
Unregister();
|
Unregister();
|
||||||
|
|
||||||
window = new Window
|
window = new Window
|
||||||
@@ -37,8 +39,13 @@ public sealed class HotkeyService : IDisposable
|
|||||||
source = HwndSource.FromHwnd(helper.Handle);
|
source = HwndSource.FromHwnd(helper.Handle);
|
||||||
source?.AddHook(WndProc);
|
source?.AddHook(WndProc);
|
||||||
|
|
||||||
ParseHotkey(hotkey, out uint modifiers, out uint key);
|
if (!RegisterHotKey(helper.Handle, HotkeyId, modifiers, key))
|
||||||
RegisterHotKey(helper.Handle, HotkeyId, modifiers, key);
|
{
|
||||||
|
int error = Marshal.GetLastWin32Error();
|
||||||
|
throw new InvalidOperationException(
|
||||||
|
$"Windows could not register hotkey '{Normalize(hotkey)}'. It may already be used by another app.",
|
||||||
|
new Win32Exception(error));
|
||||||
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
window.Show();
|
window.Show();
|
||||||
@@ -78,12 +85,47 @@ public sealed class HotkeyService : IDisposable
|
|||||||
return IntPtr.Zero;
|
return IntPtr.Zero;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static string Normalize(string hotkey)
|
||||||
|
{
|
||||||
|
ParseHotkey(hotkey, out uint modifiers, out uint key);
|
||||||
|
Key parsedKey = KeyInterop.KeyFromVirtualKey((int)key);
|
||||||
|
List<string> parts = [];
|
||||||
|
|
||||||
|
if ((modifiers & 0x0002) != 0)
|
||||||
|
{
|
||||||
|
parts.Add("Ctrl");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((modifiers & 0x0001) != 0)
|
||||||
|
{
|
||||||
|
parts.Add("Alt");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((modifiers & 0x0004) != 0)
|
||||||
|
{
|
||||||
|
parts.Add("Shift");
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((modifiers & 0x0008) != 0)
|
||||||
|
{
|
||||||
|
parts.Add("Win");
|
||||||
|
}
|
||||||
|
|
||||||
|
parts.Add(parsedKey.ToString());
|
||||||
|
return string.Join("+", parts);
|
||||||
|
}
|
||||||
|
|
||||||
private static void ParseHotkey(string hotkey, out uint modifiers, out uint key)
|
private static void ParseHotkey(string hotkey, out uint modifiers, out uint key)
|
||||||
{
|
{
|
||||||
modifiers = 0;
|
modifiers = 0;
|
||||||
key = (uint)KeyInterop.VirtualKeyFromKey(Key.Space);
|
key = 0;
|
||||||
|
|
||||||
foreach (string part in hotkey.Split('+', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries))
|
string[] parts = hotkey
|
||||||
|
.Replace(",", "+", StringComparison.Ordinal)
|
||||||
|
.Replace(" ", "+", StringComparison.Ordinal)
|
||||||
|
.Split('+', StringSplitOptions.TrimEntries | StringSplitOptions.RemoveEmptyEntries);
|
||||||
|
|
||||||
|
foreach (string part in parts)
|
||||||
{
|
{
|
||||||
if (part.Equals("Ctrl", StringComparison.OrdinalIgnoreCase) || part.Equals("Control", StringComparison.OrdinalIgnoreCase))
|
if (part.Equals("Ctrl", StringComparison.OrdinalIgnoreCase) || part.Equals("Control", StringComparison.OrdinalIgnoreCase))
|
||||||
{
|
{
|
||||||
@@ -101,11 +143,45 @@ public sealed class HotkeyService : IDisposable
|
|||||||
{
|
{
|
||||||
modifiers |= 0x0008;
|
modifiers |= 0x0008;
|
||||||
}
|
}
|
||||||
else if (Enum.TryParse(part, true, out Key parsedKey))
|
else if (TryParseKey(part, out Key parsedKey))
|
||||||
{
|
{
|
||||||
key = (uint)KeyInterop.VirtualKeyFromKey(parsedKey);
|
key = (uint)KeyInterop.VirtualKeyFromKey(parsedKey);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
throw new FormatException($"'{part}' is not a valid hotkey key.");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (modifiers == 0)
|
||||||
|
{
|
||||||
|
throw new FormatException("Hotkeys must include at least one modifier: Ctrl, Alt, Shift, or Win.");
|
||||||
|
}
|
||||||
|
|
||||||
|
if (key == 0)
|
||||||
|
{
|
||||||
|
throw new FormatException("Hotkeys must include a final key, such as Space, S, F12, or D1.");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool TryParseKey(string value, out Key key)
|
||||||
|
{
|
||||||
|
if (Enum.TryParse(value, true, out key))
|
||||||
|
{
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value.Length == 1 && char.IsLetter(value[0]))
|
||||||
|
{
|
||||||
|
return Enum.TryParse(value.ToUpperInvariant(), out key);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (value.Length == 1 && char.IsDigit(value[0]))
|
||||||
|
{
|
||||||
|
return Enum.TryParse($"D{value}", out key);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
[DllImport("user32.dll", SetLastError = true)]
|
[DllImport("user32.dll", SetLastError = true)]
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ public sealed class LauncherController : IDisposable
|
|||||||
public void Start()
|
public void Start()
|
||||||
{
|
{
|
||||||
Config = ConfigService.Load();
|
Config = ConfigService.Load();
|
||||||
|
ThemeService.Apply(Config.ThemeScheme);
|
||||||
CreateTrayIcon();
|
CreateTrayIcon();
|
||||||
RegisterHotkey();
|
RegisterHotkey();
|
||||||
}
|
}
|
||||||
@@ -27,6 +28,7 @@ public sealed class LauncherController : IDisposable
|
|||||||
public void ReloadConfig()
|
public void ReloadConfig()
|
||||||
{
|
{
|
||||||
Config = ConfigService.Load();
|
Config = ConfigService.Load();
|
||||||
|
ThemeService.Apply(Config.ThemeScheme);
|
||||||
RegisterHotkey();
|
RegisterHotkey();
|
||||||
popup?.Close();
|
popup?.Close();
|
||||||
popup = null;
|
popup = null;
|
||||||
@@ -62,7 +64,7 @@ public sealed class LauncherController : IDisposable
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
popup = new LauncherPopup(Config, LaunchItem, ShowSettings);
|
popup = new LauncherPopup(Config, LaunchItem, OpenAllItems, ShowSettings);
|
||||||
popup.Closed += (_, _) => popup = null;
|
popup.Closed += (_, _) => popup = null;
|
||||||
popup.ShowNearTaskbar();
|
popup.ShowNearTaskbar();
|
||||||
}
|
}
|
||||||
@@ -126,22 +128,78 @@ public sealed class LauncherController : IDisposable
|
|||||||
|
|
||||||
private void LaunchItem(LauncherItem item)
|
private void LaunchItem(LauncherItem item)
|
||||||
{
|
{
|
||||||
|
if (TryLaunchItem(item, out string? error))
|
||||||
|
{
|
||||||
|
popup?.Close();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!string.IsNullOrWhiteSpace(error))
|
||||||
|
{
|
||||||
|
System.Windows.MessageBox.Show(error, "Taskbar Launcher");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void OpenAllItems(LauncherItem menuItem)
|
||||||
|
{
|
||||||
|
List<string> failures = [];
|
||||||
|
int launchedCount = 0;
|
||||||
|
|
||||||
|
foreach (LauncherItem child in menuItem.Children)
|
||||||
|
{
|
||||||
|
if (child.Type == LauncherItemType.Menu || string.IsNullOrWhiteSpace(child.Target))
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (TryLaunchItem(child, out string? error))
|
||||||
|
{
|
||||||
|
launchedCount++;
|
||||||
|
}
|
||||||
|
else if (!string.IsNullOrWhiteSpace(error))
|
||||||
|
{
|
||||||
|
failures.Add(error);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
popup?.Close();
|
||||||
|
|
||||||
|
if (failures.Count > 0)
|
||||||
|
{
|
||||||
|
string message = $"Opened {launchedCount} item(s), but {failures.Count} item(s) failed:\n\n" +
|
||||||
|
string.Join("\n\n", failures.Take(5));
|
||||||
|
System.Windows.MessageBox.Show(message, "Taskbar Launcher");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool TryLaunchItem(LauncherItem item, out string? error)
|
||||||
|
{
|
||||||
|
error = null;
|
||||||
|
|
||||||
if (item.Type == LauncherItemType.Menu || string.IsNullOrWhiteSpace(item.Target))
|
if (item.Type == LauncherItemType.Menu || string.IsNullOrWhiteSpace(item.Target))
|
||||||
{
|
{
|
||||||
return;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
string target = Environment.ExpandEnvironmentVariables(item.Target);
|
string target = Environment.ExpandEnvironmentVariables(item.Target);
|
||||||
|
|
||||||
ProcessStartInfo startInfo = new()
|
try
|
||||||
{
|
{
|
||||||
FileName = target,
|
ProcessStartInfo startInfo = new()
|
||||||
Arguments = item.Arguments ?? "",
|
{
|
||||||
UseShellExecute = true,
|
FileName = target,
|
||||||
WorkingDirectory = Directory.Exists(target) ? target : ConfigService.AppFolder
|
Arguments = item.Arguments ?? "",
|
||||||
};
|
UseShellExecute = true,
|
||||||
|
WorkingDirectory = Directory.Exists(target) ? target : ConfigService.AppFolder
|
||||||
|
};
|
||||||
|
|
||||||
Process.Start(startInfo);
|
Process.Start(startInfo);
|
||||||
popup?.Close();
|
return true;
|
||||||
|
}
|
||||||
|
catch (Exception ex)
|
||||||
|
{
|
||||||
|
error = $"{item.Title}: {ex.Message}";
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using Microsoft.Win32;
|
using Microsoft.Win32;
|
||||||
|
using TaskbarLauncher.Models;
|
||||||
using MediaColor = System.Windows.Media.Color;
|
using MediaColor = System.Windows.Media.Color;
|
||||||
|
|
||||||
namespace TaskbarLauncher.Services;
|
namespace TaskbarLauncher.Services;
|
||||||
@@ -10,34 +11,32 @@ public static class ThemeService
|
|||||||
private const string PersonalizeKey = @"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize";
|
private const string PersonalizeKey = @"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize";
|
||||||
private const string DwmKey = @"Software\Microsoft\Windows\DWM";
|
private const string DwmKey = @"Software\Microsoft\Windows\DWM";
|
||||||
|
|
||||||
public static void Apply()
|
public static void Apply(LauncherThemeScheme scheme = LauncherThemeScheme.MarkHaven)
|
||||||
{
|
{
|
||||||
bool isLight = IsLightTheme();
|
bool isLight = IsLightTheme();
|
||||||
MediaColor accent = GetAccentColor();
|
ThemePalette palette = GetPalette(scheme, isLight);
|
||||||
MediaColor window = isLight ? MediaColor.FromRgb(0xF7, 0xF7, 0xF7) : MediaColor.FromRgb(0x20, 0x20, 0x20);
|
MediaColor accent = palette.Accent;
|
||||||
MediaColor surface = isLight ? System.Windows.Media.Colors.White : MediaColor.FromRgb(0x2B, 0x2B, 0x2B);
|
|
||||||
MediaColor control = isLight ? MediaColor.FromRgb(0xF3, 0xF3, 0xF3) : MediaColor.FromRgb(0x33, 0x33, 0x33);
|
|
||||||
MediaColor hover = isLight ? MediaColor.FromRgb(0xEA, 0xF3, 0xFF) : MediaColor.FromRgb(0x3B, 0x4A, 0x5C);
|
|
||||||
MediaColor text = isLight ? MediaColor.FromRgb(0x1A, 0x1A, 0x1A) : MediaColor.FromRgb(0xF3, 0xF3, 0xF3);
|
|
||||||
MediaColor muted = isLight ? MediaColor.FromRgb(0x66, 0x66, 0x66) : MediaColor.FromRgb(0xB8, 0xB8, 0xB8);
|
|
||||||
MediaColor border = isLight ? MediaColor.FromRgb(0xC8, 0xC8, 0xC8) : MediaColor.FromRgb(0x55, 0x55, 0x55);
|
|
||||||
MediaColor selectedText = IsDark(accent) ? System.Windows.Media.Colors.White : System.Windows.Media.Colors.Black;
|
MediaColor selectedText = IsDark(accent) ? System.Windows.Media.Colors.White : System.Windows.Media.Colors.Black;
|
||||||
|
|
||||||
SetBrush("AppWindowBrush", window);
|
SetBrush("AppWindowBrush", palette.Window);
|
||||||
SetBrush("AppSurfaceBrush", surface);
|
SetBrush("AppSurfaceBrush", palette.Surface);
|
||||||
SetBrush("AppControlBrush", control);
|
SetBrush("AppPanelBrush", palette.Panel);
|
||||||
SetBrush("AppControlHoverBrush", hover);
|
SetBrush("AppControlBrush", palette.Control);
|
||||||
SetBrush("AppTextBrush", text);
|
SetBrush("AppControlHoverBrush", palette.Hover);
|
||||||
SetBrush("AppMutedTextBrush", muted);
|
SetBrush("AppTextBrush", palette.Text);
|
||||||
SetBrush("AppBorderBrush", border);
|
SetBrush("AppMutedTextBrush", palette.Muted);
|
||||||
|
SetBrush("AppBorderBrush", palette.Border);
|
||||||
SetBrush("AppAccentBrush", accent);
|
SetBrush("AppAccentBrush", accent);
|
||||||
|
SetBrush("AppAccentSoftBrush", palette.AccentSoft);
|
||||||
|
SetBrush("AppOrangeBrush", palette.Orange);
|
||||||
|
SetBrush("AppOrangeSoftBrush", palette.OrangeSoft);
|
||||||
SetBrush("AppSelectedTextBrush", selectedText);
|
SetBrush("AppSelectedTextBrush", selectedText);
|
||||||
|
|
||||||
SetBrush(System.Windows.SystemColors.WindowBrushKey, surface);
|
SetBrush(System.Windows.SystemColors.WindowBrushKey, palette.Surface);
|
||||||
SetBrush(System.Windows.SystemColors.WindowTextBrushKey, text);
|
SetBrush(System.Windows.SystemColors.WindowTextBrushKey, palette.Text);
|
||||||
SetBrush(System.Windows.SystemColors.ControlBrushKey, control);
|
SetBrush(System.Windows.SystemColors.ControlBrushKey, palette.Control);
|
||||||
SetBrush(System.Windows.SystemColors.ControlTextBrushKey, text);
|
SetBrush(System.Windows.SystemColors.ControlTextBrushKey, palette.Text);
|
||||||
SetBrush(System.Windows.SystemColors.ControlDarkBrushKey, border);
|
SetBrush(System.Windows.SystemColors.ControlDarkBrushKey, palette.Border);
|
||||||
SetBrush(System.Windows.SystemColors.HighlightBrushKey, accent);
|
SetBrush(System.Windows.SystemColors.HighlightBrushKey, accent);
|
||||||
SetBrush(System.Windows.SystemColors.HighlightTextBrushKey, selectedText);
|
SetBrush(System.Windows.SystemColors.HighlightTextBrushKey, selectedText);
|
||||||
}
|
}
|
||||||
@@ -62,6 +61,123 @@ public static class ThemeService
|
|||||||
return MediaColor.FromRgb(0x00, 0x78, 0xD4);
|
return MediaColor.FromRgb(0x00, 0x78, 0xD4);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static ThemePalette GetPalette(LauncherThemeScheme scheme, bool isLight)
|
||||||
|
{
|
||||||
|
MediaColor windowsAccent = GetAccentColor();
|
||||||
|
MediaColor orange = MediaColor.FromRgb(0xD8, 0x78, 0x1D);
|
||||||
|
|
||||||
|
return scheme switch
|
||||||
|
{
|
||||||
|
LauncherThemeScheme.System => CreatePalette(
|
||||||
|
isLight,
|
||||||
|
windowsAccent,
|
||||||
|
orange,
|
||||||
|
window: LightDark(isLight, 0xF7F7F7, 0x202020),
|
||||||
|
surface: LightDark(isLight, 0xFFFFFF, 0x2B2B2B),
|
||||||
|
panel: LightDark(isLight, 0xF3F3F3, 0x333333),
|
||||||
|
control: LightDark(isLight, 0xF3F3F3, 0x333333),
|
||||||
|
hover: LightDark(isLight, 0xEAF3FF, 0x3B4A5C),
|
||||||
|
text: LightDark(isLight, 0x1A1A1A, 0xF3F3F3),
|
||||||
|
muted: LightDark(isLight, 0x666666, 0xB8B8B8),
|
||||||
|
border: LightDark(isLight, 0xC8C8C8, 0x555555)),
|
||||||
|
|
||||||
|
LauncherThemeScheme.WindowsClassic => CreatePalette(
|
||||||
|
isLight,
|
||||||
|
windowsAccent,
|
||||||
|
orange,
|
||||||
|
window: LightDark(isLight, 0xF0F0F0, 0x1F1F1F),
|
||||||
|
surface: LightDark(isLight, 0xFAFAFA, 0x2D2D30),
|
||||||
|
panel: LightDark(isLight, 0xFFFFFF, 0x252526),
|
||||||
|
control: LightDark(isLight, 0xF5F5F5, 0x333337),
|
||||||
|
hover: LightDark(isLight, 0xEDEDED, 0x3E3E42),
|
||||||
|
text: LightDark(isLight, 0x111111, 0xF1F1F1),
|
||||||
|
muted: LightDark(isLight, 0x5F5F5F, 0xBDBDBD),
|
||||||
|
border: LightDark(isLight, 0xD0D0D0, 0x565656)),
|
||||||
|
|
||||||
|
LauncherThemeScheme.MGETOrange => CreatePalette(
|
||||||
|
isLight,
|
||||||
|
orange,
|
||||||
|
orange,
|
||||||
|
window: LightDark(isLight, 0xF6F1EA, 0x181614),
|
||||||
|
surface: LightDark(isLight, 0xFFFCF8, 0x221F1B),
|
||||||
|
panel: LightDark(isLight, 0xFFF7EE, 0x2A241E),
|
||||||
|
control: LightDark(isLight, 0xFAF1E7, 0x322B24),
|
||||||
|
hover: LightDark(isLight, 0xFFEDDA, 0x423428),
|
||||||
|
text: LightDark(isLight, 0x241D17, 0xF8F2EA),
|
||||||
|
muted: LightDark(isLight, 0x75685C, 0xC3B5A6),
|
||||||
|
border: LightDark(isLight, 0xE4D1BC, 0x5B4B3C)),
|
||||||
|
|
||||||
|
LauncherThemeScheme.MGETBlueOrange => CreatePalette(
|
||||||
|
isLight,
|
||||||
|
LightDark(isLight, 0x1450A0, 0x78B4F0),
|
||||||
|
LightDark(isLight, 0xF4A000, 0xFFB400),
|
||||||
|
window: LightDark(isLight, 0xEEF3F9, 0x0D1424),
|
||||||
|
surface: LightDark(isLight, 0xFFFFFF, 0x141C2D),
|
||||||
|
panel: LightDark(isLight, 0xF5F8FC, 0x19243A),
|
||||||
|
control: LightDark(isLight, 0xFFF3DA, 0x2F2A20),
|
||||||
|
hover: LightDark(isLight, 0xE8F1FF, 0x203457),
|
||||||
|
text: LightDark(isLight, 0x162235, 0xEEF5FF),
|
||||||
|
muted: LightDark(isLight, 0x617086, 0xAAB8CC),
|
||||||
|
border: LightDark(isLight, 0xCBD7E7, 0x354762)),
|
||||||
|
|
||||||
|
_ => CreatePalette(
|
||||||
|
isLight,
|
||||||
|
LightDark(isLight, 0x146B52, 0x58D0A3),
|
||||||
|
LightDark(isLight, 0xB56B08, 0xF4BD54),
|
||||||
|
window: LightDark(isLight, 0xF9FBFA, 0x0D1A16),
|
||||||
|
surface: LightDark(isLight, 0xFFFFFF, 0x14231E),
|
||||||
|
panel: LightDark(isLight, 0xF9FBFA, 0x14231E),
|
||||||
|
control: LightDark(isLight, 0xEEF3F0, 0x1A2A24),
|
||||||
|
hover: LightDark(isLight, 0xE2F3EC, 0x163B2F),
|
||||||
|
text: LightDark(isLight, 0x192721, 0xEDF5F2),
|
||||||
|
muted: LightDark(isLight, 0x68766F, 0x9FB0A9),
|
||||||
|
border: LightDark(isLight, 0xD9E2DE, 0x30463D))
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static ThemePalette CreatePalette(
|
||||||
|
bool isLight,
|
||||||
|
MediaColor accent,
|
||||||
|
MediaColor orange,
|
||||||
|
MediaColor window,
|
||||||
|
MediaColor surface,
|
||||||
|
MediaColor panel,
|
||||||
|
MediaColor control,
|
||||||
|
MediaColor hover,
|
||||||
|
MediaColor text,
|
||||||
|
MediaColor muted,
|
||||||
|
MediaColor border)
|
||||||
|
{
|
||||||
|
return new ThemePalette(
|
||||||
|
window,
|
||||||
|
surface,
|
||||||
|
panel,
|
||||||
|
control,
|
||||||
|
hover,
|
||||||
|
text,
|
||||||
|
muted,
|
||||||
|
border,
|
||||||
|
accent,
|
||||||
|
Blend(accent, surface, isLight ? 0.14 : 0.24),
|
||||||
|
orange,
|
||||||
|
Blend(orange, surface, isLight ? 0.16 : 0.30));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static MediaColor LightDark(bool isLight, int lightRgb, int darkRgb)
|
||||||
|
{
|
||||||
|
int rgb = isLight ? lightRgb : darkRgb;
|
||||||
|
return MediaColor.FromRgb((byte)(rgb >> 16), (byte)(rgb >> 8), (byte)rgb);
|
||||||
|
}
|
||||||
|
|
||||||
|
private static MediaColor Blend(MediaColor foreground, MediaColor background, double foregroundAmount)
|
||||||
|
{
|
||||||
|
double amount = Math.Clamp(foregroundAmount, 0, 1);
|
||||||
|
byte r = (byte)Math.Round((foreground.R * amount) + (background.R * (1 - amount)));
|
||||||
|
byte g = (byte)Math.Round((foreground.G * amount) + (background.G * (1 - amount)));
|
||||||
|
byte b = (byte)Math.Round((foreground.B * amount) + (background.B * (1 - amount)));
|
||||||
|
return MediaColor.FromRgb(r, g, b);
|
||||||
|
}
|
||||||
|
|
||||||
private static void SetBrush(string key, MediaColor color)
|
private static void SetBrush(string key, MediaColor color)
|
||||||
{
|
{
|
||||||
SolidColorBrush brush = new(color);
|
SolidColorBrush brush = new(color);
|
||||||
@@ -81,4 +197,18 @@ public static class ThemeService
|
|||||||
double luminance = (0.299 * color.R) + (0.587 * color.G) + (0.114 * color.B);
|
double luminance = (0.299 * color.R) + (0.587 * color.G) + (0.114 * color.B);
|
||||||
return luminance < 140;
|
return luminance < 140;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private sealed record ThemePalette(
|
||||||
|
MediaColor Window,
|
||||||
|
MediaColor Surface,
|
||||||
|
MediaColor Panel,
|
||||||
|
MediaColor Control,
|
||||||
|
MediaColor Hover,
|
||||||
|
MediaColor Text,
|
||||||
|
MediaColor Muted,
|
||||||
|
MediaColor Border,
|
||||||
|
MediaColor Accent,
|
||||||
|
MediaColor AccentSoft,
|
||||||
|
MediaColor Orange,
|
||||||
|
MediaColor OrangeSoft);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,13 +12,15 @@
|
|||||||
<Authors>Ray Berezowski</Authors>
|
<Authors>Ray Berezowski</Authors>
|
||||||
<ApplicationIcon>Assets\AppIcon.ico</ApplicationIcon>
|
<ApplicationIcon>Assets\AppIcon.ico</ApplicationIcon>
|
||||||
<Version>1.0.1</Version>
|
<Version>1.0.1</Version>
|
||||||
<AssemblyVersion>1.0.1.0</AssemblyVersion>
|
<AssemblyVersion>1.0.1.1</AssemblyVersion>
|
||||||
<FileVersion>1.0.1.0</FileVersion>
|
<FileVersion>1.0.1.1</FileVersion>
|
||||||
<InformationalVersion>1.0.1</InformationalVersion>
|
<InformationalVersion>1.0.1</InformationalVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
|
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
|
<Resource Include="Assets\AppIcon.ico" />
|
||||||
<Resource Include="Assets\AboutLogo.png" />
|
<Resource Include="Assets\AboutLogo.png" />
|
||||||
|
<Resource Include="Assets\HeaderLogo.png" />
|
||||||
<Resource Include="Assets\TrayIcon.ico" />
|
<Resource Include="Assets\TrayIcon.ico" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
Title="Taskbar Launcher"
|
Title="Taskbar Launcher"
|
||||||
Width="360" SizeToContent="Height"
|
Width="380" SizeToContent="Height"
|
||||||
MaxHeight="720"
|
MaxHeight="720"
|
||||||
WindowStyle="None"
|
WindowStyle="None"
|
||||||
ResizeMode="NoResize"
|
ResizeMode="NoResize"
|
||||||
@@ -13,17 +13,35 @@
|
|||||||
<Border BorderThickness="1"
|
<Border BorderThickness="1"
|
||||||
BorderBrush="{DynamicResource AppBorderBrush}"
|
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||||
Background="{DynamicResource AppSurfaceBrush}"
|
Background="{DynamicResource AppSurfaceBrush}"
|
||||||
Padding="10">
|
CornerRadius="16"
|
||||||
|
Padding="12">
|
||||||
<DockPanel>
|
<DockPanel>
|
||||||
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="0,0,0,8">
|
<Grid DockPanel.Dock="Top" Margin="0,0,0,10">
|
||||||
<TextBlock Text="Taskbar Launcher" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
<Grid.ColumnDefinitions>
|
||||||
<Button Content="Settings" HorizontalAlignment="Right" Margin="12,0,0,0" Padding="8,4"
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
<ColumnDefinition Width="*"/>
|
||||||
|
<ColumnDefinition Width="Auto"/>
|
||||||
|
</Grid.ColumnDefinitions>
|
||||||
|
<Image Source="pack://application:,,,/Assets/HeaderLogo.png"
|
||||||
|
Width="28"
|
||||||
|
Height="28"
|
||||||
|
Margin="0,0,10,0"
|
||||||
|
Stretch="Uniform"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<TextBlock Grid.Column="1"
|
||||||
|
Text="Taskbar Launcher"
|
||||||
|
FontWeight="SemiBold"
|
||||||
|
VerticalAlignment="Center"/>
|
||||||
|
<Button Grid.Column="2"
|
||||||
|
Content="Settings"
|
||||||
|
HorizontalAlignment="Right"
|
||||||
|
Padding="10,5"
|
||||||
Click="Settings_Click"/>
|
Click="Settings_Click"/>
|
||||||
</StackPanel>
|
</Grid>
|
||||||
<TextBox x:Name="SearchBox"
|
<TextBox x:Name="SearchBox"
|
||||||
DockPanel.Dock="Top"
|
DockPanel.Dock="Top"
|
||||||
Margin="0,0,0,8"
|
Margin="0,0,0,10"
|
||||||
Padding="8,5"
|
Padding="10,6"
|
||||||
TextChanged="SearchBox_TextChanged"
|
TextChanged="SearchBox_TextChanged"
|
||||||
PreviewKeyDown="SearchBox_PreviewKeyDown"/>
|
PreviewKeyDown="SearchBox_PreviewKeyDown"/>
|
||||||
<ScrollViewer x:Name="ItemsScrollViewer"
|
<ScrollViewer x:Name="ItemsScrollViewer"
|
||||||
|
|||||||
@@ -17,13 +17,15 @@ public partial class LauncherPopup : Window
|
|||||||
|
|
||||||
private readonly LauncherConfig config;
|
private readonly LauncherConfig config;
|
||||||
private readonly Action<LauncherItem> launchItem;
|
private readonly Action<LauncherItem> launchItem;
|
||||||
|
private readonly Action<LauncherItem> openAllItems;
|
||||||
private readonly Action showSettings;
|
private readonly Action showSettings;
|
||||||
|
|
||||||
public LauncherPopup(LauncherConfig config, Action<LauncherItem> launchItem, Action showSettings)
|
public LauncherPopup(LauncherConfig config, Action<LauncherItem> launchItem, Action<LauncherItem> openAllItems, Action showSettings)
|
||||||
{
|
{
|
||||||
InitializeComponent();
|
InitializeComponent();
|
||||||
this.config = config;
|
this.config = config;
|
||||||
this.launchItem = launchItem;
|
this.launchItem = launchItem;
|
||||||
|
this.openAllItems = openAllItems;
|
||||||
this.showSettings = showSettings;
|
this.showSettings = showSettings;
|
||||||
BuildItems();
|
BuildItems();
|
||||||
SizeChanged += (_, _) => QueueReposition();
|
SizeChanged += (_, _) => QueueReposition();
|
||||||
@@ -102,7 +104,7 @@ public partial class LauncherPopup : Window
|
|||||||
{
|
{
|
||||||
Expander expander = new()
|
Expander expander = new()
|
||||||
{
|
{
|
||||||
Header = item.Title,
|
Header = CreateMenuHeader(item),
|
||||||
IsExpanded = expandMenusByDefault,
|
IsExpanded = expandMenusByDefault,
|
||||||
Margin = new Thickness(depth * 12, 4, 0, 4)
|
Margin = new Thickness(depth * 12, 4, 0, 4)
|
||||||
};
|
};
|
||||||
@@ -122,6 +124,7 @@ public partial class LauncherPopup : Window
|
|||||||
Content = CreateButtonContent(item),
|
Content = CreateButtonContent(item),
|
||||||
Margin = new Thickness(depth * 12, 2, 0, 2),
|
Margin = new Thickness(depth * 12, 2, 0, 2),
|
||||||
MinHeight = DisplayModeMetrics.GetRowHeight(GetEffectiveDisplayMode(item)),
|
MinHeight = DisplayModeMetrics.GetRowHeight(GetEffectiveDisplayMode(item)),
|
||||||
|
HorizontalContentAlignment = System.Windows.HorizontalAlignment.Left,
|
||||||
Tag = item
|
Tag = item
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -143,6 +146,34 @@ public partial class LauncherPopup : Window
|
|||||||
return button;
|
return button;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private TextBlock CreateMenuHeader(LauncherItem item)
|
||||||
|
{
|
||||||
|
System.Windows.Controls.MenuItem openAllMenuItem = new()
|
||||||
|
{
|
||||||
|
Header = "Open All",
|
||||||
|
IsEnabled = item.Children.Any(IsLaunchable)
|
||||||
|
};
|
||||||
|
openAllMenuItem.Click += (_, e) =>
|
||||||
|
{
|
||||||
|
openAllItems(item);
|
||||||
|
e.Handled = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
System.Windows.Controls.ContextMenu contextMenu = new();
|
||||||
|
contextMenu.Items.Add(openAllMenuItem);
|
||||||
|
|
||||||
|
return new TextBlock
|
||||||
|
{
|
||||||
|
Text = item.Title,
|
||||||
|
ContextMenu = contextMenu
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
private static bool IsLaunchable(LauncherItem item)
|
||||||
|
{
|
||||||
|
return item.Type != LauncherItemType.Menu && !string.IsNullOrWhiteSpace(item.Target);
|
||||||
|
}
|
||||||
|
|
||||||
private void SearchBox_TextChanged(object sender, TextChangedEventArgs e)
|
private void SearchBox_TextChanged(object sender, TextChangedEventArgs e)
|
||||||
{
|
{
|
||||||
string query = SearchBox.Text.Trim();
|
string query = SearchBox.Text.Trim();
|
||||||
|
|||||||
47
docs/DEV-NOTES.md
Normal file
47
docs/DEV-NOTES.md
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
# Developer Notes
|
||||||
|
|
||||||
|
This document is for the `dev` branch only. Do not publish it on `main`.
|
||||||
|
|
||||||
|
## Screenshot and Testing Startup Switches
|
||||||
|
|
||||||
|
Taskbar Launcher supports a few command-line switches to open specific UI surfaces for documentation screenshots and manual testing:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
TaskbarLauncher.exe --show-settings
|
||||||
|
TaskbarLauncher.exe --show-about
|
||||||
|
TaskbarLauncher.exe --show-launcher
|
||||||
|
```
|
||||||
|
|
||||||
|
- `--show-settings` opens the Settings window after startup.
|
||||||
|
- `--show-about` opens the About window after startup.
|
||||||
|
- `--show-launcher` opens the launcher popup after startup.
|
||||||
|
|
||||||
|
These switches are not part of the normal user workflow. They exist so development and documentation captures can be repeated cleanly.
|
||||||
|
|
||||||
|
## Future Ideas
|
||||||
|
|
||||||
|
These ideas are intentionally tracked on `dev` only. Do not publish them on `main` until a feature is built, tested, and ready for users.
|
||||||
|
|
||||||
|
### Open All for Menu Sections
|
||||||
|
|
||||||
|
Add a simple right-click action on menu and submenu headers:
|
||||||
|
|
||||||
|
- `Open All`
|
||||||
|
|
||||||
|
Expected behavior:
|
||||||
|
|
||||||
|
- Right-click a top-level menu or submenu title.
|
||||||
|
- Click `Open All`.
|
||||||
|
- Launch each direct child item in that section.
|
||||||
|
- For nested submenus, decide later whether `Open All` should include only direct items or recursively include nested children.
|
||||||
|
- Skip unsupported items safely and show/log a clear result if something cannot be opened.
|
||||||
|
|
||||||
|
This keeps Taskbar Launcher focused as a launcher. It gives project-style behavior without adding a full project dashboard.
|
||||||
|
|
||||||
|
### Project Launcher Concept
|
||||||
|
|
||||||
|
Parked for later as a possible personal/custom feature:
|
||||||
|
|
||||||
|
- Project item type with actions for folder, VS Code, terminal, docs, Git/Gitea page, local server, Docker Compose, and helper scripts.
|
||||||
|
- Could become useful, but it is larger than the current public app direction.
|
||||||
|
- Do not start this until the simpler `Open All` behavior is tested and proves insufficient.
|
||||||
Reference in New Issue
Block a user