Skip to content

Commit 12fdeff

Browse files
committed
Adjust Popup Layout
Adjust Button Size
1 parent cb77fbf commit 12fdeff

File tree

7 files changed

+297
-89
lines changed

7 files changed

+297
-89
lines changed

Flow.Launcher/PriorityChangeWindow.xaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,14 +105,12 @@
105105
<Button
106106
x:Name="btnCancel"
107107
Width="100"
108-
Height="30"
109108
Margin="0,0,5,0"
110109
Click="BtnCancel_OnClick"
111110
Content="{DynamicResource cancel}" />
112111
<Button
113112
x:Name="btnDone"
114113
Width="100"
115-
Height="30"
116114
Margin="5,0,0,0"
117115
Click="btnDone_OnClick">
118116
<TextBlock x:Name="lblAdd" Text="{DynamicResource done}" />
Lines changed: 126 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,132 @@
1-
<Window x:Class="Flow.Launcher.Plugin.Program.AddProgramSource"
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-
mc:Ignorable="d"
7-
Width="400"
8-
Height="130"
9-
WindowStartupLocation="CenterScreen">
1+
<Window
2+
x:Class="Flow.Launcher.Plugin.Program.AddProgramSource"
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+
Title="{DynamicResource flowlauncher_plugin_program_directory}"
8+
Width="400"
9+
Background="{DynamicResource PopuBGColor}"
10+
Foreground="{DynamicResource PopupTextColor}"
11+
SizeToContent="Height"
12+
WindowStartupLocation="CenterScreen"
13+
mc:Ignorable="d">
14+
<WindowChrome.WindowChrome>
15+
<WindowChrome CaptionHeight="32" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
16+
</WindowChrome.WindowChrome>
17+
<Grid>
18+
<Grid.RowDefinitions>
19+
<RowDefinition />
20+
<RowDefinition Height="80" />
21+
</Grid.RowDefinitions>
22+
23+
<StackPanel Grid.Row="0">
24+
<StackPanel>
25+
<Grid>
26+
<Grid.ColumnDefinitions>
27+
<ColumnDefinition Width="Auto" />
28+
<ColumnDefinition Width="*" />
29+
<ColumnDefinition Width="Auto" />
30+
<ColumnDefinition Width="Auto" />
31+
<ColumnDefinition Width="Auto" />
32+
</Grid.ColumnDefinitions>
33+
<Button
34+
Grid.Column="4"
35+
Click="BtnCancel_OnClick"
36+
Style="{StaticResource TitleBarCloseButtonStyle}">
37+
<Path
38+
Width="46"
39+
Height="32"
40+
Data="M 18,11 27,20 M 18,20 27,11"
41+
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
42+
StrokeThickness="1">
43+
<Path.Style>
44+
<Style TargetType="Path">
45+
<Style.Triggers>
46+
<DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
47+
<Setter Property="Opacity" Value="0.5" />
48+
</DataTrigger>
49+
</Style.Triggers>
50+
</Style>
51+
</Path.Style>
52+
</Path>
53+
</Button>
54+
</Grid>
55+
</StackPanel>
56+
<StackPanel Margin="26,12,26,0">
57+
<StackPanel Margin="0,0,0,12">
58+
<TextBlock
59+
Grid.Column="0"
60+
Margin="0,0,0,0"
61+
FontFamily="Segoe UI"
62+
FontSize="20"
63+
FontWeight="SemiBold"
64+
Text="{DynamicResource flowlauncher_plugin_program_directory}"
65+
TextAlignment="Left" />
66+
</StackPanel>
67+
<StackPanel Margin="0,0,0,10" Orientation="Horizontal">
68+
<TextBox
69+
Name="Directory"
70+
Width="268"
71+
Margin="0,7"
72+
VerticalAlignment="Center" />
73+
<Button
74+
Width="70"
75+
Margin="10"
76+
HorizontalAlignment="Right"
77+
Click="BrowseButton_Click"
78+
Content="{DynamicResource flowlauncher_plugin_program_browse}" />
79+
</StackPanel>
80+
</StackPanel>
81+
</StackPanel>
82+
<Border
83+
Grid.Row="1"
84+
Background="{DynamicResource PopupButtonAreaBGColor}"
85+
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
86+
BorderThickness="0,1,0,0">
87+
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
88+
<Button
89+
x:Name="btnCancel"
90+
Width="100"
91+
Margin="0,0,5,0"
92+
Click="BtnCancel_OnClick"
93+
Content="{DynamicResource cancel}" />
94+
95+
<Button
96+
Width="100"
97+
Margin="10"
98+
HorizontalAlignment="Right"
99+
Click="ButtonAdd_OnClick"
100+
Content="{DynamicResource flowlauncher_plugin_program_update}" />
101+
</StackPanel>
102+
</Border>
103+
</Grid>
104+
<!--
10105
<StackPanel Orientation="Vertical">
11106
<StackPanel Orientation="Horizontal">
12-
<Label Content="{DynamicResource flowlauncher_plugin_program_directory}" Margin="15,10"/>
13-
<TextBox Name="Directory" VerticalAlignment="Center" Width="278" Margin="10,7" />
107+
<Label Margin="15,10" Content="{DynamicResource flowlauncher_plugin_program_directory}" />
108+
<TextBox
109+
Name="Directory"
110+
Width="278"
111+
Margin="10,7"
112+
VerticalAlignment="Center" />
14113
</StackPanel>
15-
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right">
16-
<Button Click="BrowseButton_Click" Content="{DynamicResource flowlauncher_plugin_program_browse}"
17-
HorizontalAlignment="Right" Margin="10" Height="31" Width="70" />
18-
<Button Click="ButtonAdd_OnClick" Content="{DynamicResource flowlauncher_plugin_program_update}"
19-
HorizontalAlignment="Right" Margin="10" Height="31" Width="70" />
114+
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
115+
<Button
116+
Width="70"
117+
Height="31"
118+
Margin="10"
119+
HorizontalAlignment="Right"
120+
Click="BrowseButton_Click"
121+
Content="{DynamicResource flowlauncher_plugin_program_browse}" />
122+
<Button
123+
Width="70"
124+
Height="31"
125+
Margin="10"
126+
HorizontalAlignment="Right"
127+
Click="ButtonAdd_OnClick"
128+
Content="{DynamicResource flowlauncher_plugin_program_update}" />
20129
</StackPanel>
21130
</StackPanel>
131+
-->
22132
</Window>

