Skip to content

Commit 16b45d3

Browse files
committed
Redesgin settings panel for bookmark plugin
1 parent ac956bc commit 16b45d3

File tree

1 file changed

+78
-68
lines changed

1 file changed

+78
-68
lines changed

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+
MinWidth="130"
69+
Click="NewCustomBrowser"
70+
Content="{DynamicResource flowlauncher_plugin_browserbookmark_addBrowserBookmark}" />
71+
<Button
72+
MinWidth="130"
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+
MinWidth="120"
89+
Margin="{StaticResource SettingPanelItemLeftMargin}"
90+
Click="DeleteCustomBrowser"
91+
Content="{DynamicResource flowlauncher_plugin_browserbookmark_removeBrowserBookmark}" />
8292
</StackPanel>
8393
</StackPanel>
8494
</Grid>

0 commit comments

Comments
 (0)