Skip to content

Commit c87b731

Browse files
authored
Merge branch 'dev' into plugin_settings_cache_path
2 parents e3af882 + dda008f commit c87b731

File tree

13 files changed

+1138
-974
lines changed

13 files changed

+1138
-974
lines changed

Flow.Launcher.Core/Plugin/JsonRPCPluginSettings.cs

Lines changed: 331 additions & 289 deletions
Large diffs are not rendered by default.

Flow.Launcher/Resources/Controls/InstalledPluginDisplayKeyword.xaml

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -11,30 +11,33 @@
1111
mc:Ignorable="d">
1212
<Border
1313
Width="Auto"
14-
Height="52"
14+
Height="Auto"
1515
Margin="0"
1616
Padding="0"
1717
BorderThickness="0 1 0 0"
1818
CornerRadius="0"
1919
Style="{DynamicResource SettingGroupBox}"
2020
Visibility="{Binding ActionKeywordsVisibility}">
21-
<DockPanel Margin="22 0 18 0" VerticalAlignment="Center">
21+
<DockPanel Margin="{StaticResource SettingPanelMargin}">
2222
<TextBlock
23-
Margin="48 0 10 0"
23+
Margin="{StaticResource SettingPanelItemRightMargin}"
24+
HorizontalAlignment="Left"
25+
VerticalAlignment="Center"
2426
DockPanel.Dock="Left"
2527
Style="{StaticResource Glyph}">
2628
&#xe819;
2729
</TextBlock>
2830
<TextBlock
31+
Margin="{StaticResource SettingPanelItemRightMargin}"
2932
HorizontalAlignment="Left"
3033
VerticalAlignment="Center"
3134
DockPanel.Dock="Left"
3235
Style="{DynamicResource SettingTitleLabel}"
3336
Text="{DynamicResource actionKeywords}" />
37+
<!-- Here Margin="0 -4.5 0 -4.5" is to remove redundant top bottom margin from Margin="{StaticResource SettingPanelMargin}" -->
3438
<Button
3539
Width="100"
36-
Height="34"
37-
Margin="5 0 0 0"
40+
Margin="0 -4.5 0 -4.5"
3841
HorizontalAlignment="Right"
3942
Command="{Binding SetActionKeywordsCommand}"
4043
Content="{Binding ActionKeywordsText}"

Flow.Launcher/Resources/CustomControlTemplate.xaml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5585,4 +5585,31 @@
55855585
</Setter.Value>
55865586
</Setter>
55875587
</Style>
5588+
5589+
<!-- Settings Panel -->
5590+
<Thickness x:Key="SettingPanelMargin">70,13.5,18,13.5</Thickness>
5591+
5592+
<Thickness x:Key="SettingPanelItemLeftMargin">9,0,0,0</Thickness>
5593+
<Thickness x:Key="SettingPanelItemRightMargin">0,0,9,0</Thickness>
5594+
<Thickness x:Key="SettingPanelItemTopBottomMargin">0,4.5,0,4.5</Thickness>
5595+
5596+
<Thickness x:Key="SettingPanelItemLeftTopBottomMargin">9,4.5,0,4.5</Thickness>
5597+
<Thickness x:Key="SettingPanelItemRightTopBottomMargin">0,4.5,9,4.5</Thickness>
5598+
5599+
<Style x:Key="SettingPanelSeparatorStyle" TargetType="Separator">
5600+
<Setter Property="Margin" Value="-70 13.5 -18 13.5" />
5601+
<Setter Property="Height" Value="1" />
5602+
<Setter Property="VerticalAlignment" Value="Top" />
5603+
<Setter Property="Background" Value="{DynamicResource Color03B}" />
5604+
</Style>
5605+
5606+
<system:Double x:Key="SettingPanelTextBoxMinWidth">180</system:Double>
5607+
<system:Double x:Key="SettingPanelPathTextBoxWidth">240</system:Double>
5608+
<system:Double x:Key="SettingPanelAreaTextBoxMinHeight">150</system:Double>
5609+
5610+
<Style x:Key="SettingPanelTextBlockDescriptionStyle" TargetType="TextBlock">
5611+
<Setter Property="FontSize" Value="12" />
5612+
<Setter Property="Margin" Value="0 2 0 0" />
5613+
<Setter Property="Foreground" Value="{DynamicResource Color04B}" />
5614+
</Style>
55885615
</ResourceDictionary>

