Skip to content

Commit e784ea6

Browse files
committed
- Change store Item to toggle mode. when it one more click, it deselect.)
- Fix Website link in store. (Modify so that the link opens.) - Fix the problem that changed the layout depending on the toggle status
1 parent 47749df commit e784ea6

File tree

1 file changed

+35
-21
lines changed

1 file changed

+35
-21
lines changed

Flow.Launcher/SettingWindow.xaml

Lines changed: 35 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -884,24 +884,40 @@
884884
<Button Content="Refresh" FontSize="13" Margin="0 5 0 5" HorizontalAlignment="Right" Background="#ffffff" Padding="12 4 12 4" Height="34" BorderBrush="#cecece" BorderThickness="1 1 1 2"/>
885885
</Border>
886886
<Border Grid.Column="0" Grid.ColumnSpan="2" Grid.Row="1" Background="#f3f3f3" Padding="0 0 0 0">
887-
<ListBox x:Name="StoreListBox"
887+
<ListBox x:Name="StoreListBox"
888888
ItemsSource="{Binding ExternalPlugins}"
889889
Margin="6, 0, 0, 0" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
890-
ItemContainerStyle="{StaticResource StoreList}"
890+
ItemContainerStyle="{StaticResource StoreList}" SelectionMode="Single"
891891
ScrollViewer.IsDeferredScrollingEnabled="True" ScrollViewer.CanContentScroll="False"
892892
Padding="0 0 0 0" Width="Auto" VerticalContentAlignment="Center" HorizontalAlignment="Stretch">
893893
<ListBox.ItemsPanel>
894894
<ItemsPanelTemplate>
895895
<UniformGrid IsItemsHost="True" HorizontalAlignment="Left" Columns="2" Margin="0 0 6 18" VerticalAlignment="Top" SnapsToDevicePixels="True"/>
896896
</ItemsPanelTemplate>
897-
898-
899-
900897
</ListBox.ItemsPanel>
901898
<ListBox.ItemTemplate>
902899
<DataTemplate>
903900
<!-- Hover Layout Style-->
904-
<Border Padding="0" BorderBrush="Black" BorderThickness="0" Background="Transparent" >
901+
902+
<ToggleButton IsChecked="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}},Path=IsSelected}" Background="Transparent"
903+
Width="{Binding ActualWidth,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}}"
904+
HorizontalAlignment="Left" HorizontalContentAlignment="left">
905+
<ToggleButton.Template>
906+
<ControlTemplate TargetType="{x:Type ButtonBase}">
907+
<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}" Content="{TemplateBinding Content}" ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
908+
<ControlTemplate.Triggers>
909+
</ControlTemplate.Triggers>
910+
</ControlTemplate>
911+
</ToggleButton.Template>
912+
<ToggleButton.Style>
913+
<Style TargetType="{x:Type ToggleButton}">
914+
<Style.Triggers>
915+
<Trigger Property="IsChecked" Value="True">
916+
</Trigger>
917+
</Style.Triggers>
918+
</Style>
919+
</ToggleButton.Style>
920+
905921
<Grid HorizontalAlignment="Left" VerticalAlignment="Stretch">
906922
<Grid.ColumnDefinitions>
907923
<ColumnDefinition Width="72"/>
@@ -911,10 +927,10 @@
911927
VerticalAlignment="Center" >
912928
<StackPanel.Style>
913929
<Style>
914-
<Setter Property="StackPanel.Visibility" Value="Visible"></Setter>
930+
<Setter Property="StackPanel.Visibility" Value="Visible" />
915931
<Style.Triggers>
916932
<DataTrigger Binding="{Binding Mode=TwoWay, Path=IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" Value="true">
917-
<Setter Property="StackPanel.Opacity" Value="1"></Setter>
933+
<Setter Property="StackPanel.Opacity" Value="1" />
918934
</DataTrigger>
919935
</Style.Triggers>
920936
</Style>
@@ -926,10 +942,10 @@
926942
<StackPanel Grid.Column="1" Margin="0 0 8 0" VerticalAlignment="Center" Panel.ZIndex="0">
927943
<StackPanel.Style>
928944
<Style>
929-
<Setter Property="StackPanel.Visibility" Value="Visible"></Setter>
945+
<Setter Property="StackPanel.Visibility" Value="Visible" />
930946
<Style.Triggers>
931947
<DataTrigger Binding="{Binding Mode=TwoWay, Path=IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" Value="true">
932-
<Setter Property="StackPanel.Opacity" Value="1"></Setter>
948+
<Setter Property="StackPanel.Opacity" Value="1" />
933949
</DataTrigger>
934950
</Style.Triggers>
935951
</Style>
@@ -945,17 +961,17 @@
945961
<StackPanel Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
946962
<StackPanel.Style>
947963
<Style>
948-
<Setter Property="StackPanel.Visibility" Value="Collapsed"></Setter>
964+
<Setter Property="StackPanel.Visibility" Value="Collapsed" />
949965
<Style.Triggers>
950966
<DataTrigger Binding="{Binding Mode=TwoWay, Path=IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}" Value="true">
951-
<Setter Property="StackPanel.Visibility" Value="Visible"></Setter>
967+
<Setter Property="StackPanel.Visibility" Value="Visible" />
952968
</DataTrigger>
953969
</Style.Triggers>
954970
</Style>
955971
</StackPanel.Style>
956972

957973

958-
<Grid Height="98" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Panel.ZIndex="1" Width="auto">
974+
<Grid Height="94" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Panel.ZIndex="1">
959975
<Grid.Background>
960976
<SolidColorBrush Color="#f6f6f6" Opacity=".95"/>
961977
</Grid.Background>
@@ -974,24 +990,22 @@
974990
</StackPanel>
975991
<StackPanel Orientation="Vertical" Margin="20 2 120 0">
976992
<TextBlock TextWrapping="Wrap" Padding="0 0 0 0" >
977-
<Hyperlink NavigateUri="{Binding PluginPair.Metadata.Website}"
993+
<Hyperlink NavigateUri="{Binding Website}"
978994
RequestNavigate="OnRequestNavigate" Foreground="#5F5F5F">
979995
<Run Text="{Binding Author}" FontSize="12" />
980996
</Hyperlink>
981997
</TextBlock>
982998
</StackPanel>
983999
</StackPanel>
984-
985-
<Button Foreground="Black" Name="ShortCutButtonPrev" Content="Install" Width="90" MinHeight="40" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="1" Margin="0 0 20 0">
986-
</Button>
1000+
<Border Padding="0 0 20 0">
1001+
<Button Foreground="Black" Name="ShortCutButtonPrev" Content="Install" Width="90" MinHeight="40" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="1" Margin="0 0 0 0">
1002+
</Button>
1003+
</Border>
9871004
</Grid>
9881005
</StackPanel>
9891006
</Grid>
9901007

991-
992-
</Border>
993-
994-
1008+
</ToggleButton>
9951009
</DataTemplate>
9961010
</ListBox.ItemTemplate>
9971011
</ListBox>

0 commit comments

Comments
 (0)