Skip to content

Commit b11f728

Browse files
authored
Merge pull request #867 from onesounds/AdjustExplorerPlugin
[dev] Adjust popup in explorer plugin with string
2 parents 0d64283 + b38a662 commit b11f728

File tree

5 files changed

+244
-88
lines changed

5 files changed

+244
-88
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Languages/en.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
<system:String x:Key="plugin_explorer_actionkeywordview_filecontentsearch">File Content Search:</system:String>
3030
<system:String x:Key="plugin_explorer_actionkeywordview_indexsearch">Index Search:</system:String>
3131
<system:String x:Key="plugin_explorer_actionkeywordview_quickaccess">Quick Access:</system:String>
32-
<system:String x:Key="plugin_explorer_actionkeyword_current">Current Action Keyword:</system:String>
32+
<system:String x:Key="plugin_explorer_actionkeyword_current">Current Action Keyword</system:String>
3333
<system:String x:Key="plugin_explorer_actionkeyword_done">Done</system:String>
3434
<system:String x:Key="plugin_explorer_actionkeyword_enabled">Enabled</system:String>
3535
<system:String x:Key="plugin_explorer_actionkeyword_enabled_tooltip">When disabled Flow will not execute this search option, and will additionally revert back to '*' to free up the action keyword</system:String>
Lines changed: 123 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,129 @@
1-
<Window x:Class="Flow.Launcher.Plugin.Explorer.Views.ActionKeywordSetting"
2-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
5-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6-
xmlns:local="clr-namespace:Flow.Launcher.Plugin.Explorer.Views"
7-
mc:Ignorable="d"
8-
ResizeMode="NoResize"
9-
WindowStartupLocation="CenterScreen"
10-
DataContext="{Binding RelativeSource={RelativeSource Self}}"
11-
Title="Action Keyword Setting" Height="200" Width="500">
1+
<Window
2+
x:Class="Flow.Launcher.Plugin.Explorer.Views.ActionKeywordSetting"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:local="clr-namespace:Flow.Launcher.Plugin.Explorer.Views"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
Title="{DynamicResource plugin_explorer_manageactionkeywords_header}"
9+
Width="400"
10+
SizeToContent="Height"
11+
Background="{DynamicResource PopuBGColor}"
12+
DataContext="{Binding RelativeSource={RelativeSource Self}}"
13+
Foreground="{DynamicResource PopupTextColor}"
14+
ResizeMode="NoResize"
15+
WindowStartupLocation="CenterScreen"
16+
mc:Ignorable="d">
17+
<WindowChrome.WindowChrome>
18+
<WindowChrome CaptionHeight="32" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
19+
</WindowChrome.WindowChrome>
1220
<Grid>
1321
<Grid.RowDefinitions>
1422
<RowDefinition />
15-
<RowDefinition />
23+
<RowDefinition Height="80" />
1624
</Grid.RowDefinitions>
17-
<Grid.ColumnDefinitions>
18-
<ColumnDefinition Width="180" />
19-
<ColumnDefinition />
20-
<ColumnDefinition />
21-
</Grid.ColumnDefinitions>
22-
<TextBlock Margin="20 10 10 10" FontSize="14" Grid.Row="0" Grid.Column="0" VerticalAlignment="Center"
23-
HorizontalAlignment="Left" Text="{DynamicResource plugin_explorer_actionkeyword_current}" />
24-
<TextBox Name="TxtCurrentActionKeyword"
25-
Margin="10" Grid.Row="0" Width="105" Grid.Column="1"
26-
VerticalAlignment="Center"
27-
HorizontalAlignment="Left"
28-
Text="{Binding ActionKeyword}"
29-
PreviewKeyDown="TxtCurrentActionKeyword_OnKeyDown"/>
30-
<CheckBox Name="ChkActionKeywordEnabled" ToolTip="{DynamicResource plugin_explorer_actionkeyword_enabled_tooltip}"
31-
Margin="10" Grid.Row="0" Grid.Column="2" Content="{DynamicResource plugin_explorer_actionkeyword_enabled}"
32-
Width="auto"
33-
VerticalAlignment="Center" IsChecked="{Binding Enabled}" />
34-
<Button Name="DownButton"
35-
Click="OnDoneButtonClick" Grid.Row="1" Grid.Column="2"
36-
Margin="10 0 10 0" Width="80" Height="35"
37-
Content="{DynamicResource plugin_explorer_actionkeyword_done}" />
25+
26+
<StackPanel Grid.Row="0">
27+
<StackPanel>
28+
<Grid>
29+
<Grid.ColumnDefinitions>
30+
<ColumnDefinition Width="Auto" />
31+
<ColumnDefinition Width="*" />
32+
<ColumnDefinition Width="Auto" />
33+
<ColumnDefinition Width="Auto" />
34+
<ColumnDefinition Width="Auto" />
35+
</Grid.ColumnDefinitions>
36+
<Button
37+
Grid.Column="4"
38+
Click="BtnCancel_OnClick"
39+
Style="{StaticResource TitleBarCloseButtonStyle}">
40+
<Path
41+
Width="46"
42+
Height="32"
43+
Data="M 18,11 27,20 M 18,20 27,11"
44+
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
45+
StrokeThickness="1">
46+
<Path.Style>
47+
<Style TargetType="Path">
48+
<Style.Triggers>
49+
<DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
50+
<Setter Property="Opacity" Value="0.5" />
51+
</DataTrigger>
52+
</Style.Triggers>
53+
</Style>
54+
</Path.Style>
55+
</Path>
56+
</Button>
57+
</Grid>
58+
</StackPanel>
59+
<StackPanel Margin="26,0,26,0">
60+
<StackPanel Margin="0,0,0,12">
61+
<TextBlock
62+
Margin="0,0,0,0"
63+
FontFamily="Segoe UI"
64+
FontSize="20"
65+
FontWeight="SemiBold"
66+
Text="{DynamicResource plugin_explorer_manageactionkeywords_header}"
67+
TextAlignment="Left" />
68+
</StackPanel>
69+
70+
<StackPanel Margin="0,10,0,0" Orientation="Horizontal">
71+
<TextBlock
72+
Width="150"
73+
Margin="0,10,15,10"
74+
HorizontalAlignment="Left"
75+
VerticalAlignment="Center"
76+
FontSize="14"
77+
Text="{DynamicResource plugin_explorer_actionkeyword_current}" />
78+
<TextBox
79+
Name="TxtCurrentActionKeyword"
80+
Grid.Row="0"
81+
Grid.Column="1"
82+
Width="105"
83+
HorizontalAlignment="Left"
84+
VerticalAlignment="Center"
85+
PreviewKeyDown="TxtCurrentActionKeyword_OnKeyDown"
86+
Text="{Binding ActionKeyword}" />
87+
</StackPanel>
88+
<StackPanel Margin="0,10,0,15" Orientation="Horizontal">
89+
<TextBlock Margin="0 0 15 0 "
90+
HorizontalAlignment="Left"
91+
VerticalAlignment="Center"
92+
FontSize="14"
93+
Width="150"
94+
Text="{DynamicResource plugin_explorer_actionkeyword_enabled}" />
95+
<CheckBox
96+
Name="ChkActionKeywordEnabled"
97+
Width="auto"
98+
VerticalAlignment="Center"
99+
IsChecked="{Binding Enabled}"
100+
ToolTip="{DynamicResource plugin_explorer_actionkeyword_enabled_tooltip}" />
101+
</StackPanel>
102+
</StackPanel>
103+
</StackPanel>
104+
<Border
105+
Grid.Row="1"
106+
Background="{DynamicResource PopupButtonAreaBGColor}"
107+
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
108+
BorderThickness="0,1,0,0">
109+
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
110+
<Button
111+
x:Name="btnCancel"
112+
Width="145"
113+
Height="30"
114+
Margin="0,0,5,0"
115+
Click="BtnCancel_OnClick"
116+
Content="{DynamicResource cancel}" />
117+
<Button
118+
Name="DownButton"
119+
Width="145"
120+
Height="30"
121+
Margin="5,0,0,0"
122+
Click="OnDoneButtonClick"
123+
Style="{StaticResource AccentButtonStyle}">
124+
<TextBlock x:Name="lblAdd" Text="{DynamicResource plugin_explorer_actionkeyword_done}" />
125+
</Button>
126+
</StackPanel>
127+
</Border>
38128
</Grid>
39129
</Window>

