mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Program plugin- update layout
This commit is contained in:
parent
4439e341f9
commit
6abd690db7
2 changed files with 44 additions and 16 deletions
|
|
@ -8,7 +8,7 @@
|
|||
d:DesignHeight="300" d:DesignWidth="600">
|
||||
<Grid Margin="10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="50"/>
|
||||
<RowDefinition Height="75"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="50"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
|
@ -18,18 +18,23 @@
|
|||
<CheckBox Name="RegistryEnabled" Click="RegistryEnabled_Click" Margin="5" Content="{DynamicResource flowlauncher_plugin_program_index_registry}" />
|
||||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button Height="30" HorizontalAlignment="Right" Margin="10" Width="100" x:Name="btnLoadAllProgramSource" Click="btnLoadAllProgramSource_OnClick" Content="{DynamicResource flowlauncher_plugin_program_all_programs}" />
|
||||
<Button Height="30" HorizontalAlignment="Right" Margin="10" Width="100" x:Name="btnProgramSuffixes" Click="BtnProgramSuffixes_OnClick" Content="{DynamicResource flowlauncher_plugin_program_suffixes}" />
|
||||
<Button Height="30" HorizontalAlignment="Right" Margin="10" Width="100" x:Name="btnReindex" Click="btnReindex_Click" Content="{DynamicResource flowlauncher_plugin_program_reindex}" />
|
||||
<Button Height="31" HorizontalAlignment="Right" Margin="10" Width="100" x:Name="btnLoadAllProgramSource" Click="btnLoadAllProgramSource_OnClick" Content="{DynamicResource flowlauncher_plugin_program_all_programs}" />
|
||||
<Button Height="31" HorizontalAlignment="Right" Margin="10" Width="100" x:Name="btnProgramSuffixes" Click="BtnProgramSuffixes_OnClick" Content="{DynamicResource flowlauncher_plugin_program_suffixes}" />
|
||||
<Button Height="31" HorizontalAlignment="Right" Margin="10" Width="100" x:Name="btnReindex" Click="btnReindex_Click" Content="{DynamicResource flowlauncher_plugin_program_reindex}" />
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
<ListView x:Name="programSourceView" Grid.Row="1" AllowDrop="True" SelectionMode="Extended" GridViewColumnHeader.Click="GridViewColumnHeaderClickedHandler"
|
||||
PreviewMouseRightButtonUp="ProgramSourceView_PreviewMouseRightButtonUp"
|
||||
DragEnter="programSourceView_DragEnter"
|
||||
Drop="programSourceView_Drop" >
|
||||
<ListView x:Name="programSourceView" Grid.Row="1" AllowDrop="True" SelectionMode="Extended" Style="{StaticResource {x:Static GridView.GridViewStyleKey}}"
|
||||
Margin="0 13 0 0"
|
||||
BorderBrush="DarkGray"
|
||||
BorderThickness="1"
|
||||
GridViewColumnHeader.Click="GridViewColumnHeaderClickedHandler"
|
||||
PreviewMouseRightButtonUp="ProgramSourceView_PreviewMouseRightButtonUp"
|
||||
DragEnter="programSourceView_DragEnter"
|
||||
Drop="programSourceView_Drop">
|
||||
<ListView.ItemContainerStyle>
|
||||
<Style TargetType="ListViewItem">
|
||||
<EventSetter Event="PreviewMouseUp" Handler="Row_OnClick"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
</Style>
|
||||
</ListView.ItemContainerStyle>
|
||||
<ListView.View>
|
||||
|
|
@ -41,10 +46,10 @@
|
|||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
<GridViewColumn Header="Enabled" Width="50">
|
||||
<GridViewColumn Header="Enabled">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Enabled}"/>
|
||||
<TextBlock Text="{Binding Enabled}" MaxWidth="60" TextAlignment="Center"/>
|
||||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
|
|
@ -65,8 +70,8 @@
|
|||
</StackPanel>
|
||||
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button x:Name="btnProgramSourceStatus" Click="btnProgramSourceStatus_OnClick" Width="100" Margin="10" Content="{DynamicResource flowlauncher_plugin_program_disable}" />
|
||||
<Button x:Name="btnAddProgramSource" Click="btnAddProgramSource_OnClick" Width="100" Margin="10" Content="{DynamicResource flowlauncher_plugin_program_add}"/>
|
||||
<Button x:Name="btnEditProgramSource" Click="btnEditProgramSource_OnClick" Width="100" Margin="10" Content="{DynamicResource flowlauncher_plugin_program_edit}"/>
|
||||
<Button x:Name="btnAddProgramSource" Click="btnAddProgramSource_OnClick" Width="100" Margin="10" Content="{DynamicResource flowlauncher_plugin_program_add}"/>
|
||||
</StackPanel>
|
||||
</DockPanel>
|
||||
</Grid>
|
||||
|
|
|
|||
|
|
@ -42,11 +42,34 @@ namespace Flow.Launcher.Plugin.Program.Views
|
|||
|
||||
StartMenuEnabled.IsChecked = _settings.EnableStartMenuSource;
|
||||
RegistryEnabled.IsChecked = _settings.EnableRegistrySource;
|
||||
|
||||
ViewRefresh();
|
||||
}
|
||||
|
||||
private void ViewRefresh()
|
||||
{
|
||||
if(programSourceView.Items.Count == 0
|
||||
&& btnProgramSourceStatus.Visibility == Visibility.Visible
|
||||
&& btnEditProgramSource.Visibility == Visibility.Visible)
|
||||
{
|
||||
btnProgramSourceStatus.Visibility = Visibility.Hidden;
|
||||
btnEditProgramSource.Visibility = Visibility.Hidden;
|
||||
}
|
||||
|
||||
if (programSourceView.Items.Count > 0
|
||||
&& btnProgramSourceStatus.Visibility == Visibility.Hidden
|
||||
&& btnEditProgramSource.Visibility == Visibility.Hidden)
|
||||
{
|
||||
btnProgramSourceStatus.Visibility = Visibility.Visible;
|
||||
btnEditProgramSource.Visibility = Visibility.Visible;
|
||||
}
|
||||
|
||||
programSourceView.Items.Refresh();
|
||||
}
|
||||
|
||||
private void ReIndexing()
|
||||
{
|
||||
programSourceView.Items.Refresh();
|
||||
ViewRefresh();
|
||||
Task.Run(() =>
|
||||
{
|
||||
Dispatcher.Invoke(() => { indexingPanel.Visibility = Visibility.Visible; });
|
||||
|
|
@ -63,7 +86,7 @@ namespace Flow.Launcher.Plugin.Program.Views
|
|||
ReIndexing();
|
||||
}
|
||||
|
||||
programSourceView.Items.Refresh();
|
||||
ViewRefresh();
|
||||
}
|
||||
|
||||
private void DeleteProgramSources(List<ProgramSource> itemsToDelete)
|
||||
|
|
@ -148,7 +171,7 @@ namespace Flow.Launcher.Plugin.Program.Views
|
|||
directoriesToAdd.ForEach(x => _settings.ProgramSources.Add(x));
|
||||
directoriesToAdd.ForEach(x => ProgramSettingDisplayList.Add(x));
|
||||
|
||||
programSourceView.Items.Refresh();
|
||||
ViewRefresh();
|
||||
ReIndexing();
|
||||
}
|
||||
}
|
||||
|
|
@ -170,7 +193,7 @@ namespace Flow.Launcher.Plugin.Program.Views
|
|||
{
|
||||
ProgramSettingDisplayList.LoadAllApplications();
|
||||
|
||||
programSourceView.Items.Refresh();
|
||||
ViewRefresh();
|
||||
}
|
||||
|
||||
private void btnProgramSourceStatus_OnClick(object sender, RoutedEventArgs e)
|
||||
|
|
@ -219,7 +242,7 @@ namespace Flow.Launcher.Plugin.Program.Views
|
|||
|
||||
programSourceView.SelectedItems.Clear();
|
||||
|
||||
programSourceView.Items.Refresh();
|
||||
ViewRefresh();
|
||||
}
|
||||
|
||||
private void ProgramSourceView_PreviewMouseRightButtonUp(object sender, MouseButtonEventArgs e)
|
||||
|
|
|
|||
Loading…
Reference in a new issue