- Change context icon to glyph in some plugin

- Add Glyph property in themes
This commit is contained in:
Dobin Park 2021-10-06 13:21:19 +09:00
parent 8aaeb85d69
commit 66e722bc53
23 changed files with 88 additions and 28 deletions

View file

@ -58,8 +58,8 @@
<Border BorderThickness="0" BorderBrush="Transparent" Margin="9 0 0 0">
<Image x:Name="ImageIcon" Width="32" Height="32" HorizontalAlignment="Center" Source="{Binding Image}" Visibility="{Binding ShowIcon}" Margin="0 0 0 0" Stretch="UniformToFill"/>
</Border>
<Border BorderThickness="0" BorderBrush="Transparent" Margin="14 0 0 0">
<TextBlock Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Glyph.Glyph}" FontFamily="{Binding Glyph.FontFamily}" FontSize="24" Visibility="{Binding ShowGlyph}" Margin="12 0 0 0" Padding="0 0 12 0"/>
<Border BorderThickness="0" BorderBrush="Transparent" Margin="9 0 0 0">
<TextBlock Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Center" Text="{Binding Glyph.Glyph}" FontFamily="{Binding Glyph.FontFamily}" Visibility="{Binding ShowGlyph}" Style="{DynamicResource ItemGlyph}"/>
</Border>
<Grid Margin="6 0 10 0" Grid.Column="1" HorizontalAlignment="Stretch">
<Grid.RowDefinitions>

View file

@ -94,6 +94,14 @@
<Setter Property="FontSize" Value="22" />
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
</Style>
<Style x:Key="BaseGlyphStyle" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="Width" Value="25" />
<Setter Property="Height" Value="25" />
<Setter Property="FontSize" Value="25"/>
</Style>
<Style x:Key="BaseItemTitleSelectedStyle" TargetType="{x:Type TextBlock}" >
<Setter Property="Foreground" Value="#FFFFF8" />
<Setter Property="FontSize" Value="16" />

View file

@ -3,6 +3,9 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Base.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="#000000" />
<Setter Property="Foreground" Value="#ffffff" />

View file

@ -7,6 +7,9 @@
<system:Boolean x:Key="ThemeBlurEnabled">True</system:Boolean>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#FFFFFFFF" />
<Setter Property="Background" Value="Transparent" />

View file

@ -6,7 +6,9 @@
</ResourceDictionary.MergedDictionaries>
<system:Boolean x:Key="ThemeBlurEnabled">True</system:Boolean>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#FFFFFFFF" />
<Setter Property="Background" Value="Transparent" />

View file

@ -6,7 +6,9 @@
</ResourceDictionary.MergedDictionaries>
<system:Boolean x:Key="ThemeBlurEnabled">True</system:Boolean>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#FF000000" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#FF000000" />
<Setter Property="Background" Value="Transparent" />

View file

@ -4,7 +4,9 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="SelectionBrush" Value="#6e6e6e"/>
<Setter Property="SelectionBrush" Value="#4D4D4D"/>

View file

@ -4,7 +4,9 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#dcddde" />
<Setter Property="Background" Value="#36393f" />

View file

@ -7,7 +7,9 @@
<Setter Property="Background" Value="LightGray" />
<Setter Property="Foreground" Value="#222222" />
</Style>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#000000" />
</Style>
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="LightGray" />
<Setter Property="Foreground" Value="#b8b8b8" />

View file

@ -9,8 +9,10 @@
<Setter Property="Width" Value="490" />
<Setter Property="Height" Value="42" />
</Style>
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#b88f3a" />
</Style>
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="#161614"/>
<Setter Property="Foreground" Value="#a09b8c" />
<Setter Property="Width" Value="490" />

View file

@ -4,7 +4,9 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#000000" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="White "/>
<Setter Property="Foreground" Value="#000000" />

View file

@ -2,11 +2,13 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#FFFFFF" />
<Setter Property="Background" Value="#001e4e"/>
</Style>
<Style x:Key="QuerySuggestionBoxStyle" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#344c71" />
<Setter Property="Background" Value="#001e4e" />

View file

@ -3,6 +3,9 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="#2e3440" />
<Setter Property="Foreground" Value="#eceff4" />

View file

@ -3,6 +3,9 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="#4c566a" />
<Setter Property="Foreground" Value="#eceff4" />

View file

@ -2,6 +2,9 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml"></ResourceDictionary>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="#1f1d1f"/>
<Setter Property="Foreground" Value="#cc1081" />

View file

@ -4,7 +4,9 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#5bafb0" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="FontSize" Value="24" />
<Setter Property="Background" Value="#303840" />

View file

@ -4,7 +4,9 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#000000" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="SelectionBrush" Value="#0a68d8"/>
<Setter Property="FontSize" Value="24" />

View file

@ -4,7 +4,9 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#ffffff" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="SelectionBrush" Value="#4a5459"/>
<Setter Property="FontSize" Value="24" />

View file

@ -4,7 +4,9 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="ItemGlyph" BasedOn="{StaticResource BaseGlyphStyle}" TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="#000000" />
</Style>
<Style x:Key="QueryBoxStyle" BasedOn="{StaticResource BaseQueryBoxStyle}" TargetType="{x:Type TextBox}">
<Setter Property="SelectionBrush" Value="#0a68d8"/>
<Setter Property="FontSize" Value="24" />

