Skip to content
This repository was archived by the owner on Jul 18, 2023. It is now read-only.

Commit 15967b6

Browse files
authored
Merge pull request #43 from onesounds/SettingPanel
Adjust Setting Panel Layout
2 parents 7de71eb + 72ee94e commit 15967b6

3 files changed

Lines changed: 82 additions & 68 deletions

File tree

EverythingSettings.xaml

Lines changed: 81 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -1,76 +1,101 @@
1-
<UserControl x:Class="Flow.Launcher.Plugin.Everything.EverythingSettings"
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:helper="clr-namespace:Flow.Launcher.Plugin.Everything.Helper"
7-
mc:Ignorable="d"
8-
Loaded="View_Loaded"
9-
d:DesignHeight="300" d:DesignWidth="426.4">
10-
<Grid Margin="7,50" VerticalAlignment="Top" >
1+
<UserControl
2+
x:Class="Flow.Launcher.Plugin.Everything.EverythingSettings"
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:helper="clr-namespace:Flow.Launcher.Plugin.Everything.Helper"
7+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
8+
d:DesignHeight="300"
9+
d:DesignWidth="426.4"
10+
Loaded="View_Loaded"
11+
mc:Ignorable="d">
12+
<Grid Margin="60,10,0,15" VerticalAlignment="Top">
1113
<Grid.RowDefinitions>
12-
<RowDefinition/>
13-
<RowDefinition/>
14-
<RowDefinition/>
15-
<RowDefinition Height="50"/>
16-
<RowDefinition Height="50"/>
14+
<RowDefinition />
15+
<RowDefinition />
16+
<RowDefinition />
17+
<RowDefinition />
18+
<RowDefinition Height="Auto" />
1719
</Grid.RowDefinitions>
1820
<Grid.ColumnDefinitions>
1921
<ColumnDefinition />
20-
<ColumnDefinition />
22+
<ColumnDefinition Width="2*" />
2123
<ColumnDefinition />
2224
</Grid.ColumnDefinitions>
2325
<Grid.Resources>
24-
<helper:EnumNameConverter x:Key="enumNameConverter"/>
26+
<helper:EnumNameConverter x:Key="enumNameConverter" />
2527
</Grid.Resources>
26-
<CheckBox Grid.Row="0" Grid.ColumnSpan="3" x:Name="UseLocationAsWorkingDir" Content="{DynamicResource
27-
flowlauncher_plugin_everything_use_location_as_working_dir}"
28-
Margin="10" HorizontalAlignment="Left" />
29-
<CheckBox Grid.Row="1" Grid.ColumnSpan="3" x:Name="LaunchHidden" Content="{DynamicResource flowlauncher_plugin_everything_launch_hidden}"
30-
Margin="10" HorizontalAlignment="Left" />
28+
<CheckBox
29+
x:Name="UseLocationAsWorkingDir"
30+
Grid.Row="0"
31+
Grid.ColumnSpan="3"
32+
Margin="10,6,18,6"
33+
HorizontalAlignment="Left"
34+
Content="{DynamicResource flowlauncher_plugin_everything_use_location_as_working_dir}" />
35+
<CheckBox
36+
x:Name="LaunchHidden"
37+
Grid.Row="1"
38+
Grid.ColumnSpan="3"
39+
Margin="10,6,18,6"
40+
HorizontalAlignment="Left"
41+
Content="{DynamicResource flowlauncher_plugin_everything_launch_hidden}" />
3142

32-
<Label Grid.Row="2" Margin="10" Content="{DynamicResource flowlauncher_plugin_everything_editor_path}"
33-
HorizontalAlignment="Left"/>
34-
<Label Grid.Row="2" Grid.Column="1" x:Name="EditorPath" Margin="10" HorizontalAlignment="Left" />
35-
<Button Grid.Row="2" Grid.Column="2" x:Name="OpenEditorPath" Content="..." Margin="10"
36-
HorizontalAlignment="Left" Click="EditorPath_Clicked"/>
37-
<TextBlock Grid.Row="3" Text="{DynamicResource flowlauncher_plugin_everything_customized_title}" Margin="10,0,0,0" VerticalAlignment="Center"
38-
ToolTip="{DynamicResource flowlauncher_plugin_everything_customized_tooltip}"/>
39-
<TextBox Grid.Row="3"
40-
Grid.Column="1"
41-
TextWrapping="NoWrap"
42-
VerticalAlignment="Center"
43-
HorizontalAlignment="Left"
44-
Width="150"
45-
Height="35"
46-
Margin="0,5,0,0"
47-
TextChanged="CustomizeExplorer" x:Name="CustomizeExplorerBox"/>
48-
<TextBlock Grid.Row="3" Grid.Column="2" Text="{DynamicResource flowlauncher_plugin_everything_customized_args}" VerticalAlignment="Center" Margin="5"
49-
ToolTip="{DynamicResource flowlauncher_plugin_everything_customized_args_tooltip}"></TextBlock>
50-
<TextBox Grid.Row="3" Grid.Column="2" HorizontalAlignment="Right"
51-
ToolTip="{DynamicResource flowlauncher_plugin_everything_customized_args_textbox}"
52-
Margin="0,0,5,0" Width="80" Height="35" x:Name="CustomizeArgsBox" TextChanged="CustomizeExplorerArgs"></TextBox>
53-
<TextBlock Margin="10 15 10 10" Text="{DynamicResource flowlauncher_plugin_everything_sort_by}" Grid.Row="4"/>
43+
<Label
44+
Grid.Row="2"
45+
Margin="10,6,6,6"
46+
HorizontalAlignment="Left"
47+
VerticalAlignment="Center"
48+
Content="{DynamicResource flowlauncher_plugin_everything_editor_path}" />
49+
<Label
50+
x:Name="EditorPath"
51+
Grid.Row="2"
52+
Grid.Column="1"
53+
Margin="10"
54+
HorizontalAlignment="Left"
55+
VerticalAlignment="Center" />
56+
<Button
57+
x:Name="OpenEditorPath"
58+
Grid.Row="2"
59+
Grid.Column="2"
60+
MinWidth="80"
61+
Margin="10"
62+
HorizontalAlignment="Left"
63+
Click="EditorPath_Clicked"
64+
Content="..." />
65+
<TextBlock
66+
Grid.Row="3"
67+
Margin="10"
68+
VerticalAlignment="Center"
69+
Text="{DynamicResource flowlauncher_plugin_everything_sort_by}" />
5470

