mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge pull request #911 from Garulf/change-icon-based-on-plugin
Plugin activation icon
This commit is contained in:
commit
f5a73dce07
2 changed files with 32 additions and 1 deletions
|
|
@ -190,12 +190,25 @@
|
||||||
</TextBox.ContextMenu>
|
</TextBox.ContextMenu>
|
||||||
</TextBox>
|
</TextBox>
|
||||||
<Canvas Style="{DynamicResource SearchIconPosition}">
|
<Canvas Style="{DynamicResource SearchIconPosition}">
|
||||||
|
<Image
|
||||||
|
x:Name="PluginActivationIcon"
|
||||||
|
Width="32"
|
||||||
|
Height="32"
|
||||||
|
Margin="0,0,0,0"
|
||||||
|
HorizontalAlignment="Center"
|
||||||
|
VerticalAlignment="Center"
|
||||||
|
Panel.ZIndex="2"
|
||||||
|
RenderOptions.BitmapScalingMode="HighQuality"
|
||||||
|
Source="{Binding PluginIconPath}"
|
||||||
|
Stretch="Uniform"
|
||||||
|
Style="{DynamicResource PluginActivationIcon}" />
|
||||||
<Path
|
<Path
|
||||||
Name="SearchIcon"
|
Name="SearchIcon"
|
||||||
Margin="0"
|
Margin="0"
|
||||||
Data="{DynamicResource SearchIconImg}"
|
Data="{DynamicResource SearchIconImg}"
|
||||||
Stretch="Fill"
|
Stretch="Fill"
|
||||||
Style="{DynamicResource SearchIconStyle}" />
|
Style="{DynamicResource SearchIconStyle}"
|
||||||
|
Visibility="{Binding SearchIconVisibility}" />
|
||||||
</Canvas>
|
</Canvas>
|
||||||
</Grid>
|
</Grid>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -391,8 +391,12 @@ namespace Flow.Launcher.ViewModel
|
||||||
// because it is more accurate and reliable representation than using Visibility as a condition check
|
// because it is more accurate and reliable representation than using Visibility as a condition check
|
||||||
public bool MainWindowVisibilityStatus { get; set; } = true;
|
public bool MainWindowVisibilityStatus { get; set; } = true;
|
||||||
|
|
||||||
|
public Visibility SearchIconVisibility { get; set; }
|
||||||
|
|
||||||
public double MainWindowWidth => _settings.WindowSize;
|
public double MainWindowWidth => _settings.WindowSize;
|
||||||
|
|
||||||
|
public string PluginIconPath { get; set; } = null;
|
||||||
|
|
||||||
public ICommand EscCommand { get; set; }
|
public ICommand EscCommand { get; set; }
|
||||||
public ICommand SelectNextItemCommand { get; set; }
|
public ICommand SelectNextItemCommand { get; set; }
|
||||||
public ICommand SelectPrevItemCommand { get; set; }
|
public ICommand SelectPrevItemCommand { get; set; }
|
||||||
|
|
@ -526,6 +530,8 @@ namespace Flow.Launcher.ViewModel
|
||||||
{
|
{
|
||||||
Results.Clear();
|
Results.Clear();
|
||||||
Results.Visbility = Visibility.Collapsed;
|
Results.Visbility = Visibility.Collapsed;
|
||||||
|
PluginIconPath = null;
|
||||||
|
SearchIconVisibility = Visibility.Visible;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -554,6 +560,18 @@ namespace Flow.Launcher.ViewModel
|
||||||
|
|
||||||
var plugins = PluginManager.ValidPluginsForQuery(query);
|
var plugins = PluginManager.ValidPluginsForQuery(query);
|
||||||
|
|
||||||
|
if (plugins.Count == 1)
|
||||||
|
{
|
||||||
|
PluginIconPath = plugins.Single().Metadata.IcoPath;
|
||||||
|
SearchIconVisibility = Visibility.Hidden;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
PluginIconPath = null;
|
||||||
|
SearchIconVisibility = Visibility.Visible;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
if (query.ActionKeyword == Plugin.Query.GlobalPluginWildcardSign)
|
if (query.ActionKeyword == Plugin.Query.GlobalPluginWildcardSign)
|
||||||
{
|
{
|
||||||
// Wait 45 millisecond for query change in global query
|
// Wait 45 millisecond for query change in global query
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue