mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Adjust Plugin List template
This commit is contained in:
parent
1d746c2f0b
commit
165cbb734c
3 changed files with 89 additions and 24 deletions
|
|
@ -51,7 +51,7 @@
|
|||
<system:String x:Key="newActionKeyword">New action keyword:</system:String>
|
||||
<system:String x:Key="currentPriority">Current Priority:</system:String>
|
||||
<system:String x:Key="newPriority">New Priority:</system:String>
|
||||
<system:String x:Key="priority">Priority:</system:String>
|
||||
<system:String x:Key="priority">Priority</system:String>
|
||||
<system:String x:Key="pluginDirectory">Plugin Directory</system:String>
|
||||
<system:String x:Key="author">Author</system:String>
|
||||
<system:String x:Key="plugin_init_time">Init time:</system:String>
|
||||
|
|
|
|||
|
|
@ -190,7 +190,8 @@
|
|||
<Setter Property="Background" Value="#ffffff"></Setter>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="Padding" Value="0 12 18 12" />
|
||||
<Setter Property="Margin" Value="12 0 0 0" />
|
||||
<Setter Property="Margin" Value="0 0 0 0" />
|
||||
|
||||
<Setter Property="Height" Value="Auto"></Setter>
|
||||
|
||||
</Style>
|
||||
|
|
@ -418,8 +419,7 @@
|
|||
</TabItem.Header>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="180"></ColumnDefinition>
|
||||
<ColumnDefinition Width="*"></ColumnDefinition>
|
||||
<ColumnDefinition></ColumnDefinition>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="74"></RowDefinition>
|
||||
|
|
@ -429,33 +429,93 @@
|
|||
<TextBlock Text="{DynamicResource plugin}" TextAlignment="left" FontSize="30" Margin="0 5 0 5"/>
|
||||
</Border>
|
||||
<Border Grid.Column="0" Grid.Row="1" Background="#f3f3f3">
|
||||
<ListBox SelectedIndex="0" SelectedItem="{Binding SelectedPlugin}"
|
||||
<ListBox SelectedItem="{Binding SelectedPlugin}"
|
||||
ItemsSource="{Binding PluginViewModels}"
|
||||
Margin="0, 0, 0, 0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ui:ScrollViewerHelper.AutoHideScrollBars="{Binding AutoHideScrollBar, Mode=OneWay}" ItemContainerStyle="{StaticResource PluginList}" ScrollViewer.IsDeferredScrollingEnabled="True">
|
||||
|
||||
Margin="0, 0, 0, 0" ScrollViewer.HorizontalScrollBarVisibility="Disabled" ui:ScrollViewerHelper.AutoHideScrollBars="{Binding AutoHideScrollBar, Mode=OneWay}" ItemContainerStyle="{StaticResource PluginList}" ScrollViewer.IsDeferredScrollingEnabled="True" ScrollViewer.CanContentScroll ="False" >
|
||||
<ListBox.ItemTemplate>
|
||||
<DataTemplate>
|
||||
<DockPanel Margin="0">
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="50"/>
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="{Binding Image, IsAsync=True}"
|
||||
|
||||
<Expander Grid.Column="4" x:Name="expanderHeader" IsExpanded="{Binding Mode=TwoWay, Path=IsSelected, RelativeSource={RelativeSource AncestorType=ListBoxItem, Mode=FindAncestor}}">
|
||||
<Expander.Header>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="500"/>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition />
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<Image Source="{Binding Image, IsAsync=True}"
|
||||
Width="32" Height="32" Margin="12 0 0 0" Grid.Column="0"/>
|
||||
<StackPanel Grid.Column="1" Margin="12 0 0 0">
|
||||
<TextBlock Text="{Binding PluginPair.Metadata.Name}" TextWrapping="Wrap" ToolTip="{Binding PluginPair.Metadata.Version}" />
|
||||
<TextBlock Opacity="0.5" TextWrapping="Wrap" Margin="0 2 0 0">
|
||||
<Run Text="{Binding PluginPair.Metadata.Version}"/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
<StackPanel Grid.Column="1" Margin="12 0 14 0">
|
||||
<TextBlock Text="{Binding PluginPair.Metadata.Name}" TextWrapping="Wrap" ToolTip="{Binding PluginPair.Metadata.Version}" />
|
||||
<TextBlock Opacity="0.5" TextWrapping="Wrap" Margin="0 2 0 0">
|
||||
<Run Text="{Binding PluginPair.Metadata.Description}" FontSize="12"/>
|
||||
</TextBlock>
|
||||
</StackPanel>
|
||||
<StackPanel Grid.Column="3" Orientation="Horizontal">
|
||||
<TextBlock Text="{DynamicResource priority}" Margin="15,0,0,0" MaxWidth="100" VerticalAlignment="Center"/>
|
||||
<TextBlock Text="{Binding Priority}" VerticalAlignment="Center"
|
||||
ToolTip="Change Plugin Results Priority"
|
||||
Margin="5 0 0 0" Cursor="Hand" Foreground="Blue"
|
||||
MouseUp="OnPluginPriorityClick"/>
|
||||
</StackPanel>
|
||||
<ui:ToggleSwitch Grid.Column="4" OffContent="{DynamicResource disable}" OnContent="{DynamicResource enable}"
|
||||
MaxWidth="110" HorizontalAlignment="Right"
|
||||
IsOn="{Binding PluginState}"/>
|
||||
</Grid>
|
||||
</Expander.Header>
|
||||
|
||||
<Grid>
|
||||
<StackPanel Orientation="Vertical">
|
||||
<StackPanel>
|
||||
<Border Style="{DynamicResource SettingGroupBox}" Visibility="{Binding ActionKeywordsVisibility}" Height="52">
|
||||
<ItemsControl Style="{DynamicResource SettingGrid}">
|
||||
<StackPanel Style="{StaticResource TextPanel}">
|
||||
<TextBlock Text="{DynamicResource actionKeywords}" Style="{DynamicResource SettingTitleLabel}" />
|
||||
</StackPanel>
|
||||
<TextBlock Text="{Binding ActionKeywordsText}"
|
||||
Visibility="{Binding ActionKeywordsVisibility}"
|
||||
ToolTip="Change Action Keywords"
|
||||
Margin="5 0 0 0" Cursor="Hand" Foreground="Blue"
|
||||
MouseUp="OnPluginActionKeywordsClick" MaxWidth="100" />
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<Border BorderBrush="#cecece" BorderThickness="0 1 0 1" Background="White">
|
||||
<ContentControl Content="{Binding RelativeSource={RelativeSource AncestorType={x:Type Window}}, Path=DataContext.SettingProvider}" Padding="0" Margin="0" VerticalAlignment="Center"/>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel>
|
||||
<Border Style="{DynamicResource SettingGroupBox}" Visibility="{Binding ActionKeywordsVisibility}" Margin="0">
|
||||
<ItemsControl Style="{DynamicResource SettingGrid}">
|
||||
<StackPanel Style="{StaticResource TextPanel}" Orientation="Horizontal">
|
||||
<TextBlock Text="{DynamicResource plugin_init_time}" FontSize="10" Margin="10 0 0 0" MaxWidth="100"/>
|
||||
<TextBlock Text="{Binding InitilizaTime}" FontSize="10" Margin="5 0 0 0" MaxWidth="100"/>
|
||||
<TextBlock Text="{DynamicResource plugin_query_time}" FontSize="10" Margin="10 0 0 0" MaxWidth="100"/>
|
||||
<TextBlock Text="{Binding QueryTime}" FontSize="10" Margin="5 0 0 0" MaxWidth="100"/>
|
||||
</StackPanel>
|
||||
<TextBlock Text="{DynamicResource pluginDirectory}"
|
||||
MaxWidth="120" Cursor="Hand" Margin="10,0,0,0"
|
||||
MouseUp="OnPluginDirecotyClick" Foreground="Blue" HorizontalAlignment="Right"/>
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
</Expander>
|
||||
|
||||
</DockPanel>
|
||||
</DataTemplate>
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
</Border>
|
||||
|
||||
<!--
|
||||
<Border BorderThickness="1 2 0 0" BorderBrush="#f3f3f3" Grid.Column="2" Grid.RowSpan="2" Padding="12 12 12 12">
|
||||
<Grid Grid.Column="1" Grid.RowSpan="2">
|
||||
<Grid.RowDefinitions>
|
||||
|
|
@ -531,6 +591,7 @@
|
|||
HorizontalAlignment="Stretch" VerticalAlignment="Stretch" />
|
||||
</Grid>
|
||||
</Border>
|
||||
-->
|
||||
</Grid>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
|
|
|
|||
|
|
@ -184,13 +184,13 @@ namespace Flow.Launcher
|
|||
settings.PluginSettings.Plugins[id].Disabled = viewModel.SelectedPlugin.PluginPair.Metadata.Disabled;
|
||||
}
|
||||
|
||||
private void OnPluginPriorityClick(object sender, MouseButtonEventArgs e)
|
||||
private void OnPluginPriorityClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
if (e.ChangedButton == MouseButton.Left)
|
||||
{
|
||||
|
||||
|
||||
PriorityChangeWindow priorityChangeWindow = new PriorityChangeWindow(viewModel.SelectedPlugin.PluginPair.Metadata.ID, settings, viewModel.SelectedPlugin);
|
||||
priorityChangeWindow.ShowDialog();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private void OnPluginActionKeywordsClick(object sender, MouseButtonEventArgs e)
|
||||
|
|
@ -266,5 +266,9 @@ namespace Flow.Launcher
|
|||
FilesFolders.OpenPath(Path.Combine(DataLocation.DataDirectory(), Constant.Themes));
|
||||
}
|
||||
|
||||
/*private void OnPluginPriorityClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
|
||||
}*/
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue