Compare commits
24 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5aacdbb22c | ||
|
|
e8525e8f55 | ||
|
|
f8d0ca9dd7 | ||
|
|
780f3fa038 | ||
|
|
6b758d4c95 | ||
|
|
ad68fade24 | ||
|
|
c5f4fe2d0e | ||
|
|
8760d96310 | ||
|
|
f3955b0ffc | ||
|
|
15a7f81a28 | ||
|
|
832f7f3012 | ||
|
|
3bd58af9d9 | ||
|
|
28689bbd16 | ||
|
|
1511aae219 | ||
|
|
84e89ec11c | ||
|
|
fb9258d339 | ||
|
|
8211200fcc | ||
|
|
b0fc1b4679 | ||
|
|
835ce2159b | ||
|
|
44e9517453 | ||
|
|
c35d687751 | ||
|
|
95f79ae6d0 | ||
|
|
6d5b9bc2a8 | ||
|
|
d40f1f2935 |
@@ -2,8 +2,8 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="About Taskbar Launcher"
|
||||
Height="410"
|
||||
Width="560"
|
||||
Height="430"
|
||||
Width="580"
|
||||
ResizeMode="NoResize"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Background="{DynamicResource AppWindowBrush}"
|
||||
@@ -15,6 +15,11 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Background="{DynamicResource AppPanelBrush}"
|
||||
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="16"
|
||||
Padding="16">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="96"/>
|
||||
@@ -25,7 +30,8 @@
|
||||
Height="76"
|
||||
BorderThickness="1"
|
||||
BorderBrush="{DynamicResource AppAccentBrush}"
|
||||
Background="{DynamicResource AppSurfaceBrush}"
|
||||
Background="{DynamicResource AppOrangeSoftBrush}"
|
||||
CornerRadius="14"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Top">
|
||||
<Image Source="pack://application:,,,/Assets/AboutLogo.png"
|
||||
@@ -42,13 +48,15 @@
|
||||
TextWrapping="Wrap"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<Border Grid.Row="1"
|
||||
Margin="0,22,0,18"
|
||||
Padding="14"
|
||||
BorderThickness="1"
|
||||
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||
Background="{DynamicResource AppSurfaceBrush}">
|
||||
Background="{DynamicResource AppSurfaceBrush}"
|
||||
CornerRadius="14">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="120"/>
|
||||
@@ -89,6 +97,7 @@
|
||||
<Button Grid.Row="2"
|
||||
Content="Close"
|
||||
Click="Close_Click"
|
||||
Padding="18,8"
|
||||
HorizontalAlignment="Right"/>
|
||||
</Grid>
|
||||
</Window>
|
||||
|
||||
@@ -14,7 +14,7 @@ public partial class AboutWindow : Window
|
||||
AuthorText.Text = AppInfo.Author;
|
||||
VersionText.Text = AppInfo.Version;
|
||||
BuildText.Text = AppInfo.Build;
|
||||
ConfigPathText.Text = ConfigService.ConfigPath;
|
||||
ConfigPathText.Text = "config.json beside TaskbarLauncher.exe";
|
||||
|
||||
if (string.IsNullOrWhiteSpace(AppInfo.GiveawaySiteUrl))
|
||||
{
|
||||
|
||||
164
App.xaml
164
App.xaml
@@ -5,8 +5,10 @@
|
||||
<Application.Resources>
|
||||
<Style TargetType="Button">
|
||||
<Setter Property="Margin" Value="0,2"/>
|
||||
<Setter Property="Padding" Value="10,8"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left"/>
|
||||
<Setter Property="Padding" Value="12,8"/>
|
||||
<Setter Property="MinHeight" Value="34"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Background" Value="{DynamicResource AppControlBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderBrush}"/>
|
||||
@@ -17,6 +19,7 @@
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="10"
|
||||
Padding="{TemplateBinding Padding}">
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
@@ -24,11 +27,11 @@
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<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}"/>
|
||||
</Trigger>
|
||||
<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}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
@@ -44,13 +47,42 @@
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderBrush}"/>
|
||||
<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 TargetType="ComboBox">
|
||||
<Setter Property="Background" Value="{DynamicResource AppSurfaceBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource AppBorderBrush}"/>
|
||||
<Setter Property="Padding" Value="6,4"/>
|
||||
<Setter Property="MinHeight" Value="28"/>
|
||||
<Setter Property="Padding" Value="9,6"/>
|
||||
<Setter Property="MinHeight" Value="34"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBox">
|
||||
@@ -66,20 +98,21 @@
|
||||
<Border x:Name="ComboToggleBorder"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="1">
|
||||
BorderThickness="1"
|
||||
CornerRadius="10">
|
||||
<ContentPresenter/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<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}"/>
|
||||
</Trigger>
|
||||
<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}"/>
|
||||
</Trigger>
|
||||
<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}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
@@ -114,6 +147,8 @@
|
||||
<Border Background="{DynamicResource AppSurfaceBrush}"
|
||||
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="10"
|
||||
Padding="3"
|
||||
MinWidth="{TemplateBinding ActualWidth}"
|
||||
MaxHeight="{TemplateBinding MaxDropDownHeight}">
|
||||
<ScrollViewer>
|
||||
@@ -127,11 +162,11 @@
|
||||
<Setter Property="Opacity" Value="0.55"/>
|
||||
</Trigger>
|
||||
<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}"/>
|
||||
</Trigger>
|
||||
<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}"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
@@ -142,21 +177,24 @@
|
||||
<Style TargetType="ComboBoxItem">
|
||||
<Setter Property="Background" Value="{DynamicResource AppSurfaceBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||
<Setter Property="Padding" Value="6,4"/>
|
||||
<Setter Property="Padding" Value="9,7"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsHighlighted" Value="True">
|
||||
<Setter Property="Background" Value="{DynamicResource AppAccentBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppSelectedTextBrush}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource AppAccentSoftBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter Property="Background" Value="{DynamicResource AppAccentBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppSelectedTextBrush}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource AppAccentSoftBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
<Style TargetType="TreeView">
|
||||
<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="8"/>
|
||||
</Style>
|
||||
<Style TargetType="TreeViewItem">
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||
@@ -168,12 +206,104 @@
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</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">
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||
<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 TargetType="CheckBox">
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
</Style>
|
||||
<Style TargetType="Expander">
|
||||
<Setter Property="Foreground" Value="{DynamicResource AppTextBrush}"/>
|
||||
|
||||
14
App.xaml.cs
14
App.xaml.cs
@@ -10,9 +10,21 @@ public partial class App : System.Windows.Application
|
||||
{
|
||||
base.OnStartup(e);
|
||||
|
||||
ThemeService.Apply();
|
||||
controller = new LauncherController();
|
||||
controller.Start();
|
||||
|
||||
if (e.Args.Contains("--show-settings", StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
controller.ShowSettings();
|
||||
}
|
||||
else if (e.Args.Contains("--show-about", StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
controller.ShowAbout();
|
||||
}
|
||||
else if (e.Args.Contains("--show-launcher", StringComparer.OrdinalIgnoreCase))
|
||||
{
|
||||
controller.TogglePopup();
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnExit(System.Windows.ExitEventArgs e)
|
||||
|
||||
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:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
mc:Ignorable="d"
|
||||
Title="Taskbar Launcher Settings" Height="700" Width="940"
|
||||
MinHeight="620" MinWidth="820"
|
||||
Title="Taskbar Launcher Settings" Height="740" Width="980"
|
||||
MinHeight="660" MinWidth="860"
|
||||
Background="{DynamicResource AppWindowBrush}"
|
||||
Foreground="{DynamicResource AppTextBrush}">
|
||||
<DockPanel Margin="18">
|
||||
<StackPanel DockPanel.Dock="Top" Margin="0,0,0,14">
|
||||
<TextBlock Text="Taskbar Launcher" FontSize="22" FontWeight="SemiBold"/>
|
||||
<TextBlock x:Name="VersionText"
|
||||
Foreground="{DynamicResource AppMutedTextBrush}"/>
|
||||
<TextBlock Text="Portable launcher settings are stored beside the app in config.json."
|
||||
Foreground="{DynamicResource AppMutedTextBrush}"/>
|
||||
</StackPanel>
|
||||
<Border DockPanel.Dock="Top"
|
||||
Margin="0,0,0,16"
|
||||
Padding="16,14"
|
||||
Background="{DynamicResource AppPanelBrush}"
|
||||
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||
BorderThickness="1"
|
||||
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"
|
||||
BorderBrush="{DynamicResource AppBorderBrush}">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
|
||||
<Border DockPanel.Dock="Bottom"
|
||||
Margin="0,16,0,0"
|
||||
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="Backup Config" Click="BackupConfig_Click" Margin="0,0,8,0"/>
|
||||
<Button Content="Restore Config" Click="RestoreConfig_Click" Margin="0,0,8,0"/>
|
||||
<Button Content="Reload Config" Click="ReloadConfig_Click" Margin="0,0,8,0"/>
|
||||
<Button Content="Open Config Folder" Click="OpenConfigFolder_Click" Margin="0,0,8,0"/>
|
||||
<Button x:Name="ConfigMenuButton"
|
||||
Content="Config..."
|
||||
Click="ConfigMenuButton_Click"
|
||||
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="Close" Click="Close_Click"/>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
</Border>
|
||||
|
||||
<Grid>
|
||||
@@ -36,9 +83,9 @@
|
||||
<ColumnDefinition Width="3*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<GroupBox Header="Launcher Items" Margin="0,0,12,0">
|
||||
<DockPanel Margin="8">
|
||||
<UniformGrid DockPanel.Dock="Bottom" Columns="2" Margin="0,8,0,0">
|
||||
<GroupBox Header="Launcher Items" Margin="0,0,14,0">
|
||||
<DockPanel>
|
||||
<UniformGrid DockPanel.Dock="Bottom" Columns="2" Margin="0,10,0,0">
|
||||
<Button Content="Add Root" Click="AddRoot_Click"/>
|
||||
<Button Content="Add Top Menu" Click="AddTopMenu_Click"/>
|
||||
<Button Content="Add Child" Click="AddChild_Click"/>
|
||||
@@ -51,6 +98,7 @@
|
||||
</UniformGrid>
|
||||
<TreeView x:Name="ItemsTree"
|
||||
AllowDrop="True"
|
||||
Margin="0"
|
||||
SelectedItemChanged="ItemsTree_SelectedItemChanged"
|
||||
PreviewMouseMove="ItemsTree_PreviewMouseMove"
|
||||
DragOver="ItemsTree_DragOver"
|
||||
@@ -59,7 +107,7 @@
|
||||
</GroupBox>
|
||||
|
||||
<GroupBox Header="Settings" Grid.Column="1">
|
||||
<Grid Margin="12">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="16"/>
|
||||
@@ -67,6 +115,11 @@
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<Border Background="{DynamicResource AppPanelBrush}"
|
||||
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="12"
|
||||
Padding="12">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="110"/>
|
||||
@@ -76,25 +129,38 @@
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<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"/>
|
||||
<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"/>
|
||||
<CheckBox x:Name="StartWithWindowsBox" Grid.Row="2" Grid.Column="1"
|
||||
<TextBlock Text="Color Scheme" Grid.Row="2" VerticalAlignment="Center" Margin="0,0,8,8"/>
|
||||
<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"
|
||||
Margin="0,8,0,0"
|
||||
Checked="StartWithWindowsBox_Changed"
|
||||
Unchecked="StartWithWindowsBox_Changed"/>
|
||||
</Grid>
|
||||
</Border>
|
||||
|
||||
<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>
|
||||
<ColumnDefinition Width="110"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
@@ -140,14 +206,15 @@
|
||||
|
||||
<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"
|
||||
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"/>
|
||||
<Border Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="2"
|
||||
BorderThickness="1"
|
||||
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||
Background="{DynamicResource AppControlBrush}"
|
||||
Padding="8" MinHeight="72">
|
||||
Background="{DynamicResource AppSurfaceBrush}"
|
||||
CornerRadius="12"
|
||||
Padding="10" MinHeight="76">
|
||||
<StackPanel>
|
||||
<ContentControl x:Name="PreviewHost"/>
|
||||
<TextBlock x:Name="PreviewNote" Margin="0,8,0,0"
|
||||
@@ -156,8 +223,9 @@
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</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}"
|
||||
TextWrapping="Wrap"/>
|
||||
</Grid>
|
||||
|
||||
@@ -3,6 +3,7 @@ using System.Windows.Controls;
|
||||
using System.Windows.Forms;
|
||||
using System.Windows.Media;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using System.Windows.Input;
|
||||
using TaskbarLauncher.Models;
|
||||
using TaskbarLauncher.Services;
|
||||
@@ -33,6 +34,7 @@ public partial class MainWindow : Window
|
||||
this.controller = controller;
|
||||
DisplayModeBox.ItemsSource = Enum.GetValues<LauncherDisplayMode>();
|
||||
ItemDisplayModeBox.ItemsSource = Enum.GetValues<LauncherDisplayMode>();
|
||||
ThemeSchemeBox.ItemsSource = Enum.GetValues<LauncherThemeScheme>();
|
||||
TypeBox.ItemsSource = Enum.GetValues<LauncherItemType>();
|
||||
VersionText.Text = $"Version {AppInfo.Version} Build {AppInfo.Build}";
|
||||
RefreshView();
|
||||
@@ -53,8 +55,9 @@ public partial class MainWindow : Window
|
||||
|
||||
HotkeyBox.Text = controller.Config.Hotkey;
|
||||
DisplayModeBox.SelectedItem = controller.Config.DisplayMode;
|
||||
ThemeSchemeBox.SelectedItem = controller.Config.ThemeScheme;
|
||||
LoadStartupState();
|
||||
StatusText.Text = $"Config file: {ConfigService.ConfigPath}";
|
||||
StatusText.Text = "Config file: config.json beside TaskbarLauncher.exe";
|
||||
if (itemToSelect is not null && SelectTreeItem(itemToSelect))
|
||||
{
|
||||
selectedItem = itemToSelect;
|
||||
@@ -114,6 +117,11 @@ public partial class MainWindow : Window
|
||||
|
||||
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)
|
||||
{
|
||||
selectedItem = null;
|
||||
@@ -149,15 +157,42 @@ public partial class MainWindow : Window
|
||||
|
||||
private void ItemsTree_DragOver(object sender, System.Windows.DragEventArgs e)
|
||||
{
|
||||
e.Effects = CanDrop(e) ? System.Windows.DragDropEffects.Move : System.Windows.DragDropEffects.None;
|
||||
if (CanMoveDroppedItem(e))
|
||||
{
|
||||
e.Effects = System.Windows.DragDropEffects.Move;
|
||||
}
|
||||
else if (CanAddExternalDroppedItems(e.Data))
|
||||
{
|
||||
e.Effects = System.Windows.DragDropEffects.Copy;
|
||||
}
|
||||
else
|
||||
{
|
||||
e.Effects = System.Windows.DragDropEffects.None;
|
||||
}
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private void ItemsTree_Drop(object sender, System.Windows.DragEventArgs e)
|
||||
{
|
||||
if (controller is null ||
|
||||
!e.Data.GetDataPresent(typeof(LauncherItem)) ||
|
||||
e.Data.GetData(typeof(LauncherItem)) is not LauncherItem draggedItem)
|
||||
if (controller is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (e.Data.GetDataPresent(typeof(LauncherItem)) &&
|
||||
e.Data.GetData(typeof(LauncherItem)) is LauncherItem draggedItem)
|
||||
{
|
||||
MoveDroppedItem(e, draggedItem);
|
||||
return;
|
||||
}
|
||||
|
||||
AddExternalDroppedItems(e);
|
||||
}
|
||||
|
||||
private void MoveDroppedItem(System.Windows.DragEventArgs e, LauncherItem draggedItem)
|
||||
{
|
||||
if (controller is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
@@ -206,7 +241,59 @@ public partial class MainWindow : Window
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private bool CanDrop(System.Windows.DragEventArgs e)
|
||||
private void AddExternalDroppedItems(System.Windows.DragEventArgs e)
|
||||
{
|
||||
if (controller is null)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
List<LauncherItem> droppedItems = CreateItemsFromDropData(e.Data, controller.Config.DisplayMode);
|
||||
if (droppedItems.Count == 0)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
ApplyCurrentItem();
|
||||
|
||||
TreeViewItem? targetTreeItem = FindAncestor<TreeViewItem>(e.OriginalSource as DependencyObject);
|
||||
LauncherItem? targetItem = targetTreeItem?.Tag as LauncherItem;
|
||||
if (targetItem is null)
|
||||
{
|
||||
controller.Config.Items.AddRange(droppedItems);
|
||||
}
|
||||
else if (targetItem.Type == LauncherItemType.Menu)
|
||||
{
|
||||
targetItem.Children.AddRange(droppedItems);
|
||||
if (targetTreeItem is not null)
|
||||
{
|
||||
targetTreeItem.IsExpanded = true;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
List<LauncherItem>? targetSiblings = FindSiblings(controller.Config.Items, targetItem);
|
||||
if (targetSiblings is null)
|
||||
{
|
||||
controller.Config.Items.AddRange(droppedItems);
|
||||
}
|
||||
else
|
||||
{
|
||||
int targetIndex = targetSiblings.IndexOf(targetItem);
|
||||
targetSiblings.InsertRange(targetIndex + 1, droppedItems);
|
||||
}
|
||||
}
|
||||
|
||||
LauncherItem itemToSelect = droppedItems[0];
|
||||
selectedPath = FindItemPath(itemToSelect);
|
||||
RefreshView(itemToSelect);
|
||||
StatusText.Text = droppedItems.Count == 1
|
||||
? $"Added {itemToSelect.Title}. Click Save to keep it."
|
||||
: $"Added {droppedItems.Count} items. Click Save to keep them.";
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
private bool CanMoveDroppedItem(System.Windows.DragEventArgs e)
|
||||
{
|
||||
if (!e.Data.GetDataPresent(typeof(LauncherItem)) ||
|
||||
e.Data.GetData(typeof(LauncherItem)) is not LauncherItem draggedItem)
|
||||
@@ -219,6 +306,204 @@ public partial class MainWindow : Window
|
||||
return targetItem is null || (!ReferenceEquals(draggedItem, targetItem) && !ContainsItem(draggedItem, targetItem));
|
||||
}
|
||||
|
||||
private static bool CanAddExternalDroppedItems(System.Windows.IDataObject data)
|
||||
{
|
||||
return data.GetDataPresent(System.Windows.DataFormats.FileDrop) ||
|
||||
data.GetDataPresent(System.Windows.DataFormats.UnicodeText) ||
|
||||
data.GetDataPresent(System.Windows.DataFormats.Text) ||
|
||||
data.GetDataPresent("UniformResourceLocatorW") ||
|
||||
data.GetDataPresent("UniformResourceLocator");
|
||||
}
|
||||
|
||||
private static List<LauncherItem> CreateItemsFromDropData(System.Windows.IDataObject data, LauncherDisplayMode displayMode)
|
||||
{
|
||||
List<LauncherItem> items = [];
|
||||
|
||||
if (data.GetDataPresent(System.Windows.DataFormats.FileDrop) &&
|
||||
data.GetData(System.Windows.DataFormats.FileDrop) is string[] paths)
|
||||
{
|
||||
foreach (string path in paths)
|
||||
{
|
||||
LauncherItem? item = CreateItemFromPath(path, displayMode);
|
||||
if (item is not null)
|
||||
{
|
||||
items.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (items.Count > 0)
|
||||
{
|
||||
return items;
|
||||
}
|
||||
|
||||
string? droppedText = GetDroppedText(data);
|
||||
if (!string.IsNullOrWhiteSpace(droppedText))
|
||||
{
|
||||
foreach (string line in droppedText.Split(["\r\n", "\n"], StringSplitOptions.RemoveEmptyEntries | StringSplitOptions.TrimEntries))
|
||||
{
|
||||
LauncherItem? item = CreateItemFromText(line, displayMode);
|
||||
if (item is not null)
|
||||
{
|
||||
items.Add(item);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
private static string? GetDroppedText(System.Windows.IDataObject data)
|
||||
{
|
||||
if (data.GetDataPresent(System.Windows.DataFormats.UnicodeText))
|
||||
{
|
||||
return data.GetData(System.Windows.DataFormats.UnicodeText) as string;
|
||||
}
|
||||
|
||||
if (data.GetDataPresent(System.Windows.DataFormats.Text))
|
||||
{
|
||||
return data.GetData(System.Windows.DataFormats.Text) as string;
|
||||
}
|
||||
|
||||
return GetDroppedUrlFormatText(data, "UniformResourceLocatorW", Encoding.Unicode) ??
|
||||
GetDroppedUrlFormatText(data, "UniformResourceLocator", Encoding.UTF8);
|
||||
}
|
||||
|
||||
private static string? GetDroppedUrlFormatText(System.Windows.IDataObject data, string format, Encoding encoding)
|
||||
{
|
||||
if (!data.GetDataPresent(format))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
object? rawData = data.GetData(format);
|
||||
return rawData switch
|
||||
{
|
||||
string text => text,
|
||||
byte[] bytes => DecodeDroppedUrlBytes(bytes, encoding),
|
||||
MemoryStream stream => DecodeDroppedUrlBytes(stream.ToArray(), encoding),
|
||||
_ => null
|
||||
};
|
||||
}
|
||||
|
||||
private static string DecodeDroppedUrlBytes(byte[] bytes, Encoding encoding)
|
||||
{
|
||||
return encoding.GetString(bytes).TrimEnd('\0', '\r', '\n', ' ');
|
||||
}
|
||||
|
||||
private static LauncherItem? CreateItemFromText(string text, LauncherDisplayMode displayMode)
|
||||
{
|
||||
string target = text.Trim();
|
||||
if (!Uri.TryCreate(target, UriKind.Absolute, out Uri? uri) ||
|
||||
(uri.Scheme != Uri.UriSchemeHttp && uri.Scheme != Uri.UriSchemeHttps))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
return new LauncherItem
|
||||
{
|
||||
Title = GetWebsiteTitle(uri),
|
||||
Type = LauncherItemType.Website,
|
||||
Target = uri.ToString(),
|
||||
IconPath = uri.ToString(),
|
||||
DisplayMode = displayMode
|
||||
};
|
||||
}
|
||||
|
||||
private static LauncherItem CreateWebsiteItem(Uri uri, string title, LauncherDisplayMode displayMode)
|
||||
{
|
||||
return new LauncherItem
|
||||
{
|
||||
Title = title,
|
||||
Type = LauncherItemType.Website,
|
||||
Target = uri.ToString(),
|
||||
IconPath = uri.ToString(),
|
||||
DisplayMode = displayMode
|
||||
};
|
||||
}
|
||||
|
||||
private static LauncherItem? CreateItemFromPath(string path, LauncherDisplayMode displayMode)
|
||||
{
|
||||
if (string.IsNullOrWhiteSpace(path))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
string fullPath = path.Trim();
|
||||
if (Directory.Exists(fullPath))
|
||||
{
|
||||
return new LauncherItem
|
||||
{
|
||||
Title = new DirectoryInfo(fullPath).Name,
|
||||
Type = LauncherItemType.Folder,
|
||||
Target = fullPath,
|
||||
IconPath = fullPath,
|
||||
DisplayMode = displayMode
|
||||
};
|
||||
}
|
||||
|
||||
if (!File.Exists(fullPath))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
if (Path.GetExtension(fullPath).Equals(".url", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
return CreateItemFromInternetShortcut(fullPath, displayMode);
|
||||
}
|
||||
|
||||
LauncherItemType type = IsApplicationPath(fullPath) ? LauncherItemType.App : LauncherItemType.File;
|
||||
return new LauncherItem
|
||||
{
|
||||
Title = Path.GetFileNameWithoutExtension(fullPath),
|
||||
Type = type,
|
||||
Target = fullPath,
|
||||
IconPath = fullPath,
|
||||
DisplayMode = displayMode
|
||||
};
|
||||
}
|
||||
|
||||
private static LauncherItem? CreateItemFromInternetShortcut(string path, LauncherDisplayMode displayMode)
|
||||
{
|
||||
foreach (string line in File.ReadLines(path))
|
||||
{
|
||||
if (!line.StartsWith("URL=", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
string target = line["URL=".Length..].Trim();
|
||||
if (Uri.TryCreate(target, UriKind.Absolute, out Uri? uri) &&
|
||||
(uri.Scheme == Uri.UriSchemeHttp || uri.Scheme == Uri.UriSchemeHttps))
|
||||
{
|
||||
return CreateWebsiteItem(uri, Path.GetFileNameWithoutExtension(path), displayMode);
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
private static bool IsApplicationPath(string path)
|
||||
{
|
||||
string extension = Path.GetExtension(path);
|
||||
return extension.Equals(".exe", StringComparison.OrdinalIgnoreCase) ||
|
||||
extension.Equals(".lnk", StringComparison.OrdinalIgnoreCase) ||
|
||||
extension.Equals(".bat", StringComparison.OrdinalIgnoreCase) ||
|
||||
extension.Equals(".cmd", StringComparison.OrdinalIgnoreCase) ||
|
||||
extension.Equals(".ps1", StringComparison.OrdinalIgnoreCase);
|
||||
}
|
||||
|
||||
private static string GetWebsiteTitle(Uri uri)
|
||||
{
|
||||
string host = uri.Host;
|
||||
if (host.StartsWith("www.", StringComparison.OrdinalIgnoreCase))
|
||||
{
|
||||
host = host[4..];
|
||||
}
|
||||
|
||||
return string.IsNullOrWhiteSpace(host) ? uri.ToString() : host;
|
||||
}
|
||||
|
||||
private static bool ContainsItem(LauncherItem parent, LauncherItem possibleChild)
|
||||
{
|
||||
foreach (LauncherItem child in parent.Children)
|
||||
@@ -295,9 +580,10 @@ public partial class MainWindow : Window
|
||||
: ArgumentsBox.Text.Trim();
|
||||
EnsureAutomaticIconPath();
|
||||
selectedItem.IconPath = string.IsNullOrWhiteSpace(IconPathBox.Text) ? null : IconPathBox.Text.Trim();
|
||||
selectedItem.DisplayMode = ItemDisplayModeBox.SelectedItem is LauncherDisplayMode itemMode
|
||||
? itemMode
|
||||
: controller?.Config.DisplayMode ?? LauncherDisplayMode.LargeIconWithText;
|
||||
if (ItemDisplayModeBox.SelectedItem is LauncherDisplayMode itemMode)
|
||||
{
|
||||
selectedItem.DisplayMode = itemMode;
|
||||
}
|
||||
|
||||
if (selectedItem.Type != LauncherItemType.Menu)
|
||||
{
|
||||
@@ -312,13 +598,81 @@ public partial class MainWindow : Window
|
||||
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
|
||||
? mode
|
||||
: LauncherDisplayMode.LargeIconWithText;
|
||||
: LauncherDisplayMode.CompactList;
|
||||
controller.Config.ThemeScheme = ThemeSchemeBox.SelectedItem is LauncherThemeScheme scheme
|
||||
? scheme
|
||||
: LauncherThemeScheme.MarkHaven;
|
||||
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()
|
||||
{
|
||||
isLoadingStartupState = true;
|
||||
@@ -569,9 +923,24 @@ public partial class MainWindow : Window
|
||||
return;
|
||||
}
|
||||
|
||||
ApplyConfigFields();
|
||||
ConfigService.Save(controller.Config);
|
||||
controller.ReloadConfig();
|
||||
string previousHotkey = controller.Config.Hotkey;
|
||||
try
|
||||
{
|
||||
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);
|
||||
RefreshView(reloadedSelection);
|
||||
StatusText.Text = reloadedSelection is null
|
||||
@@ -636,6 +1005,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)
|
||||
{
|
||||
if (controller is null)
|
||||
@@ -795,6 +1273,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()
|
||||
{
|
||||
if (TypeBox.SelectedItem is LauncherItemType.Menu)
|
||||
@@ -872,7 +1377,9 @@ public partial class MainWindow : Window
|
||||
Target = TargetBox.Text.Trim(),
|
||||
Arguments = string.IsNullOrWhiteSpace(ArgumentsBox.Text) ? null : ArgumentsBox.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 LauncherThemeScheme ThemeScheme { get; set; } = LauncherThemeScheme.MarkHaven;
|
||||
|
||||
public List<LauncherItem> Items { get; set; } = [];
|
||||
}
|
||||
|
||||
@@ -42,3 +44,12 @@ public enum LauncherDisplayMode
|
||||
LargeIconWithText,
|
||||
CompactList
|
||||
}
|
||||
|
||||
public enum LauncherThemeScheme
|
||||
{
|
||||
MarkHaven,
|
||||
MGETBlueOrange,
|
||||
MGETOrange,
|
||||
System,
|
||||
WindowsClassic
|
||||
}
|
||||
|
||||
16
README.md
16
README.md
@@ -13,7 +13,7 @@ Download the compiled Windows release from:
|
||||
- System tray launcher
|
||||
- Global hotkey, default `Ctrl+Alt+Space`
|
||||
- Search/filter in the launcher popup
|
||||
- Nested menus and drag/drop ordering in Settings
|
||||
- Nested menus, drag/drop ordering, and drag/drop item creation in Settings
|
||||
- Per-item icon and display mode
|
||||
- Automatic icon selection from app/folder targets
|
||||
- Portable `config.json`
|
||||
@@ -21,6 +21,20 @@ Download the compiled Windows release from:
|
||||
- Optional Start with Windows shortcut
|
||||
- Windows light/dark theme support
|
||||
|
||||
## Screenshots
|
||||
|
||||
### Launcher Popup
|
||||
|
||||

|
||||
|
||||
### Settings
|
||||
|
||||

|
||||
|
||||
### About
|
||||
|
||||

|
||||
|
||||
## Project Layout
|
||||
|
||||
```text
|
||||
|
||||
@@ -36,7 +36,7 @@ public static class ConfigService
|
||||
|
||||
string json = File.ReadAllText(ConfigPath);
|
||||
LauncherConfig config = JsonSerializer.Deserialize<LauncherConfig>(json, JsonOptions) ?? CreateDefaultConfig();
|
||||
NormalizeDisplayModes(config);
|
||||
NormalizeConfig(config);
|
||||
Save(config);
|
||||
return config;
|
||||
}
|
||||
@@ -61,18 +61,42 @@ public static class ConfigService
|
||||
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);
|
||||
LauncherConfig config = JsonSerializer.Deserialize<LauncherConfig>(json, JsonOptions)
|
||||
?? throw new InvalidDataException("The selected config file could not be read.");
|
||||
string? destinationFolder = Path.GetDirectoryName(destinationPath);
|
||||
if (!string.IsNullOrWhiteSpace(destinationFolder))
|
||||
{
|
||||
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);
|
||||
return config;
|
||||
}
|
||||
@@ -131,12 +155,77 @@ public static class ConfigService
|
||||
]
|
||||
};
|
||||
|
||||
NormalizeDisplayModes(config);
|
||||
NormalizeConfig(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)
|
||||
{
|
||||
NormalizeDisplayModes(item);
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using System.ComponentModel;
|
||||
using System.Windows;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Interop;
|
||||
@@ -17,6 +18,7 @@ public sealed class HotkeyService : IDisposable
|
||||
|
||||
public void Register(string hotkey)
|
||||
{
|
||||
ParseHotkey(hotkey, out uint modifiers, out uint key);
|
||||
Unregister();
|
||||
|
||||
window = new Window
|
||||
@@ -37,8 +39,13 @@ public sealed class HotkeyService : IDisposable
|
||||
source = HwndSource.FromHwnd(helper.Handle);
|
||||
source?.AddHook(WndProc);
|
||||
|
||||
ParseHotkey(hotkey, out uint modifiers, out uint key);
|
||||
RegisterHotKey(helper.Handle, HotkeyId, modifiers, key);
|
||||
if (!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();
|
||||
@@ -78,12 +85,47 @@ public sealed class HotkeyService : IDisposable
|
||||
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)
|
||||
{
|
||||
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))
|
||||
{
|
||||
@@ -101,11 +143,45 @@ public sealed class HotkeyService : IDisposable
|
||||
{
|
||||
modifiers |= 0x0008;
|
||||
}
|
||||
else if (Enum.TryParse(part, true, out Key parsedKey))
|
||||
else if (TryParseKey(part, out Key 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)]
|
||||
|
||||
@@ -20,6 +20,7 @@ public sealed class LauncherController : IDisposable
|
||||
public void Start()
|
||||
{
|
||||
Config = ConfigService.Load();
|
||||
ThemeService.Apply(Config.ThemeScheme);
|
||||
CreateTrayIcon();
|
||||
RegisterHotkey();
|
||||
}
|
||||
@@ -27,6 +28,7 @@ public sealed class LauncherController : IDisposable
|
||||
public void ReloadConfig()
|
||||
{
|
||||
Config = ConfigService.Load();
|
||||
ThemeService.Apply(Config.ThemeScheme);
|
||||
RegisterHotkey();
|
||||
popup?.Close();
|
||||
popup = null;
|
||||
@@ -62,7 +64,7 @@ public sealed class LauncherController : IDisposable
|
||||
return;
|
||||
}
|
||||
|
||||
popup = new LauncherPopup(Config, LaunchItem, ShowSettings);
|
||||
popup = new LauncherPopup(Config, LaunchItem, OpenAllItems, ShowSettings);
|
||||
popup.Closed += (_, _) => popup = null;
|
||||
popup.ShowNearTaskbar();
|
||||
}
|
||||
@@ -126,22 +128,78 @@ public sealed class LauncherController : IDisposable
|
||||
|
||||
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))
|
||||
{
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
string target = Environment.ExpandEnvironmentVariables(item.Target);
|
||||
|
||||
ProcessStartInfo startInfo = new()
|
||||
try
|
||||
{
|
||||
FileName = target,
|
||||
Arguments = item.Arguments ?? "",
|
||||
UseShellExecute = true,
|
||||
WorkingDirectory = Directory.Exists(target) ? target : ConfigService.AppFolder
|
||||
};
|
||||
ProcessStartInfo startInfo = new()
|
||||
{
|
||||
FileName = target,
|
||||
Arguments = item.Arguments ?? "",
|
||||
UseShellExecute = true,
|
||||
WorkingDirectory = Directory.Exists(target) ? target : ConfigService.AppFolder
|
||||
};
|
||||
|
||||
Process.Start(startInfo);
|
||||
popup?.Close();
|
||||
Process.Start(startInfo);
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
error = $"{item.Title}: {ex.Message}";
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Media;
|
||||
using Microsoft.Win32;
|
||||
using TaskbarLauncher.Models;
|
||||
using MediaColor = System.Windows.Media.Color;
|
||||
|
||||
namespace TaskbarLauncher.Services;
|
||||
@@ -10,34 +11,32 @@ public static class ThemeService
|
||||
private const string PersonalizeKey = @"Software\Microsoft\Windows\CurrentVersion\Themes\Personalize";
|
||||
private const string DwmKey = @"Software\Microsoft\Windows\DWM";
|
||||
|
||||
public static void Apply()
|
||||
public static void Apply(LauncherThemeScheme scheme = LauncherThemeScheme.MarkHaven)
|
||||
{
|
||||
bool isLight = IsLightTheme();
|
||||
MediaColor accent = GetAccentColor();
|
||||
MediaColor window = isLight ? MediaColor.FromRgb(0xF7, 0xF7, 0xF7) : MediaColor.FromRgb(0x20, 0x20, 0x20);
|
||||
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);
|
||||
ThemePalette palette = GetPalette(scheme, isLight);
|
||||
MediaColor accent = palette.Accent;
|
||||
MediaColor selectedText = IsDark(accent) ? System.Windows.Media.Colors.White : System.Windows.Media.Colors.Black;
|
||||
|
||||
SetBrush("AppWindowBrush", window);
|
||||
SetBrush("AppSurfaceBrush", surface);
|
||||
SetBrush("AppControlBrush", control);
|
||||
SetBrush("AppControlHoverBrush", hover);
|
||||
SetBrush("AppTextBrush", text);
|
||||
SetBrush("AppMutedTextBrush", muted);
|
||||
SetBrush("AppBorderBrush", border);
|
||||
SetBrush("AppWindowBrush", palette.Window);
|
||||
SetBrush("AppSurfaceBrush", palette.Surface);
|
||||
SetBrush("AppPanelBrush", palette.Panel);
|
||||
SetBrush("AppControlBrush", palette.Control);
|
||||
SetBrush("AppControlHoverBrush", palette.Hover);
|
||||
SetBrush("AppTextBrush", palette.Text);
|
||||
SetBrush("AppMutedTextBrush", palette.Muted);
|
||||
SetBrush("AppBorderBrush", palette.Border);
|
||||
SetBrush("AppAccentBrush", accent);
|
||||
SetBrush("AppAccentSoftBrush", palette.AccentSoft);
|
||||
SetBrush("AppOrangeBrush", palette.Orange);
|
||||
SetBrush("AppOrangeSoftBrush", palette.OrangeSoft);
|
||||
SetBrush("AppSelectedTextBrush", selectedText);
|
||||
|
||||
SetBrush(System.Windows.SystemColors.WindowBrushKey, surface);
|
||||
SetBrush(System.Windows.SystemColors.WindowTextBrushKey, text);
|
||||
SetBrush(System.Windows.SystemColors.ControlBrushKey, control);
|
||||
SetBrush(System.Windows.SystemColors.ControlTextBrushKey, text);
|
||||
SetBrush(System.Windows.SystemColors.ControlDarkBrushKey, border);
|
||||
SetBrush(System.Windows.SystemColors.WindowBrushKey, palette.Surface);
|
||||
SetBrush(System.Windows.SystemColors.WindowTextBrushKey, palette.Text);
|
||||
SetBrush(System.Windows.SystemColors.ControlBrushKey, palette.Control);
|
||||
SetBrush(System.Windows.SystemColors.ControlTextBrushKey, palette.Text);
|
||||
SetBrush(System.Windows.SystemColors.ControlDarkBrushKey, palette.Border);
|
||||
SetBrush(System.Windows.SystemColors.HighlightBrushKey, accent);
|
||||
SetBrush(System.Windows.SystemColors.HighlightTextBrushKey, selectedText);
|
||||
}
|
||||
@@ -62,6 +61,123 @@ public static class ThemeService
|
||||
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)
|
||||
{
|
||||
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);
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -11,14 +11,16 @@
|
||||
<IncludeSourceRevisionInInformationalVersion>false</IncludeSourceRevisionInInformationalVersion>
|
||||
<Authors>Ray Berezowski</Authors>
|
||||
<ApplicationIcon>Assets\AppIcon.ico</ApplicationIcon>
|
||||
<Version>1.0.0</Version>
|
||||
<AssemblyVersion>1.0.0.0</AssemblyVersion>
|
||||
<FileVersion>1.0.0.0</FileVersion>
|
||||
<InformationalVersion>1.0.0</InformationalVersion>
|
||||
<Version>1.0.1</Version>
|
||||
<AssemblyVersion>1.0.1.2</AssemblyVersion>
|
||||
<FileVersion>1.0.1.2</FileVersion>
|
||||
<InformationalVersion>1.0.1</InformationalVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<Resource Include="Assets\AppIcon.ico" />
|
||||
<Resource Include="Assets\AboutLogo.png" />
|
||||
<Resource Include="Assets\HeaderLogo.png" />
|
||||
<Resource Include="Assets\TrayIcon.ico" />
|
||||
</ItemGroup>
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
Title="Taskbar Launcher"
|
||||
Width="360" SizeToContent="Height"
|
||||
Width="380" SizeToContent="Height"
|
||||
MaxHeight="720"
|
||||
WindowStyle="None"
|
||||
ResizeMode="NoResize"
|
||||
@@ -13,17 +13,35 @@
|
||||
<Border BorderThickness="1"
|
||||
BorderBrush="{DynamicResource AppBorderBrush}"
|
||||
Background="{DynamicResource AppSurfaceBrush}"
|
||||
Padding="10">
|
||||
CornerRadius="16"
|
||||
Padding="12">
|
||||
<DockPanel>
|
||||
<StackPanel DockPanel.Dock="Top" Orientation="Horizontal" Margin="0,0,0,8">
|
||||
<TextBlock Text="Taskbar Launcher" FontWeight="SemiBold" VerticalAlignment="Center"/>
|
||||
<Button Content="Settings" HorizontalAlignment="Right" Margin="12,0,0,0" Padding="8,4"
|
||||
<Grid DockPanel.Dock="Top" Margin="0,0,0,10">
|
||||
<Grid.ColumnDefinitions>
|
||||
<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"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<TextBox x:Name="SearchBox"
|
||||
DockPanel.Dock="Top"
|
||||
Margin="0,0,0,8"
|
||||
Padding="8,5"
|
||||
Margin="0,0,0,10"
|
||||
Padding="10,6"
|
||||
TextChanged="SearchBox_TextChanged"
|
||||
PreviewKeyDown="SearchBox_PreviewKeyDown"/>
|
||||
<ScrollViewer x:Name="ItemsScrollViewer"
|
||||
|
||||
@@ -17,13 +17,15 @@ public partial class LauncherPopup : Window
|
||||
|
||||
private readonly LauncherConfig config;
|
||||
private readonly Action<LauncherItem> launchItem;
|
||||
private readonly Action<LauncherItem> openAllItems;
|
||||
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();
|
||||
this.config = config;
|
||||
this.launchItem = launchItem;
|
||||
this.openAllItems = openAllItems;
|
||||
this.showSettings = showSettings;
|
||||
BuildItems();
|
||||
SizeChanged += (_, _) => QueueReposition();
|
||||
@@ -102,7 +104,7 @@ public partial class LauncherPopup : Window
|
||||
{
|
||||
Expander expander = new()
|
||||
{
|
||||
Header = item.Title,
|
||||
Header = CreateMenuHeader(item),
|
||||
IsExpanded = expandMenusByDefault,
|
||||
Margin = new Thickness(depth * 12, 4, 0, 4)
|
||||
};
|
||||
@@ -122,6 +124,7 @@ public partial class LauncherPopup : Window
|
||||
Content = CreateButtonContent(item),
|
||||
Margin = new Thickness(depth * 12, 2, 0, 2),
|
||||
MinHeight = DisplayModeMetrics.GetRowHeight(GetEffectiveDisplayMode(item)),
|
||||
HorizontalContentAlignment = System.Windows.HorizontalAlignment.Left,
|
||||
Tag = item
|
||||
};
|
||||
|
||||
@@ -143,6 +146,34 @@ public partial class LauncherPopup : Window
|
||||
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)
|
||||
{
|
||||
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.
|
||||
@@ -30,6 +30,7 @@ From Settings you can:
|
||||
- Add submenus
|
||||
- Add folders, apps, files, and websites
|
||||
- Drag/drop items to reorder
|
||||
- Drag/drop files, folders, shortcuts, or web links into the launcher item list
|
||||
- Set per-item icon sizes
|
||||
- Back up and restore `config.json`
|
||||
- Enable Start with Windows
|
||||
|
||||
BIN
docs/screenshots/about-window-exact.png
Normal file
BIN
docs/screenshots/about-window-exact.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 34 KiB |
BIN
docs/screenshots/launcher-popup-exact.png
Normal file
BIN
docs/screenshots/launcher-popup-exact.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 7.3 KiB |
BIN
docs/screenshots/settings-window-exact.png
Normal file
BIN
docs/screenshots/settings-window-exact.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 38 KiB |
Reference in New Issue
Block a user