Adjust Layout

This commit is contained in:
DB p 2022-11-03 19:44:32 +09:00
parent d3a9d1ec1d
commit b1c8fa30ac
2 changed files with 64 additions and 47 deletions

View file

@ -130,6 +130,7 @@
<Setter Property="Margin" Value="0,0,-18,0" /> <Setter Property="Margin" Value="0,0,-18,0" />
</Style> </Style>
<Style x:Key="logo" TargetType="{x:Type TabItem}"> <Style x:Key="logo" TargetType="{x:Type TabItem}">
<!--#region Logo Style--> <!--#region Logo Style-->
<Setter Property="Margin" Value="0" /> <Setter Property="Margin" Value="0" />
@ -243,11 +244,7 @@
</Style> </Style>
<!-- Plugin Store Item when Selected layout for nothing --> <!-- Plugin Store Item when Selected layout for nothing -->
<Style x:Key="StoreItem" TargetType="{x:Type ToggleButton}"> <Style x:Key="StoreItem" TargetType="{x:Type ToggleButton}" />
<Style.Triggers>
<Trigger Property="IsChecked" Value="True" />
</Style.Triggers>
</Style>
<Style x:Key="PluginList" TargetType="ListBoxItem"> <Style x:Key="PluginList" TargetType="ListBoxItem">
<Setter Property="Background" Value="{DynamicResource Color00B}" /> <Setter Property="Background" Value="{DynamicResource Color00B}" />
@ -320,11 +317,12 @@
</Style> </Style>
<!--#region PluginStore Style--> <!--#region PluginStore Style-->
<Style x:Key="StoreList" TargetType="ListBoxItem"> <Style x:Key="StoreList" TargetType="ListViewItem">
<Setter Property="Background" Value="{DynamicResource Color02B}" />
<Setter Property="Padding" Value="0,0,0,0" /> <Setter Property="Padding" Value="0,0,0,0" />
<Setter Property="Margin" Value="0,0,8,5" /> <Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="BorderBrush" Value="{DynamicResource Color03B}" />
<Setter Property="Margin" Value="0,0,8,8" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<!--#region Template for blue highlight win10--> <!--#region Template for blue highlight win10-->
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
@ -336,7 +334,8 @@
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="5" CornerRadius="5"
SnapsToDevicePixels="True"> SnapsToDevicePixels="True"
UseLayoutRounding="True">
<ContentPresenter <ContentPresenter
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
@ -346,6 +345,24 @@
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /> SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Border> </Border>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="False" />
</MultiTrigger.Conditions>
<Setter TargetName="Bd" Property="Margin" Value="0,0,0,0" />
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource Color00B}" />
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Color03B}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource Color07B}" />
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Color03B}" />
<Setter TargetName="Bd" Property="CornerRadius" Value="5" />
<Setter TargetName="Bd" Property="Margin" Value="0,0,0,0" />
</MultiTrigger>
<MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" /> <Condition Property="IsMouseOver" Value="True" />
@ -354,29 +371,6 @@
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Color03B}" /> <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Color03B}" />
<Setter TargetName="Bd" Property="CornerRadius" Value="5" /> <Setter TargetName="Bd" Property="CornerRadius" Value="5" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Selector.IsSelectionActive" Value="False" />
<Condition Property="IsSelected" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource Color02B}" />
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Color03B}" />
<Setter TargetName="Bd" Property="Margin" Value="0,0,0,0" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Selector.IsSelectionActive" Value="True" />
<Condition Property="IsSelected" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource Color02B}" />
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Color03B}" />
<Setter TargetName="Bd" Property="CornerRadius" Value="5" />
<Setter TargetName="Bd" Property="Margin" Value="0,0,0,0" />
</MultiTrigger> </MultiTrigger>
<Trigger Property="IsEnabled" Value="False"> <Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" /> <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
@ -1407,6 +1401,7 @@
Grid.Row="0" Grid.Row="0"
Grid.Column="1" Grid.Column="1"
Margin="5,24,0,0"> Margin="5,24,0,0">
<TextBox <TextBox
Name="pluginStoreFilterTxb" Name="pluginStoreFilterTxb"
Width="150" Width="150"
@ -1483,7 +1478,9 @@
<ListView.ItemsPanel> <ListView.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<wpftk:VirtualizingWrapPanel <wpftk:VirtualizingWrapPanel
x:Name="ItemWrapPanel"
Margin="0,0,0,10" Margin="0,0,0,10"
ItemSize="216,194"
MouseWheelDelta="48" MouseWheelDelta="48"
Orientation="Vertical" Orientation="Vertical"
ScrollLineDelta="16" ScrollLineDelta="16"
@ -1493,15 +1490,30 @@
</ListView.ItemsPanel> </ListView.ItemsPanel>
<ListView.GroupStyle> <ListView.GroupStyle>
<GroupStyle HidesIfEmpty="True"> <GroupStyle HidesIfEmpty="True">
<GroupStyle.HeaderTemplate> <GroupStyle.ContainerStyle>
<DataTemplate> <Style TargetType="{x:Type GroupItem}">
<TextBlock <Setter Property="Template">
HorizontalAlignment="Left" <Setter.Value>
FontSize="14" <ControlTemplate>
FontWeight="Bold" <Grid>
Text="{Binding Name, Converter={StaticResource TextConverter}}" /> <StackPanel Orientation="Vertical">
</DataTemplate> <TextBlock
</GroupStyle.HeaderTemplate> Margin="0,0,0,10"
VerticalAlignment="Top"
FontSize="16"
FontWeight="Bold"
Text="{Binding Name, Converter={StaticResource TextConverter}}" />
<ItemsPresenter />
</StackPanel>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</GroupStyle.ContainerStyle>
<GroupStyle.Panel> <GroupStyle.Panel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<VirtualizingStackPanel Orientation="{Binding Orientation, Mode=OneWay}" /> <VirtualizingStackPanel Orientation="{Binding Orientation, Mode=OneWay}" />
@ -1510,17 +1522,15 @@
</GroupStyle> </GroupStyle>
</ListView.GroupStyle> </ListView.GroupStyle>
<ListView.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<!-- Hover Layout Style --> <!-- Hover Layout Style -->
<ToggleButton <ToggleButton
x:Name="StoreListItem" x:Name="StoreListItem"
Width="216" Width="200"
Height="164"
HorizontalAlignment="Left" HorizontalAlignment="Left"
HorizontalContentAlignment="left" HorizontalContentAlignment="left"
Background="Transparent"
IsChecked="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}" IsChecked="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type ListBoxItem}}, Path=IsSelected}"
Style="{StaticResource StoreItem}"> Style="{StaticResource StoreItem}">
<ToggleButton.Template> <ToggleButton.Template>
@ -1727,9 +1737,10 @@
</ToggleButton> </ToggleButton>
</DataTemplate> </DataTemplate>
</ListView.ItemTemplate> </ListBox.ItemTemplate>
</ListView> </ListView>
</Grid> </Grid>
</TabItem> </TabItem>
<!--#endregion--> <!--#endregion-->

