Merge pull request #202 from taooceros/theme_folder_quicklink

Add quicklink to customized theme folder
This commit is contained in:
Jeremy Wu 2020-11-16 06:32:09 +11:00 committed by GitHub
commit 98630d1af5
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 5 deletions

View file

@ -21,7 +21,7 @@ namespace Flow.Launcher.Core.Resource
private ResourceDictionary _oldResource;
private string _oldTheme;
public Settings Settings { get; set; }
private const string Folder = "Themes";
private const string Folder = Constant.Themes;
private const string Extension = ".xaml";
private string DirectoryPath => Path.Combine(Constant.ProgramDirectory, Folder);
private string UserDirectoryPath => Path.Combine(DataLocation.DataDirectory(), Folder);

View file

@ -33,5 +33,7 @@ namespace Flow.Launcher.Infrastructure
public static readonly string QueryTextBoxIconImagePath = $"{ProgramDirectory}\\Images\\mainsearch.png";
public const string DefaultTheme = "Darker";
public const string Themes = "Themes";
}
}

View file

@ -172,7 +172,7 @@
<TextBlock Text="{Binding PluginPair.Metadata.Description}"
Grid.Row="1" Opacity="0.5" />
<DockPanel Grid.Row="2" Margin="0 10 0 8" HorizontalAlignment="Right">
<TextBlock Text="{DynamicResource actionKeywords}"
Visibility="{Binding ActionKeywordsVisibility}"
Margin="20 0 0 0"/>
@ -211,10 +211,10 @@
<Run Text="{DynamicResource browserMoreThemes}" />
</Hyperlink>
</TextBlock>
<Button DockPanel.Dock="Top" Margin="0,10,0,0" Width="180" HorizontalAlignment="Center" Click="OpenPluginFolder">Open Theme Folder</Button>
<ListBox DockPanel.Dock="Top" SelectedItem="{Binding SelectedTheme}" ItemsSource="{Binding Themes}"
Margin="10, 0, 10, 10" Width="180" Height="394" />
<ListBox SelectedItem="{Binding SelectedTheme}" ItemsSource="{Binding Themes}"
Margin="10, 0, 10, 10" Width="180"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
</DockPanel>
<Grid Margin="0" Grid.Column="1">
<Grid.RowDefinitions>

View file

@ -8,6 +8,7 @@ using NHotkey;
using NHotkey.Wpf;
using Flow.Launcher.Core.Plugin;
using Flow.Launcher.Core.Resource;
using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.Hotkey;
using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin;
@ -275,5 +276,10 @@ namespace Flow.Launcher
{
Close();
}
private void OpenPluginFolder(object sender, RoutedEventArgs e)
{
FilesFolders.OpenPath(Path.Combine(DataLocation.DataDirectory(), Constant.Themes));
}
}
}