Plugins/Flow.Launcher.Plugin.Explorer/Views/ActionKeywordSetting.xaml.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,10 @@ private void OnDoneButtonClick(object sender, RoutedEventArgs e)
100100
MessageBox.Show(settingsViewModel.Context.API.GetTranslation("newActionKeywordsHasBeenAssigned"));
101101
}
102102

103+
private void BtnCancel_OnClick(object sender, RoutedEventArgs e)
104+
{
105+
Close();
106+
}
103107
private void TxtCurrentActionKeyword_OnKeyDown(object sender, KeyEventArgs e)
104108
{
105109
if (e.Key == Key.Enter)

Plugins/Flow.Launcher.Plugin.Explorer/Views/ExplorerSettings.xaml

Lines changed: 116 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -1,82 +1,145 @@
1-
<UserControl x:Class="Flow.Launcher.Plugin.Explorer.Views.ExplorerSettings"
2-
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
3-
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
4-
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
5-
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6-
xmlns:viewModels="clr-namespace:Flow.Launcher.Plugin.Explorer.ViewModels"
7-
xmlns:views="clr-namespace:Flow.Launcher.Plugin.Explorer.Views"
8-
mc:Ignorable="d"
9-
d:DesignHeight="450" d:DesignWidth="800">
1+
<UserControl
2+
x:Class="Flow.Launcher.Plugin.Explorer.Views.ExplorerSettings"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
6+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
7+
xmlns:viewModels="clr-namespace:Flow.Launcher.Plugin.Explorer.ViewModels"
8+
xmlns:views="clr-namespace:Flow.Launcher.Plugin.Explorer.Views"
9+
d:DesignHeight="450"
10+
d:DesignWidth="800"
11+
mc:Ignorable="d">
1012
<UserControl.Resources>
1113
<DataTemplate x:Key="ListViewTemplateAccessLinks">
12-
<TextBlock
13-
Text="{Binding Path, Mode=OneTime}"
14-
Margin="0,5,0,5" />
14+
<TextBlock Margin="0,5,0,5" Text="{Binding Path, Mode=OneTime}" />
1515
</DataTemplate>
1616
<DataTemplate x:Key="ListViewTemplateExcludedPaths">
17-
<TextBlock
18-
Text="{Binding Path, Mode=OneTime}"
19-
Margin="0,5,0,5" />
17+
<TextBlock Margin="0,5,0,5" Text="{Binding Path, Mode=OneTime}" />
2018
</DataTemplate>
21-
<DataTemplate x:Key="ListViewActionKeywords"
22-
DataType="views:ActionKeywordView">
19+
<DataTemplate x:Key="ListViewActionKeywords" DataType="views:ActionKeywordView">
2320
<Grid>
24-
<TextBlock
25-
Text="{Binding Description, Mode=OneTime}"
26-
Foreground="{Binding Color, Mode=OneWay}"
27-
Margin="0,5,0,0" />
28-
<TextBlock
29-
Text="{Binding Keyword, Mode=OneTime}"
30-
Foreground="{Binding Color, Mode=OneWay}"
31-
Margin="250,5,0,0" />
21+
<TextBlock
22+
Margin="0,5,0,0"
23+
IsEnabled="{Binding Enabled}"
24+
Text="{Binding Description, Mode=OneTime}">
25+
<TextBlock.Style>
26+
<Style TargetType="{x:Type TextBlock}">
27+
<Style.Triggers>
28+
<Trigger Property="IsEnabled" Value="True">
29+
<Setter Property="Foreground" Value="{DynamicResource Color05B}" />
30+
</Trigger>
31+
<Trigger Property="IsEnabled" Value="False">
32+
<Setter Property="Foreground" Value="{DynamicResource Color18B}" />
33+
</Trigger>
34+
</Style.Triggers>
35+
</Style>
36+
</TextBlock.Style>
37+
</TextBlock>
38+
<TextBlock
39+
Margin="250,5,0,0"
40+
IsEnabled="{Binding Enabled}"
41+
Text="{Binding Keyword, Mode=OneTime}">
42+
<TextBlock.Style>
43+
<Style TargetType="{x:Type TextBlock}">
44+
<Style.Triggers>
45+
<Trigger Property="IsEnabled" Value="True">
46+
<Setter Property="Foreground" Value="{DynamicResource Color05B}" />
47+
</Trigger>
48+
<Trigger Property="IsEnabled" Value="False">
49+
<Setter Property="Foreground" Value="{DynamicResource Color18B}" />
50+
</Trigger>
51+
</Style.Triggers>
52+
</Style>
53+
</TextBlock.Style>
54+
</TextBlock>
3255
</Grid>
3356
</DataTemplate>
3457
</UserControl.Resources>
3558
<Grid Margin="10">
3659
<Grid.RowDefinitions>
37-
<RowDefinition Height="*"/>
38-
<RowDefinition Height="100"/>
60+
<RowDefinition Height="*" />
61+
<RowDefinition Height="100" />
3962
</Grid.RowDefinitions>
40-
<ScrollViewer Margin="20 35 0 0" HorizontalScrollBarVisibility="Hidden" Grid.Row="0" VerticalScrollBarVisibility="Auto">
63+
<ScrollViewer
64+
Grid.Row="0"
65+
Margin="20,35,0,0"
66+
HorizontalScrollBarVisibility="Hidden"
67+
VerticalScrollBarVisibility="Auto">
4168
<StackPanel>
42-
<Expander Name="expActionKeywords" Header="{DynamicResource plugin_explorer_manageactionkeywords_header}"
43-
Expanded="expActionKeywords_Click" Collapsed="expActionKeywords_Collapsed">
44-
<ListView x:Name="lbxActionKeywords"
45-
ItemTemplate="{StaticResource ListViewActionKeywords}"/>
69+
<Expander
70+
Name="expActionKeywords"
71+
Collapsed="expActionKeywords_Collapsed"
72+
Expanded="expActionKeywords_Click"
73+
Header="{DynamicResource plugin_explorer_manageactionkeywords_header}">
74+
<ListView x:Name="lbxActionKeywords" ItemTemplate="{StaticResource ListViewActionKeywords}" />
4675
</Expander>
47-
<Expander Name="expAccessLinks" Header="{DynamicResource plugin_explorer_quickaccesslinks_header}"
48-
Expanded="expAccessLinks_Click" Collapsed="expAccessLinks_Collapsed"
49-
Margin="0 10 0 0">
76+
<Expander
77+
Name="expAccessLinks"
78+
Margin="0,10,0,0"
79+
Collapsed="expAccessLinks_Collapsed"
80+
Expanded="expAccessLinks_Click"
81+
Header="{DynamicResource plugin_explorer_quickaccesslinks_header}">
5082
<ListView
51-
x:Name="lbxAccessLinks" AllowDrop="True"
52-
Drop="lbxAccessLinks_Drop"
83+
x:Name="lbxAccessLinks"
84+
AllowDrop="True"
5385
DragEnter="lbxAccessLinks_DragEnter"
54-
ItemTemplate="{StaticResource ListViewTemplateAccessLinks}"/>
86+
Drop="lbxAccessLinks_Drop"
87+
ItemTemplate="{StaticResource ListViewTemplateAccessLinks}" />
5588
</Expander>
56-
<Expander x:Name="expExcludedPaths" Header="{DynamicResource plugin_explorer_indexsearchexcludedpaths_header}"
57-
Expanded="expExcludedPaths_Click"
58-
Margin="0 10 0 0">
89+
<Expander
90+
x:Name="expExcludedPaths"
91+
Margin="0,10,0,0"
92+
Expanded="expExcludedPaths_Click"
93+
Header="{DynamicResource plugin_explorer_indexsearchexcludedpaths_header}">
5994
<ListView
60-
x:Name="lbxExcludedPaths" AllowDrop="True"
61-
Drop="lbxAccessLinks_Drop"
95+
x:Name="lbxExcludedPaths"
96+
AllowDrop="True"
6297
DragEnter="lbxAccessLinks_DragEnter"
63-
ItemTemplate="{StaticResource ListViewTemplateExcludedPaths}"/>
98+
Drop="lbxAccessLinks_Drop"
99+
ItemTemplate="{StaticResource ListViewTemplateExcludedPaths}" />
64100
</Expander>
65101
</StackPanel>
66102
</ScrollViewer>
67103
<Grid Grid.Row="1">
68104
<Grid.ColumnDefinitions>
69-
<ColumnDefinition Width="*"/>
70-
<ColumnDefinition Width="350"/>
105+
<ColumnDefinition Width="*" />
106+
<ColumnDefinition Width="350" />
71107
</Grid.ColumnDefinitions>
72-
<StackPanel Grid.Row="1" Grid.Column="0" HorizontalAlignment="Left" Orientation="Horizontal">
73-
<Button x:Name="btnIndexingOptions" Click="btnOpenIndexingOptions_Click" Width="130" Margin="10"
74-
Content="{DynamicResource plugin_explorer_manageindexoptions}"/>
108+
<StackPanel
109+
Grid.Row="1"
110+
Grid.Column="0"
111+
HorizontalAlignment="Left"
112+
Orientation="Horizontal">
113+
<Button
114+
x:Name="btnIndexingOptions"
115+
Width="130"
116+
Margin="10"
117+
Click="btnOpenIndexingOptions_Click"
118+
Content="{DynamicResource plugin_explorer_manageindexoptions}" />
75119
</StackPanel>
76-
<StackPanel Grid.Row="1" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
77-
<Button x:Name="btnDelete" Click="btnDelete_Click" Width="100" Margin="10" Content="{DynamicResource plugin_explorer_delete}"/>
78-
<Button x:Name="btnEdit" Click="btnEdit_Click" Width="100" Margin="10" Content="{DynamicResource plugin_explorer_edit}"/>
79-
<Button x:Name="btnAdd" Click="btnAdd_Click" Width="100" Margin="10" Content="{DynamicResource plugin_explorer_add}"/>
120+
<StackPanel
121+
Grid.Row="1"
122+
Grid.Column="1"
123+
HorizontalAlignment="Right"
124+
Orientation="Horizontal">
125+
<Button
126+
x:Name="btnDelete"
127+
Width="100"
128+
Margin="10"
129+
Click="btnDelete_Click"
130+
Content="{DynamicResource plugin_explorer_delete}" />
131+
<Button
132+
x:Name="btnEdit"
133+
Width="100"
134+
Margin="10"
135+
Click="btnEdit_Click"
136+
Content="{DynamicResource plugin_explorer_edit}" />
137+
<Button
138+
x:Name="btnAdd"
139+
Width="100"
140+
Margin="10"
141+
Click="btnAdd_Click"
142+
Content="{DynamicResource plugin_explorer_add}" />
80143
</StackPanel>
81144
</Grid>
82145
</Grid>

0 commit comments

Comments
 (0)