Skip to content

Commit ccb565e

Browse files
committed
Responsive Width in Plugin Store List (WIP
1 parent 4164b46 commit ccb565e

File tree

1 file changed

+16
-12
lines changed

1 file changed

+16
-12
lines changed

Flow.Launcher/SettingWindow.xaml

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,9 @@
263263
<Setter Property="Padding" Value="0 0 0 0" />
264264
<Setter Property="Margin" Value="0 0 8 4" />
265265
<Setter Property="BorderBrush" Value="#e5e5e5" />
266-
266+
<Setter Property="MinWidth" Value="330"/>
267+
<Setter Property="MaxWidth" Value="400"/>
268+
<Setter Property="Height" Value="98"/>
267269
<!--#region Template for blue highlight win10-->
268270
<Setter Property="Template">
269271
<Setter.Value>
@@ -837,21 +839,24 @@
837839
<TextBlock Text="Plugin Store" TextAlignment="left" FontSize="30" Margin="0 5 0 5"/>
838840
</Border>
839841
<Border Grid.Column="0" Grid.Row="1" Background="#f3f3f3" Padding="0 0 0 0">
840-
<ListBox
842+
<ListBox x:Name="StoreListBox"
841843
ItemsSource="{Binding PluginViewModels}"
842844
Margin="6, 0, 0, 0" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
843845
ItemContainerStyle="{StaticResource StoreList}"
844846
ScrollViewer.IsDeferredScrollingEnabled="True" ScrollViewer.CanContentScroll="False"
845847
Padding="0 0 0 0" Width="Auto" VerticalContentAlignment="Center" HorizontalAlignment="Stretch">
846848
<ListBox.ItemsPanel>
847849
<ItemsPanelTemplate>
848-
<WrapPanel ItemHeight="100" ItemWidth="390" Margin="0"/>
850+
<UniformGrid IsItemsHost="True" HorizontalAlignment="Left" Columns="2" Margin="0 0 12 18" VerticalAlignment="Top" />
849851
</ItemsPanelTemplate>
852+
853+
854+
850855
</ListBox.ItemsPanel>
851856
<ListBox.ItemTemplate>
852857
<DataTemplate>
853858
<!-- Hover Layout Style-->
854-
<Border x:Name="HoverArea" Padding="0" MinWidth="390" BorderBrush="Black" BorderThickness="0" Background="Transparent" >
859+
<Border Padding="0" BorderBrush="Black" BorderThickness="0" Background="Transparent" >
855860
<Grid HorizontalAlignment="Left" VerticalAlignment="Stretch">
856861
<Grid.ColumnDefinitions>
857862
<ColumnDefinition Width="72"/>
@@ -887,12 +892,12 @@
887892
<TextBlock Text="{Binding PluginPair.Metadata.Name}"
888893
TextWrapping="WrapWithOverflow" Padding="0 0 20 0"
889894
ToolTip="{Binding PluginPair.Metadata.Version}" />
890-
<TextBlock Opacity="0.5" TextWrapping="Wrap" Margin="0 2 0 0" Padding="0 0 20 0">
895+
<TextBlock Opacity="0.5" TextWrapping="WrapWithOverflow" Margin="0 2 0 0" Padding="0 0 20 0">
891896
<Run Text="{Binding PluginPair.Metadata.Description}" FontSize="12" />
892897
</TextBlock>
893898

894-
</StackPanel>
895-
<StackPanel Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Stretch">
899+
</StackPanel >
900+
<StackPanel Grid.Column="0" Grid.ColumnSpan="2" VerticalAlignment="Stretch" HorizontalAlignment="Stretch">
896901
<StackPanel.Style>
897902
<Style>
898903
<Setter Property="StackPanel.Visibility" Value="Collapsed"></Setter>
@@ -905,16 +910,15 @@
905910
</StackPanel.Style>
906911

907912

908-
<Grid Width="390" Height="94" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Panel.ZIndex="1">
913+
<Grid Height="98" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Panel.ZIndex="1" Width="auto">
909914
<Grid.Background>
910915
<SolidColorBrush Color="#f6f6f6" Opacity=".95"/>
911916
</Grid.Background>
912917
<Grid.ColumnDefinitions>
913-
<ColumnDefinition Width="*"/>
914-
<ColumnDefinition Width="150" />
918+
<ColumnDefinition Width="{Binding ActualWidth,RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}}" />
915919
</Grid.ColumnDefinitions>
916920

917-
<StackPanel Grid.Column="0" VerticalAlignment="Center">
921+
<StackPanel Grid.Column="0" VerticalAlignment="Center" HorizontalAlignment="Stretch">
918922
<StackPanel Orientation="Horizontal">
919923
<TextBlock Text="{Binding PluginPair.Metadata.Name}" FontWeight="Bold"
920924
TextWrapping="WrapWithOverflow" Padding="0 0 0 0" Margin="20 0 0 0"
@@ -928,7 +932,7 @@
928932
</TextBlock>
929933
</StackPanel>
930934

931-
<Button Foreground="Black" Name="ShortCutButtonPrev" Content="Install" Width="90" MinHeight="40" HorizontalAlignment="Center" VerticalAlignment="Center" Grid.Column="1">
935+
<Button Foreground="Black" Name="ShortCutButtonPrev" Content="Install" Width="90" MinHeight="40" HorizontalAlignment="Right" VerticalAlignment="Center" Grid.Column="1" Margin="0 0 20 0">
932936
</Button>
933937
</Grid>
934938
</StackPanel>

0 commit comments

Comments
 (0)