View file

@ -8,7 +8,9 @@ using Flow.Launcher.Plugin;
using Flow.Launcher.Plugin.SharedCommands; using Flow.Launcher.Plugin.SharedCommands;
using Flow.Launcher.ViewModel; using Flow.Launcher.ViewModel;
using ModernWpf; using ModernWpf;
using ModernWpf.Controls;
using System; using System;
using System.Drawing.Printing;
using System.IO; using System.IO;
using System.Windows; using System.Windows;
using System.Windows.Controls.Primitives; using System.Windows.Controls.Primitives;
@ -17,6 +19,7 @@ using System.Windows.Forms;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Interop; using System.Windows.Interop;
using System.Windows.Navigation; using System.Windows.Navigation;
using static System.Windows.Forms.VisualStyles.VisualStyleElement.Window;
using Button = System.Windows.Controls.Button; using Button = System.Windows.Controls.Button;
using Control = System.Windows.Controls.Control; using Control = System.Windows.Controls.Control;
using KeyEventArgs = System.Windows.Input.KeyEventArgs; using KeyEventArgs = System.Windows.Input.KeyEventArgs;
@ -425,6 +428,9 @@ namespace Flow.Launcher
} }
} }
private void ShowStoreItem_Click(object sender, RoutedEventArgs e)
{
}
private void RefreshPluginStoreEventHandler(object sender, RoutedEventArgs e) private void RefreshPluginStoreEventHandler(object sender, RoutedEventArgs e)
{ {
if (pluginStoreFilterTxb.Text != lastPluginStoreSearch) if (pluginStoreFilterTxb.Text != lastPluginStoreSearch)