Plugins/Flow.Launcher.Plugin.BrowserBookmark/Views/SettingsControl.xaml

Lines changed: 78 additions & 68 deletions
Original file line numberDiff line numberDiff line change
@@ -8,77 +8,87 @@
88
d:DesignWidth="500"
99
DataContext="{Binding RelativeSource={RelativeSource Self}}"
1010
mc:Ignorable="d">
11-
<Grid Margin="60,0,10,0">
11+
<Grid Margin="{StaticResource SettingPanelMargin}">
1212
<Grid.RowDefinitions>
13-
<RowDefinition Height="auto" />
13+
<RowDefinition Height="Auto" />
14+
<RowDefinition Height="Auto" />
1415
</Grid.RowDefinitions>
15-
<StackPanel Margin="0,10,0,10" Orientation="Vertical">
16-
<StackPanel Orientation="Horizontal">
17-
<TextBlock Margin="10" Text="{DynamicResource flowlauncher_plugin_browserbookmark_loadBrowserFrom}" />
18-
<CheckBox
19-
Margin="0,0,15,0"
20-
Content="Chrome"
21-
IsChecked="{Binding LoadChromeBookmark}" />
22-
<CheckBox
23-
Margin="0,0,15,0"
24-
Content="Edge"
25-
IsChecked="{Binding LoadEdgeBookmark}" />
26-
<CheckBox
27-
Margin="0,0,15,0"
28-
Content="Firefox"
29-
IsChecked="{Binding LoadFirefoxBookmark}" />
16+
<StackPanel
17+
Grid.Row="0"
18+
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
19+
Orientation="Horizontal">
20+
<TextBlock
21+
Margin="{StaticResource SettingPanelItemRightMargin}"
22+
VerticalAlignment="Center"
23+
Text="{DynamicResource flowlauncher_plugin_browserbookmark_loadBrowserFrom}" />
24+
<CheckBox
25+
Margin="{StaticResource SettingPanelItemRightMargin}"
26+
Content="Chrome"
27+
IsChecked="{Binding LoadChromeBookmark}" />
28+
<CheckBox
29+
Margin="{StaticResource SettingPanelItemRightMargin}"
30+
Content="Edge"
31+
IsChecked="{Binding LoadEdgeBookmark}" />
32+
<CheckBox
33+
Margin="{StaticResource SettingPanelItemRightMargin}"
34+
Content="Firefox"
35+
IsChecked="{Binding LoadFirefoxBookmark}" />
36+
<Button
37+
Margin="{StaticResource SettingPanelItemRightMargin}"
38+
Click="Others_Click"
39+
Content="{DynamicResource flowlauncher_plugin_browserbookmark_others}" />
40+
</StackPanel>
41+
<StackPanel
42+
Name="CustomBrowsersList"
43+
Grid.Row="1"
44+
Visibility="Collapsed">
45+
<ListView
46+
Name="CustomBrowsers"
47+
Height="auto"
48+
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
49+
BorderBrush="DarkGray"
50+
BorderThickness="1"
51+
ItemsSource="{Binding Settings.CustomChromiumBrowsers}"
52+
MouseDoubleClick="MouseDoubleClickOnSelectedCustomBrowser"
53+
SelectedItem="{Binding SelectedCustomBrowser}"
54+
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}">
55+
<ListView.View>
56+
<GridView>
57+
<GridViewColumn DisplayMemberBinding="{Binding Name, Mode=OneWay}" Header="{DynamicResource flowlauncher_plugin_browserbookmark_browserName}" />
58+
<GridViewColumn DisplayMemberBinding="{Binding DataDirectoryPath, Mode=OneWay}" Header="{DynamicResource flowlauncher_plugin_browserbookmark_browserBookmarkDataDirectory}" />
59+
<GridViewColumn DisplayMemberBinding="{Binding BrowserType, Mode=OneWay}" Header="{DynamicResource flowlauncher_plugin_browserbookmark_browserEngine}" />
60+
</GridView>
61+
</ListView.View>
62+
</ListView>
63+
<StackPanel
64+
Margin="{StaticResource SettingPanelItemTopBottomMargin}"
65+
HorizontalAlignment="Right"
66+
Orientation="Horizontal">
3067
<Button
31-
Margin="0,0,15,0"
32-
Click="Others_Click"
33-
Content="{DynamicResource flowlauncher_plugin_browserbookmark_others}" />
34-
</StackPanel>
35-
<StackPanel Name="CustomBrowsersList" Visibility="Collapsed">
36-
<ListView
37-
Name="CustomBrowsers"
38-
Height="auto"
39-
Margin="10"
40-
BorderBrush="DarkGray"
41-
BorderThickness="1"
42-
ItemsSource="{Binding Settings.CustomChromiumBrowsers}"
43-
MouseDoubleClick="MouseDoubleClickOnSelectedCustomBrowser"
44-
SelectedItem="{Binding SelectedCustomBrowser}"
45-
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}">
46-
<ListView.View>
47-
<GridView>
48-
<GridViewColumn DisplayMemberBinding="{Binding Name, Mode=OneWay}" Header="{DynamicResource flowlauncher_plugin_browserbookmark_browserName}" />
49-
<GridViewColumn DisplayMemberBinding="{Binding DataDirectoryPath, Mode=OneWay}" Header="{DynamicResource flowlauncher_plugin_browserbookmark_browserBookmarkDataDirectory}" />
50-
<GridViewColumn DisplayMemberBinding="{Binding BrowserType, Mode=OneWay}" Header="{DynamicResource flowlauncher_plugin_browserbookmark_browserEngine}" />
51-
</GridView>
52-
</ListView.View>
53-
</ListView>
54-
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
55-
<Button
56-
MinWidth="130"
57-
Margin="10"
58-
Click="NewCustomBrowser"
59-
Content="{DynamicResource flowlauncher_plugin_browserbookmark_addBrowserBookmark}" />
60-
<Button
61-
MinWidth="130"
62-
Margin="10"
63-
Click="EditCustomBrowser"
64-
Content="{DynamicResource flowlauncher_plugin_browserbookmark_editBrowserBookmark}">
65-
<Button.Style>
66-
<Style BasedOn="{StaticResource DefaultButtonStyle}" TargetType="Button">
67-
<Setter Property="IsEnabled" Value="true" />
68-
<Style.Triggers>
69-
<DataTrigger Binding="{Binding ElementName=CustomBrowsers, Path=SelectedItems.Count}" Value="0">
70-
<Setter Property="IsEnabled" Value="false" />
71-
</DataTrigger>
72-
</Style.Triggers>
73-
</Style>
74-
</Button.Style>
75-
</Button>
76-
<Button
77-
MinWidth="120"
78-
Margin="10"
79-
Click="DeleteCustomBrowser"
80-
Content="{DynamicResource flowlauncher_plugin_browserbookmark_removeBrowserBookmark}" />
81-
</StackPanel>
68+
Width="100"
69+
Click="NewCustomBrowser"
70+
Content="{DynamicResource flowlauncher_plugin_browserbookmark_addBrowserBookmark}" />
71+
<Button
72+
Width="100"
73+
Margin="{StaticResource SettingPanelItemLeftMargin}"
74+
Click="EditCustomBrowser"
75+
Content="{DynamicResource flowlauncher_plugin_browserbookmark_editBrowserBookmark}">
76+
<Button.Style>
77+
<Style BasedOn="{StaticResource DefaultButtonStyle}" TargetType="Button">
78+
<Setter Property="IsEnabled" Value="true" />
79+
<Style.Triggers>
80+
<DataTrigger Binding="{Binding ElementName=CustomBrowsers, Path=SelectedItems.Count}" Value="0">
81+
<Setter Property="IsEnabled" Value="false" />
82+
</DataTrigger>
83+
</Style.Triggers>
84+
</Style>
85+
</Button.Style>
86+
</Button>
87+
<Button
88+
Width="100"
89+
Margin="{StaticResource SettingPanelItemLeftMargin}"
90+
Click="DeleteCustomBrowser"
91+
Content="{DynamicResource flowlauncher_plugin_browserbookmark_removeBrowserBookmark}" />
8292
</StackPanel>
8393
</StackPanel>
8494
</Grid>