View file

@ -596,7 +596,8 @@ namespace Flow.Launcher.ViewModel
menu = new Result
{
Title = InternationalizationManager.Instance.GetTranslation("setAsTopMostInThisQuery"),
IcoPath = "Images\\up.png",
//IcoPath = "Images\\up.png",
Glyph = new GlyphInfo(FontFamily: "Segoe Fluent Icons", Glyph: "\xeac2"),
PluginDirectory = Constant.ProgramDirectory,
Action = _ =>
{

View file

@ -190,7 +190,8 @@ namespace Flow.Launcher.Plugin.Program
"flowlauncher_plugin_program_disable_dlgtitle_success_message"));
return false;
},
IcoPath = "Images/disable.png"
//IcoPath = "Images/disable.png"
Glyph = new GlyphInfo(FontFamily: "Segoe Fluent Icons", Glyph: "\xece4"),
}
);

View file

@ -150,7 +150,8 @@ namespace Flow.Launcher.Plugin.Program.Programs
return true;
},
IcoPath = "Images/user.png"
//IcoPath = "Images/user.png"
Glyph = new GlyphInfo(FontFamily: "Segoe Fluent Icons", Glyph: "\xe7ee"),
},
new Result
{
@ -169,7 +170,8 @@ namespace Flow.Launcher.Plugin.Program.Programs
return true;
},
IcoPath = "Images/cmd.png"
//IcoPath = "Images/cmd.png"
Glyph = new GlyphInfo(FontFamily: "Segoe Fluent Icons", Glyph: "\xe7ef"),
},
new Result
{
@ -193,7 +195,8 @@ namespace Flow.Launcher.Plugin.Program.Programs
return true;
},
IcoPath = "Images/folder.png"
//IcoPath = "Images/folder.png"
Glyph = new GlyphInfo(FontFamily: "Segoe Fluent Icons", Glyph: "\xe838"),
}
};
return contextMenus;

View file

@ -96,7 +96,8 @@ namespace Flow.Launcher.Plugin.Sys
{
Title = "Shutdown",
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_shutdown_computer"),
IcoPath = "Images\\shutdown.png",
Glyph = new GlyphInfo (FontFamily:"Segoe Fluent Icons", Glyph:"\xe7e8"),
//IcoPath = "Images\\shutdown.png",
Action = c =>
{
var reuslt = MessageBox.Show(
@ -115,7 +116,8 @@ namespace Flow.Launcher.Plugin.Sys
{
Title = "Restart",
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_restart_computer"),
IcoPath = "Images\\restart.png",
Glyph = new GlyphInfo (FontFamily:"Segoe Fluent Icons", Glyph:"\xe777"),
//IcoPath = "Images\\restart.png",
Action = c =>
{
var result = MessageBox.Show(
@ -134,7 +136,8 @@ namespace Flow.Launcher.Plugin.Sys
{
Title = "Restart With Advanced Boot Options",
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_restart_advanced"),
IcoPath = "Images\\restart_advanced.png",
Glyph = new GlyphInfo (FontFamily:"Segoe Fluent Icons", Glyph:"\xecc5"),
//IcoPath = "Images\\restart_advanced.png",
Action = c =>
{
var result = MessageBox.Show(
@ -152,14 +155,16 @@ namespace Flow.Launcher.Plugin.Sys
{
Title = "Log Off",
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_log_off"),
IcoPath = "Images\\logoff.png",
Glyph = new GlyphInfo (FontFamily:"Segoe Fluent Icons", Glyph:"\xe77b"),
//IcoPath = "Images\\logoff.png",
Action = c => ExitWindowsEx(EWX_LOGOFF, 0)
},
new Result
{
Title = "Lock",
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_lock"),
IcoPath = "Images\\lock.png",
Glyph = new GlyphInfo (FontFamily:"Segoe Fluent Icons", Glyph:"\xe72e"),
//IcoPath = "Images\\lock.png",
Action = c =>
{
LockWorkStation();
@ -170,14 +175,16 @@ namespace Flow.Launcher.Plugin.Sys
{
Title = "Sleep",
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_sleep"),
IcoPath = "Images\\sleep.png",
Glyph = new GlyphInfo (FontFamily:"Segoe Fluent Icons", Glyph:"\xec46"),
//IcoPath = "Images\\sleep.png",
Action = c => FormsApplication.SetSuspendState(PowerState.Suspend, false, false)
},
new Result
{
Title = "Hibernate",
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_hibernate"),
IcoPath = "Images\\hibernate.png",
Glyph = new GlyphInfo (FontFamily:"Segoe Fluent Icons", Glyph:"\xe945"),
//IcoPath = "Images\\hibernate.png",
Action= c =>
{
var info = ShellCommand.SetProcessStartInfo("shutdown", arguments:"/h");
@ -193,7 +200,8 @@ namespace Flow.Launcher.Plugin.Sys
{
Title = "Empty Recycle Bin",
SubTitle = context.API.GetTranslation("flowlauncher_plugin_sys_emptyrecyclebin"),
IcoPath = "Images\\recyclebin.png",
//IcoPath = "Images\\recyclebin.png",
Glyph = new GlyphInfo (FontFamily:"Segoe Fluent Icons", Glyph:"\xe74d"),
Action = c =>
{
// http://www.pinvoke.net/default.aspx/shell32/SHEmptyRecycleBin.html