Skip to content

Commit b1c8fa3

Browse files
committed
Adjust Layout
1 parent d3a9d1e commit b1c8fa3

File tree

2 files changed

+54
-37
lines changed

2 files changed

+54
-37
lines changed

Flow.Launcher/SettingWindow.xaml

Lines changed: 48 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@
130130
<Setter Property="Margin" Value="0,0,-18,0" />
131131
</Style>
132132

133+
133134
<Style x:Key="logo" TargetType="{x:Type TabItem}">
134135
<!--#region Logo Style-->
135136
<Setter Property="Margin" Value="0" />
@@ -243,11 +244,7 @@
243244
</Style>
244245

245246
<!-- Plugin Store Item when Selected layout for nothing -->
246-
<Style x:Key="StoreItem" TargetType="{x:Type ToggleButton}">
247-
<Style.Triggers>
248-
<Trigger Property="IsChecked" Value="True" />
249-
</Style.Triggers>
250-
</Style>
247+
<Style x:Key="StoreItem" TargetType="{x:Type ToggleButton}" />
251248

252249
<Style x:Key="PluginList" TargetType="ListBoxItem">
253250
<Setter Property="Background" Value="{DynamicResource Color00B}" />
@@ -320,11 +317,12 @@
320317
</Style>
321318

322319
<!--#region PluginStore Style-->
323-
<Style x:Key="StoreList" TargetType="ListBoxItem">
324-
<Setter Property="Background" Value="{DynamicResource Color02B}" />
320+
<Style x:Key="StoreList" TargetType="ListViewItem">
325321
<Setter Property="Padding" Value="0,0,0,0" />
326-
<Setter Property="Margin" Value="0,0,8,5" />
327-
<Setter Property="BorderBrush" Value="{DynamicResource Color03B}" />
322+
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
323+
324+
<Setter Property="Margin" Value="0,0,8,8" />
325+
<Setter Property="VerticalContentAlignment" Value="Stretch" />
328326
<!--#region Template for blue highlight win10-->
329327
<Setter Property="Template">
330328
<Setter.Value>
@@ -336,7 +334,8 @@
336334
BorderBrush="{TemplateBinding BorderBrush}"
337335
BorderThickness="{TemplateBinding BorderThickness}"
338336
CornerRadius="5"
339-
SnapsToDevicePixels="True">
337+
SnapsToDevicePixels="True"
338+
UseLayoutRounding="True">
340339
<ContentPresenter
341340
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
342341
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
@@ -346,36 +345,31 @@
346345
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
347346
</Border>
348347
<ControlTemplate.Triggers>
348+
349349
<MultiTrigger>
350350
<MultiTrigger.Conditions>
351-
<Condition Property="IsMouseOver" Value="True" />
351+
<Condition Property="IsSelected" Value="False" />
352352
</MultiTrigger.Conditions>
353-
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource Color07B}" />
353+
<Setter TargetName="Bd" Property="Margin" Value="0,0,0,0" />
354+
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource Color00B}" />
354355
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Color03B}" />
355-
<Setter TargetName="Bd" Property="CornerRadius" Value="5" />
356-
357356
</MultiTrigger>
358357
<MultiTrigger>
359358
<MultiTrigger.Conditions>
360-
<Condition Property="Selector.IsSelectionActive" Value="False" />
361359
<Condition Property="IsSelected" Value="True" />
362360
</MultiTrigger.Conditions>
363-
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource Color02B}" />
361+
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource Color07B}" />
364362
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Color03B}" />
363+
<Setter TargetName="Bd" Property="CornerRadius" Value="5" />
365364
<Setter TargetName="Bd" Property="Margin" Value="0,0,0,0" />
366-
367-
368365
</MultiTrigger>
369366
<MultiTrigger>
370367
<MultiTrigger.Conditions>
371-
<Condition Property="Selector.IsSelectionActive" Value="True" />
372-
<Condition Property="IsSelected" Value="True" />
368+
<Condition Property="IsMouseOver" Value="True" />
373369
</MultiTrigger.Conditions>
374-
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource Color02B}" />
370+
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource Color07B}" />
375371
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Color03B}" />
376372
<Setter TargetName="Bd" Property="CornerRadius" Value="5" />
377-
<Setter TargetName="Bd" Property="Margin" Value="0,0,0,0" />
378-
379373