Plugins/Flow.Launcher.Plugin.Calculator/Main.cs

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -155,16 +155,16 @@ private string ChangeDecimalSeparator(decimal value, string newDecimalSeparator)
155155
return value.ToString(numberFormatInfo);
156156
}
157157

158-
private string GetDecimalSeparator()
158+
private static string GetDecimalSeparator()
159159
{
160-
string systemDecimalSeperator = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;
161-
switch (_settings.DecimalSeparator)
160+
string systemDecimalSeparator = CultureInfo.CurrentCulture.NumberFormat.NumberDecimalSeparator;
161+
return _settings.DecimalSeparator switch
162162
{
163-
case DecimalSeparator.UseSystemLocale: return systemDecimalSeperator;
164-
case DecimalSeparator.Dot: return dot;
165-
case DecimalSeparator.Comma: return comma;
166-
default: return systemDecimalSeperator;
167-
}
163+
DecimalSeparator.UseSystemLocale => systemDecimalSeparator,
164+
DecimalSeparator.Dot => dot,
165+
DecimalSeparator.Comma => comma,
166+
_ => systemDecimalSeparator,
167+
};
168168
}
169169

170170
private bool IsBracketComplete(string query)

Plugins/Flow.Launcher.Plugin.Calculator/Views/CalculatorSettings.xaml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<core:LocalizationConverter x:Key="LocalizationConverter" />
1818
</UserControl.Resources>
1919

