Skip to content

Commit 29b7462

Browse files
committed
Add setting ui
1 parent 37cab1b commit 29b7462

File tree

1 file changed

+78
-50
lines changed

1 file changed

+78
-50
lines changed

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

Lines changed: 78 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -92,41 +92,43 @@
9292
<Setter.Value>
9393
<ControlTemplate TargetType="Expander">
9494
<Border
95-
Background="{TemplateBinding Background}"
96-
BorderBrush="{TemplateBinding BorderBrush}"
97-
BorderThickness="{TemplateBinding BorderThickness}"
98-
SnapsToDevicePixels="true">
95+
Background="{TemplateBinding Background}"
96+
BorderBrush="{TemplateBinding BorderBrush}"
97+
BorderThickness="{TemplateBinding BorderThickness}"
98+
SnapsToDevicePixels="true">
9999
<DockPanel>
100100
<ToggleButton
101-
x:Name="HeaderSite"
102-
MinWidth="0"
103-
MinHeight="0"
104-
Margin="0"
105-
Padding="{TemplateBinding Padding}"
106-
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
107-
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
108-
Content="{TemplateBinding Header}"
109-
ContentTemplate="{TemplateBinding HeaderTemplate}"
110-
ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
111-
DockPanel.Dock="Top"
112-
FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}"
113-
FontFamily="{TemplateBinding FontFamily}"
114-
FontSize="{TemplateBinding FontSize}"
115-
FontStretch="{TemplateBinding FontStretch}"
116-
FontStyle="{TemplateBinding FontStyle}"
117-
FontWeight="{TemplateBinding FontWeight}"
118-
Foreground="{TemplateBinding Foreground}"
119-
IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
120-
Style="{StaticResource ExpanderHeaderRightArrowStyle}" />
121-
<Border x:Name="ContentPresenterBorder" BorderThickness="0,1,0,0"
122-
BorderBrush="{DynamicResource Color03B}">
101+
x:Name="HeaderSite"
102+
MinWidth="0"
103+
MinHeight="0"
104+
Margin="0"
105+
Padding="{TemplateBinding Padding}"
106+
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
107+
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
108+
Content="{TemplateBinding Header}"
109+
ContentTemplate="{TemplateBinding HeaderTemplate}"
110+
ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
111+
DockPanel.Dock="Top"
112+
FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}"
113+
FontFamily="{TemplateBinding FontFamily}"
114+
FontSize="{TemplateBinding FontSize}"
115+
FontStretch="{TemplateBinding FontStretch}"
116+
FontStyle="{TemplateBinding FontStyle}"
117+
FontWeight="{TemplateBinding FontWeight}"
118+
Foreground="{TemplateBinding Foreground}"
119+
IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
120+
Style="{StaticResource ExpanderHeaderRightArrowStyle}" />
121+
<Border
122+
x:Name="ContentPresenterBorder"
123+
BorderBrush="{DynamicResource Color03B}"
124+
BorderThickness="0 1 0 0">
123125
<ContentPresenter
124-
x:Name="ExpandSite"
125-
Margin="{TemplateBinding Padding}"
126-
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
127-
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
128-
DockPanel.Dock="Bottom"
129-
Focusable="false" />
126+
x:Name="ExpandSite"
127+
Margin="{TemplateBinding Padding}"
128+
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
129+
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
130+
DockPanel.Dock="Bottom"
131+
Focusable="false" />
130132
<Border.LayoutTransform>
131133
<ScaleTransform ScaleY="0" />
132134
</Border.LayoutTransform>
@@ -141,27 +143,35 @@
141143
<BeginStoryboard>
142144
<Storyboard>
143145
<DoubleAnimation
144-
Storyboard.TargetName="ContentPresenterBorder"
145-
Storyboard.TargetProperty="(Border.LayoutTransform).(ScaleTransform.ScaleY)"
146-
From="0.0" To="1.0" Duration="0:0:0" />
146+
Storyboard.TargetName="ContentPresenterBorder"
147+
Storyboard.TargetProperty="(Border.LayoutTransform).(ScaleTransform.ScaleY)"
148+
From="0.0"
149+
To="1.0"
150+
Duration="0:0:0" />
147151
<DoubleAnimation
148-
Storyboard.TargetName="ContentPresenterBorder"
149-
Storyboard.TargetProperty="(Border.Opacity)"
150-
From="0.0" To="1.0" Duration="0:0:0" />
152+
Storyboard.TargetName="ContentPresenterBorder"
153+
Storyboard.TargetProperty="(Border.Opacity)"
154+
From="0.0"
155+
To="1.0"
156+
Duration="0:0:0" />
151157
</Storyboard>
152158
</BeginStoryboard>
153159
</Trigger.EnterActions>
154160
<Trigger.ExitActions>
155161
<BeginStoryboard>
156162
<Storyboard>
157163
<DoubleAnimation
158-
Storyboard.TargetName="ContentPresenterBorder"
159-
Storyboard.TargetProperty="(Border.LayoutTransform).(ScaleTransform.ScaleY)"
160-
From="1.0" To="0.0" Duration="0:0:0" />
164+
Storyboard.TargetName="ContentPresenterBorder"
165+
Storyboard.TargetProperty="(Border.LayoutTransform).(ScaleTransform.ScaleY)"
166+
From="1.0"
167+
To="0.0"
168+
Duration="0:0:0" />
161169
<DoubleAnimation
162-
Storyboard.TargetName="ContentPresenterBorder"
163-
Storyboard.TargetProperty="(Border.Opacity)"
164-
From="1.0" To="0.0" Duration="0:0:0" />
170+
Storyboard.TargetName="ContentPresenterBorder"
171+
Storyboard.TargetProperty="(Border.Opacity)"
172+
From="1.0"
173+
To="0.0"
174+
Duration="0:0:0" />
165175
</Storyboard>
166176
</BeginStoryboard>
167177
</Trigger.ExitActions>
@@ -734,10 +744,28 @@
734744
BorderThickness="1"
735745
DragEnter="lbxAccessLinks_DragEnter"
736746
Drop="LbxAccessLinks_OnDrop"
737-
ItemTemplate="{StaticResource ListViewTemplateAccessLinks}"
738747
ItemsSource="{Binding Settings.QuickAccessLinks}"
739748
Loaded="lbxAccessLinks_Loaded"
740-
SelectedItem="{Binding SelectedQuickAccessLink}" />
749+
SelectedItem="{Binding SelectedQuickAccessLink}">
750+
<ListView.View>
751+
<GridView>
752+
<GridViewColumn Width="600" Header="{DynamicResource plugin_explorer_name}">
753+
<GridViewColumn.CellTemplate>
754+
<DataTemplate>
755+
<TextBlock Text="{Binding Name}" />
756+
</DataTemplate>
757+
</GridViewColumn.CellTemplate>
758+
</GridViewColumn>
759+
<GridViewColumn Width="900" Header="{DynamicResource plugin_explorer_path}">
760+
<GridViewColumn.CellTemplate>
761+
<DataTemplate>
762+
<TextBlock Text="{Binding Path}" TextTrimming="CharacterEllipsis" />
763+
</DataTemplate>
764+
</GridViewColumn.CellTemplate>
765+
</GridViewColumn>
766+
</GridView>
767+
</ListView.View>
768+
</ListView>
741769
</Border>
742770