Plugins/Flow.Launcher.Plugin.Program/AddProgramSource.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,11 @@ private void BrowseButton_Click(object sender, RoutedEventArgs e)
4242
}
4343
}
4444

45+
private void BtnCancel_OnClick(object sender, RoutedEventArgs e)
46+
{
47+
Close();
48+
}
49+
4550
private void ButtonAdd_OnClick(object sender, RoutedEventArgs e)
4651
{
4752
string s = Directory.Text;

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

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -19,12 +19,12 @@
1919
<system:String x:Key="flowlauncher_plugin_program_index_registry_tooltip">When enabled, Flow will load programs from the registry</system:String>
2020
<system:String x:Key="flowlauncher_plugin_program_enable_hidelnkpath">Hide Apps path</system:String>
2121
<system:String x:Key="flowlauncher_plugin_program_enable_hidelnkpath_tooltip">For executable files such as UWP or lnk, hide the file path from being visible</system:String>
22-
<system:String x:Key="flowlauncher_plugin_program_enable_description">Enable Program Description</system:String>
22+
<system:String x:Key="flowlauncher_plugin_program_enable_description">Search in Program Description</system:String>
2323
<system:String x:Key="flowlauncher_plugin_program_enable_description_tooltip">Disabling this will also stop Flow from searching via the program desciption</system:String>
2424
<system:String x:Key="flowlauncher_plugin_program_suffixes_header">Suffixes</system:String>
2525
<system:String x:Key="flowlauncher_plugin_program_max_depth_header">Max Depth</system:String>
2626

27-
<system:String x:Key="flowlauncher_plugin_program_directory">Directory:</system:String>
27+
<system:String x:Key="flowlauncher_plugin_program_directory">Directory</system:String>
2828
<system:String x:Key="flowlauncher_plugin_program_browse">Browse</system:String>
2929
<system:String x:Key="flowlauncher_plugin_program_file_suffixes">File Suffixes:</system:String>
3030
<system:String x:Key="flowlauncher_plugin_program_max_search_depth">Maximum Search Depth (-1 is unlimited):</system:String>
@@ -33,8 +33,7 @@
3333
<system:String x:Key="flowlauncher_plugin_program_delete_program_source">Are you sure you want to delete the selected program sources?</system:String>
3434

3535
<system:String x:Key="flowlauncher_plugin_program_update">OK</system:String>
36-
<system:String x:Key="flowlauncher_plugin_program_only_index_tip">Flow Launcher will only index files that end with the following suffixes:</system:String>
37-
<system:String x:Key="flowlauncher_plugin_program_split_by_tip">(Each suffix should split by ';' )</system:String>
36+
<system:String x:Key="flowlauncher_plugin_program_only_index_tip">Flow Launcher will only index files that end with the following suffixes. (Each suffix should split by ';' )</system:String>
3837
<system:String x:Key="flowlauncher_plugin_program_update_file_suffixes">Successfully updated file suffixes</system:String>
3938
<system:String x:Key="flowlauncher_plugin_program_suffixes_cannot_empty">File suffixes can't be empty</system:String>
4039

Plugins/Flow.Launcher.Plugin.Program/ProgramSuffixes.xaml

Lines changed: 98 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,101 @@
1-
<Window x:Class="Flow.Launcher.Plugin.Program.ProgramSuffixes"
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-
mc:Ignorable="d"
7-
Width="400"
8-
Height="180"
9-
WindowStartupLocation="CenterScreen"
10-
d:DesignHeight="400" d:DesignWidth="300">
11-
<StackPanel>
12-
<TextBlock Margin="10 10 0 0" Foreground="Gray" Text="{DynamicResource flowlauncher_plugin_program_only_index_tip}" />
13-
<TextBlock Margin="10 10 0 0" Foreground="Gray" Text="{DynamicResource flowlauncher_plugin_program_split_by_tip}" />
14-
<TextBox x:Name="tbSuffixes" Margin="10"/>
15-
<Button HorizontalAlignment="Right" Height="30" Width="80" Click="ButtonBase_OnClick" Margin="0 0 10 0" Content="{DynamicResource flowlauncher_plugin_program_update}" />
16-
</StackPanel>
1+
<Window
2+
x:Class="Flow.Launcher.Plugin.Program.ProgramSuffixes"
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+
Title="{DynamicResource flowlauncher_plugin_program_suffixes}"
8+
Width="400"
9+
Background="{DynamicResource PopuBGColor}"
10+
Foreground="{DynamicResource PopupTextColor}"
11+
ResizeMode="NoResize"
12+
SizeToContent="Height"
13+
WindowStartupLocation="CenterScreen"
14+
mc:Ignorable="d">
15+
<WindowChrome.WindowChrome>
16+
<WindowChrome CaptionHeight="32" ResizeBorderThickness="{x:Static SystemParameters.WindowResizeBorderThickness}" />
17+
</WindowChrome.WindowChrome>
18+
<Grid>
19+
<Grid.RowDefinitions>
20+
<RowDefinition />
21+
<RowDefinition Height="80" />
22+
</Grid.RowDefinitions>
23+
24+
<StackPanel Grid.Row="0">
25+
<StackPanel>
26+
<Grid>
27+
<Grid.ColumnDefinitions>
28+
<ColumnDefinition Width="Auto" />
29+
<ColumnDefinition Width="*" />
30+
<ColumnDefinition Width="Auto" />
31+
<ColumnDefinition Width="Auto" />
32+
<ColumnDefinition Width="Auto" />
33+
</Grid.ColumnDefinitions>
34+
<Button
35+
Grid.Column="4"
36+
Click="BtnCancel_OnClick"
37+
Style="{StaticResource TitleBarCloseButtonStyle}">
38+
<Path
39+
Width="46"
40+
Height="32"
41+
Data="M 18,11 27,20 M 18,20 27,11"
42+
Stroke="{Binding Path=Foreground, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
43+
StrokeThickness="1">
44+
<Path.Style>
45+
<Style TargetType="Path">
46+
<Style.Triggers>
47+
<DataTrigger Binding="{Binding Path=IsActive, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type Window}}}" Value="False">
48+
<Setter Property="Opacity" Value="0.5" />
49+
</DataTrigger>
50+
</Style.Triggers>
51+
</Style>
52+
</Path.Style>
53+
</Path>
54+
</Button>
55+
</Grid>
56+
</StackPanel>
57+
<StackPanel Margin="26,12,26,0">
58+
<StackPanel Margin="0,0,0,12">
59+
<TextBlock
60+
Grid.Column="0"
61+
Margin="0,0,0,0"
62+
FontFamily="Segoe UI"
63+
FontSize="20"
64+
FontWeight="SemiBold"
65+
Text="{DynamicResource flowlauncher_plugin_program_suffixes}"
66+
TextAlignment="Left" />
67+
</StackPanel>
68+
<TextBlock
69+
FontSize="14"
70+
Text="{DynamicResource flowlauncher_plugin_program_only_index_tip}"
71+
TextWrapping="Wrap" />
72+
<TextBox x:Name="tbSuffixes" Margin="0,20,0,20" />
73+
</StackPanel>
74+
</StackPanel>
75+
<Border
76+
Grid.Row="1"
77+
Background="{DynamicResource PopupButtonAreaBGColor}"
78+
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
79+
BorderThickness="0,1,0,0">
80+
<StackPanel HorizontalAlignment="Center" Orientation="Horizontal">
81+
<Button
82+
x:Name="btnCancel"
83+
Width="100"
84+
Height="30"
85+
Margin="0,0,5,0"
86+
Click="BtnCancel_OnClick"
87+
Content="{DynamicResource cancel}" />
88+
89+
<Button
90+
Width="100"
91+
Height="30"
92+
Margin="5,0,0,0"
93+
HorizontalAlignment="Right"
94+
Click="ButtonBase_OnClick"
95+
Content="{DynamicResource flowlauncher_plugin_program_update}" />
96+
</StackPanel>
97+
</Border>
98+
</Grid>
1799
</Window>
18100

19101

Plugins/Flow.Launcher.Plugin.Program/ProgramSuffixes.xaml.cs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,10 @@ public ProgramSuffixes(PluginInitContext context, Settings settings)
1818
_settings = settings;
1919
tbSuffixes.Text = string.Join(Settings.SuffixSeperator.ToString(), _settings.ProgramSuffixes);
2020
}
21-
21+
private void BtnCancel_OnClick(object sender, RoutedEventArgs e)
22+
{
23+
Close();
24+
}
2225
private void ButtonBase_OnClick(object sender, RoutedEventArgs e)
2326
{
2427
var suffixes = tbSuffixes.Text.Split(Settings.SuffixSeperator, StringSplitOptions.RemoveEmptyEntries);

0 commit comments

Comments
 (0)