20-
<Grid Margin="70,14,0,14">
20+
<Grid Margin="{StaticResource SettingPanelMargin}">
2121
<Grid.RowDefinitions>
2222
<RowDefinition Height="auto" />
2323
<RowDefinition Height="auto" />
@@ -30,7 +30,7 @@
3030
<TextBlock
3131
Grid.Row="0"
3232
Grid.Column="0"
33-
Margin="0,0,10,0"
33+
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
3434
VerticalAlignment="Center"
3535
FontSize="14"
3636
Text="{DynamicResource flowlauncher_plugin_calculator_output_decimal_seperator}" />
@@ -39,8 +39,9 @@
3939
Grid.Row="0"
4040
Grid.Column="1"
4141
MaxWidth="300"
42-
Margin="10,5,0,5"
42+
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
4343
HorizontalAlignment="Left"
44+
VerticalAlignment="Center"
4445
ItemsSource="{Binding Source={ui:EnumBindingSource {x:Type calculator:DecimalSeparator}}}"
4546
SelectedItem="{Binding Settings.DecimalSeparator}">
4647
<ComboBox.ItemTemplate>
@@ -53,16 +54,17 @@
5354
<TextBlock
5455
Grid.Row="1"
5556
Grid.Column="0"
56-
Margin="0,0,10,0"
57+
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
5758
VerticalAlignment="Center"
5859
FontSize="14"
5960
Text="{DynamicResource flowlauncher_plugin_calculator_max_decimal_places}" />
6061
<ComboBox
6162
x:Name="MaxDecimalPlaces"
6263
Grid.Row="1"
6364
Grid.Column="1"
64-
Margin="10,5,0,5"
65+
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
6566
HorizontalAlignment="Left"
67+
VerticalAlignment="Center"
6668
ItemsSource="{Binding MaxDecimalPlacesRange}"
6769
SelectedItem="{Binding Settings.MaxDecimalPlaces}" />
6870

0 commit comments

Comments
 (0)