743771
<StackPanel
@@ -755,13 +783,13 @@
755783
<Button
756784
MinWidth="100"
757785
Margin="{StaticResource SettingPanelItemLeftMargin}"
758-
Command="{Binding EditLinkCommand}"
786+
Command="{Binding EditQuickAccessLinkCommand}"
759787
CommandParameter="QuickAccessLink"
760788
Content="{DynamicResource plugin_explorer_edit}" />
761789
<Button
762790
MinWidth="100"
763791
Margin="{StaticResource SettingPanelItemLeftMargin}"
764-
Command="{Binding AddLinkCommand}"
792+
Command="{Binding AddQuickAccessLinkCommand}"
765793
CommandParameter="QuickAccessLink"
766794
Content="{DynamicResource plugin_explorer_add}" />
767795
</StackPanel>
@@ -822,13 +850,13 @@
822850
<Button
823851
MinWidth="100"
824852
Margin="{StaticResource SettingPanelItemLeftMargin}"
825-
Command="{Binding EditLinkCommand}"
853+
Command="{Binding EditIndexSearchExcludePathsCommand}"
826854
CommandParameter="IndexSearchExcludedPaths"
827855
Content="{DynamicResource plugin_explorer_edit}" />
828856
<Button
829857
MinWidth="100"
830858
Margin="{StaticResource SettingPanelItemLeftMargin}"
831-
Command="{Binding AddLinkCommand}"
859+
Command="{Binding AddIndexSearchExcludePathsCommand}"
832860
CommandParameter="IndexSearchExcludedPaths"
833861
Content="{DynamicResource plugin_explorer_add}" />
834862
</StackPanel>

0 commit comments

Comments
 (0)