380374
</MultiTrigger>
381375
<Trigger Property="IsEnabled" Value="False">
@@ -1407,6 +1401,7 @@
14071401
Grid.Row="0"
14081402
Grid.Column="1"
14091403
Margin="5,24,0,0">
1404+
14101405
<TextBox
14111406
Name="pluginStoreFilterTxb"
14121407
Width="150"
@@ -1483,7 +1478,9 @@
14831478
<ListView.ItemsPanel>
14841479
<ItemsPanelTemplate>
14851480
<wpftk:VirtualizingWrapPanel
1481+
x:Name="ItemWrapPanel"
14861482
Margin="0,0,0,10"
1483+
ItemSize="216,194"
14871484
MouseWheelDelta="48"
14881485
Orientation="Vertical"
14891486
ScrollLineDelta="16"
@@ -1493,15 +1490,30 @@
14931490
</ListView.ItemsPanel>
14941491
<ListView.GroupStyle>
14951492
<GroupStyle HidesIfEmpty="True">
1496-
<GroupStyle.HeaderTemplate>
1497-
<DataTemplate>
1498-
<TextBlock
1499-
HorizontalAlignment="Left"
1500-
FontSize="14"
1501-
FontWeight="Bold"
1502-
Text="{Binding Name, Converter={StaticResource TextConverter}}" />
1503-
</DataTemplate>
1504-
</GroupStyle.HeaderTemplate>
1493+
<GroupStyle.ContainerStyle>
1494+
<Style TargetType="{x:Type GroupItem}">
1495+
<Setter Property="Template">
1496+
<Setter.Value>
1497+
<ControlTemplate>
1498+
<Grid>
1499+
<StackPanel Orientation="Vertical">
1500+
<TextBlock
1501+
Margin="0,0,0,10"
1502+
VerticalAlignment="Top"
1503+
FontSize="16"
1504+
FontWeight="Bold"
1505+
Text="{Binding Name, Converter={StaticResource TextConverter}}" />
1506+
1507+
<ItemsPresenter />
1508+
1509+
</StackPanel>
1510+
1511+
</Grid>
1512+
</ControlTemplate>
1513+
</Setter.Value>
1514+
</Setter>
1515+
</Style>
1516+
</GroupStyle.ContainerStyle>
15051517
<GroupStyle.Panel>
15061518
<ItemsPanelTemplate>
15071519
<VirtualizingStackPanel Orientation="{Binding Orientation, Mode=OneWay}" />
@@ -1510,17 +1522,15 @@
15101522
</GroupStyle>
15111523
</ListView.GroupStyle>
15121524

1513-
<ListView.ItemTemplate>
1525+
<ListBox.ItemTemplate>
15141526
<DataTemplate>
15151527
<!-- Hover Layout Style -->
15161528

15171529
<ToggleButton
15181530
x:Name="StoreListItem"
1519-
Width="216"
1520-
Height="164"
1531+
Width="200"
15211532
HorizontalAlignment="Left"
15221533
HorizontalContentAlignment="left"
1523-
Background="Transparent"
15241534
IsChecked="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}"
15251535
Style="{StaticResource StoreItem}">
15261536
<ToggleButton.Template>
@@ -1727,9 +1737,10 @@
17271737

17281738
</ToggleButton>
17291739
</DataTemplate>
1730-
</ListView.ItemTemplate>
1740+
</ListBox.ItemTemplate>
17311741
</ListView>
17321742
</Grid>
1743+
17331744
</TabItem>
17341745
<!--#endregion-->
17351746

Flow.Launcher/SettingWindow.xaml.cs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@
88
using Flow.Launcher.Plugin.SharedCommands;
99
using Flow.Launcher.ViewModel;
1010
using ModernWpf;
11+
using ModernWpf.Controls;
1112
using System;
13+
using System.Drawing.Printing;
1214
using System.IO;
1315
using System.Windows;
1416
using System.Windows.Controls.Primitives;
@@ -17,6 +19,7 @@
1719
using System.Windows.Input;
1820
using System.Windows.Interop;
1921
using System.Windows.Navigation;
22+
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;
2023
using Button = System.Windows.Controls.Button;
2124
using Control = System.Windows.Controls.Control;
2225
using KeyEventArgs = System.Windows.Input.KeyEventArgs;
@@ -425,6 +428,9 @@ private void RefreshPluginListEventHandler(object sender, RoutedEventArgs e)
425428
}
426429
}
427430

431+
private void ShowStoreItem_Click(object sender, RoutedEventArgs e)
432+
{
433+
}
428434
private void RefreshPluginStoreEventHandler(object sender, RoutedEventArgs e)
429435
{
430436
if (pluginStoreFilterTxb.Text != lastPluginStoreSearch)

0 commit comments

Comments
 (0)