55-
<ComboBox Grid.Row="4"
56-
Grid.Column="1"
57-
Width="200"
58-
Margin="0 10 0 0"
59-
SelectedItem="{Binding SortOption}"
60-
ItemsSource="{Binding GetSortOptions, Mode=OneWay}"
61-
SelectionChanged="onSelectionChange">
71+
<ComboBox
72+
Grid.Row="3"
73+
Grid.Column="1"
74+
Width="200"
75+
Margin="10"
76+
ItemsSource="{Binding GetSortOptions, Mode=OneWay}"
77+
SelectedItem="{Binding SortOption}"
78+
SelectionChanged="onSelectionChange">
6279
<ComboBox.ItemTemplate>
6380
<DataTemplate>
6481
<Grid>
65-
<TextBlock Text="{Binding Converter={StaticResource enumNameConverter}}"/>
82+
<TextBlock Text="{Binding Converter={StaticResource enumNameConverter}}" />
6683
</Grid>
6784
</DataTemplate>
6885
</ComboBox.ItemTemplate>
6986
</ComboBox>
7087

71-
<TextBlock Name ="tbFastSortWarning" Grid.Row="4" Grid.Column="2" Margin="10 5 10 0" TextAlignment="Left"
72-
Text="{Binding GetSortOptionWarningMessage}"
73-
Visibility ="{Binding FastSortWarningVisibility}"
74-
Foreground="Orange" TextWrapping="Wrap" />
88+
<TextBlock
89+
Name="tbFastSortWarning"
90+
Grid.Row="4"
91+
Grid.Column="0"
92+
Grid.ColumnSpan="3"
93+
Margin="10,20,10,20"
94+
VerticalAlignment="Center"
95+
Foreground="Orange"
96+
Text="{Binding GetSortOptionWarningMessage}"
97+
TextAlignment="Left"
98+
TextWrapping="Wrap"
99+
Visibility="{Binding FastSortWarningVisibility}" />
75100
</Grid>
76101
</UserControl>

EverythingSettings.xaml.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,6 @@ private void View_Loaded(object sender, RoutedEventArgs re)
4646
};
4747

4848
EditorPath.Content = settings.EditorPath;
49-
CustomizeExplorerBox.Text = settings.ExplorerPath;
50-
CustomizeArgsBox.Text = settings.ExplorerArgs;
5149
}
5250

5351
private void EditorPath_Clicked(object sender, RoutedEventArgs e)
@@ -65,15 +63,6 @@ private void EditorPath_Clicked(object sender, RoutedEventArgs e)
6563
EditorPath.Content = settings.EditorPath;
6664
}
6765

68-
private void CustomizeExplorer(object sender, TextChangedEventArgs e)
69-
{
70-
settings.ExplorerPath = CustomizeExplorerBox.Text;
71-
}
72-
73-
private void CustomizeExplorerArgs(object sender, TextChangedEventArgs e)
74-
{
75-
settings.ExplorerArgs = CustomizeArgsBox.Text;
76-
}
7766

7867
private void onSelectionChange(object sender, SelectionChangedEventArgs e)
7968
{

ViewModels/SettingsViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ public Visibility FastSortWarningVisibility
2424
{
2525
try
2626
{
27-
return api.IsFastSortOption(settings.SortOption) ? Visibility.Hidden : Visibility.Visible;
27+
return api.IsFastSortOption(settings.SortOption) ? Visibility.Collapsed : Visibility.Visible;
2828
}
2929
catch (IPCErrorException)
3030
{

0 commit comments

Comments
 (0)