mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
rename ui elements
This commit is contained in:
parent
324ee62c2a
commit
c02fa4b847
3 changed files with 36 additions and 36 deletions
|
|
@ -16,7 +16,7 @@
|
||||||
<system:String x:Key="plugin_explorer_edit">Edit</system:String>
|
<system:String x:Key="plugin_explorer_edit">Edit</system:String>
|
||||||
<system:String x:Key="plugin_explorer_add">Add</system:String>
|
<system:String x:Key="plugin_explorer_add">Add</system:String>
|
||||||
<system:String x:Key="plugin_explorer_manageactionkeywords_header">Customise Action Keywords</system:String>
|
<system:String x:Key="plugin_explorer_manageactionkeywords_header">Customise Action Keywords</system:String>
|
||||||
<system:String x:Key="plugin_explorer_quickfolderaccess_header">Quick Folder Access Paths</system:String>
|
<system:String x:Key="plugin_explorer_quickaccesslinks_header">Quick Access Link Paths</system:String>
|
||||||
<system:String x:Key="plugin_explorer_indexsearchexcludedpaths_header">Index Search Excluded Paths</system:String>
|
<system:String x:Key="plugin_explorer_indexsearchexcludedpaths_header">Index Search Excluded Paths</system:String>
|
||||||
<system:String x:Key="plugin_explorer_manageindexoptions">Indexing Options</system:String>
|
<system:String x:Key="plugin_explorer_manageindexoptions">Indexing Options</system:String>
|
||||||
<system:String x:Key="plugin_explorer_actionkeywordview_search">Search Activation:</system:String>
|
<system:String x:Key="plugin_explorer_actionkeywordview_search">Search Activation:</system:String>
|
||||||
|
|
|
||||||
|
|
@ -7,7 +7,7 @@
|
||||||
mc:Ignorable="d"
|
mc:Ignorable="d"
|
||||||
d:DesignHeight="450" d:DesignWidth="800">
|
d:DesignHeight="450" d:DesignWidth="800">
|
||||||
<UserControl.Resources>
|
<UserControl.Resources>
|
||||||
<DataTemplate x:Key="ListViewTemplateFolderLinks">
|
<DataTemplate x:Key="ListViewTemplateAccessLinks">
|
||||||
<TextBlock
|
<TextBlock
|
||||||
Text="{Binding Nickname, Mode=OneTime}"
|
Text="{Binding Nickname, Mode=OneTime}"
|
||||||
Margin="0,5,0,5" />
|
Margin="0,5,0,5" />
|
||||||
|
|
@ -40,22 +40,22 @@
|
||||||
<ListView x:Name="lbxActionKeywords"
|
<ListView x:Name="lbxActionKeywords"
|
||||||
ItemTemplate="{StaticResource ListViewActionKeywords}"/>
|
ItemTemplate="{StaticResource ListViewActionKeywords}"/>
|
||||||
</Expander>
|
</Expander>
|
||||||
<Expander Name="expFolderLinks" Header="{DynamicResource plugin_explorer_quickfolderaccess_header}"
|
<Expander Name="expAccessLinks" Header="{DynamicResource plugin_explorer_quickaccesslinks_header}"
|
||||||
Expanded="expFolderLinks_Click" Collapsed="expFolderLinks_Collapsed"
|
Expanded="expAccessLinks_Click" Collapsed="expAccessLinks_Collapsed"
|
||||||
Margin="0 10 0 0">
|
Margin="0 10 0 0">
|
||||||
<ListView
|
<ListView
|
||||||
x:Name="lbxFolderLinks" AllowDrop="True"
|
x:Name="lbxAccessLinks" AllowDrop="True"
|
||||||
Drop="lbxFolders_Drop"
|
Drop="lbxAccessLinks_Drop"
|
||||||
DragEnter="lbxFolders_DragEnter"
|
DragEnter="lbxAccessLinks_DragEnter"
|
||||||
ItemTemplate="{StaticResource ListViewTemplateFolderLinks}"/>
|
ItemTemplate="{StaticResource ListViewTemplateAccessLinks}"/>
|
||||||
</Expander>
|
</Expander>
|
||||||
<Expander x:Name="expExcludedPaths" Header="{DynamicResource plugin_explorer_indexsearchexcludedpaths_header}"
|
<Expander x:Name="expExcludedPaths" Header="{DynamicResource plugin_explorer_indexsearchexcludedpaths_header}"
|
||||||
Expanded="expExcludedPaths_Click"
|
Expanded="expExcludedPaths_Click"
|
||||||
Margin="0 10 0 0">
|
Margin="0 10 0 0">
|
||||||
<ListView
|
<ListView
|
||||||
x:Name="lbxExcludedPaths" AllowDrop="True"
|
x:Name="lbxExcludedPaths" AllowDrop="True"
|
||||||
Drop="lbxFolders_Drop"
|
Drop="lbxAccessLinks_Drop"
|
||||||
DragEnter="lbxFolders_DragEnter"
|
DragEnter="lbxAccessLinks_DragEnter"
|
||||||
ItemTemplate="{StaticResource ListViewTemplateExcludedPaths}"/>
|
ItemTemplate="{StaticResource ListViewTemplateExcludedPaths}"/>
|
||||||
</Expander>
|
</Expander>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|
|
||||||
|
|
@ -29,7 +29,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
||||||
|
|
||||||
this.viewModel = viewModel;
|
this.viewModel = viewModel;
|
||||||
|
|
||||||
lbxFolderLinks.ItemsSource = this.viewModel.Settings.QuickAccessLinks;
|
lbxAccessLinks.ItemsSource = this.viewModel.Settings.QuickAccessLinks;
|
||||||
|
|
||||||
lbxExcludedPaths.ItemsSource = this.viewModel.Settings.IndexSearchExcludedSubdirectoryPaths;
|
lbxExcludedPaths.ItemsSource = this.viewModel.Settings.IndexSearchExcludedSubdirectoryPaths;
|
||||||
|
|
||||||
|
|
@ -54,7 +54,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
||||||
|
|
||||||
public void RefreshView()
|
public void RefreshView()
|
||||||
{
|
{
|
||||||
lbxFolderLinks.Items.SortDescriptions.Add(new SortDescription("Path", ListSortDirection.Ascending));
|
lbxAccessLinks.Items.SortDescriptions.Add(new SortDescription("Path", ListSortDirection.Ascending));
|
||||||
|
|
||||||
lbxExcludedPaths.Items.SortDescriptions.Add(new SortDescription("Path", ListSortDirection.Ascending));
|
lbxExcludedPaths.Items.SortDescriptions.Add(new SortDescription("Path", ListSortDirection.Ascending));
|
||||||
|
|
||||||
|
|
@ -62,7 +62,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
||||||
btnEdit.Visibility = Visibility.Hidden;
|
btnEdit.Visibility = Visibility.Hidden;
|
||||||
btnAdd.Visibility = Visibility.Hidden;
|
btnAdd.Visibility = Visibility.Hidden;
|
||||||
|
|
||||||
if (expFolderLinks.IsExpanded || expExcludedPaths.IsExpanded || expActionKeywords.IsExpanded)
|
if (expAccessLinks.IsExpanded || expExcludedPaths.IsExpanded || expActionKeywords.IsExpanded)
|
||||||
{
|
{
|
||||||
if (!expActionKeywords.IsExpanded)
|
if (!expActionKeywords.IsExpanded)
|
||||||
btnAdd.Visibility = Visibility.Visible;
|
btnAdd.Visibility = Visibility.Visible;
|
||||||
|
|
@ -71,7 +71,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
||||||
&& btnEdit.Visibility == Visibility.Hidden)
|
&& btnEdit.Visibility == Visibility.Hidden)
|
||||||
btnEdit.Visibility = Visibility.Visible;
|
btnEdit.Visibility = Visibility.Visible;
|
||||||
|
|
||||||
if ((lbxFolderLinks.Items.Count == 0 && lbxExcludedPaths.Items.Count == 0)
|
if ((lbxAccessLinks.Items.Count == 0 && lbxExcludedPaths.Items.Count == 0)
|
||||||
&& btnDelete.Visibility == Visibility.Visible
|
&& btnDelete.Visibility == Visibility.Visible
|
||||||
&& btnEdit.Visibility == Visibility.Visible)
|
&& btnEdit.Visibility == Visibility.Visible)
|
||||||
{
|
{
|
||||||
|
|
@ -79,8 +79,8 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
||||||
btnEdit.Visibility = Visibility.Hidden;
|
btnEdit.Visibility = Visibility.Hidden;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (expFolderLinks.IsExpanded
|
if (expAccessLinks.IsExpanded
|
||||||
&& lbxFolderLinks.Items.Count > 0
|
&& lbxAccessLinks.Items.Count > 0
|
||||||
&& btnDelete.Visibility == Visibility.Hidden
|
&& btnDelete.Visibility == Visibility.Hidden
|
||||||
&& btnEdit.Visibility == Visibility.Hidden)
|
&& btnEdit.Visibility == Visibility.Hidden)
|
||||||
{
|
{
|
||||||
|
|
@ -98,7 +98,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
lbxFolderLinks.Items.Refresh();
|
lbxAccessLinks.Items.Refresh();
|
||||||
|
|
||||||
lbxExcludedPaths.Items.Refresh();
|
lbxExcludedPaths.Items.Refresh();
|
||||||
|
|
||||||
|
|
@ -113,8 +113,8 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
||||||
if (expExcludedPaths.IsExpanded)
|
if (expExcludedPaths.IsExpanded)
|
||||||
expExcludedPaths.IsExpanded = false;
|
expExcludedPaths.IsExpanded = false;
|
||||||
|
|
||||||
if (expFolderLinks.IsExpanded)
|
if (expAccessLinks.IsExpanded)
|
||||||
expFolderLinks.IsExpanded = false;
|
expAccessLinks.IsExpanded = false;
|
||||||
|
|
||||||
RefreshView();
|
RefreshView();
|
||||||
}
|
}
|
||||||
|
|
@ -125,10 +125,10 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
||||||
expActionKeywords.Height = Double.NaN;
|
expActionKeywords.Height = Double.NaN;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void expFolderLinks_Click(object sender, RoutedEventArgs e)
|
private void expAccessLinks_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (expFolderLinks.IsExpanded)
|
if (expAccessLinks.IsExpanded)
|
||||||
expFolderLinks.Height = 215;
|
expAccessLinks.Height = 215;
|
||||||
|
|
||||||
if (expExcludedPaths.IsExpanded)
|
if (expExcludedPaths.IsExpanded)
|
||||||
expExcludedPaths.IsExpanded = false;
|
expExcludedPaths.IsExpanded = false;
|
||||||
|
|
@ -139,19 +139,19 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
||||||
RefreshView();
|
RefreshView();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void expFolderLinks_Collapsed(object sender, RoutedEventArgs e)
|
private void expAccessLinks_Collapsed(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (!expFolderLinks.IsExpanded)
|
if (!expAccessLinks.IsExpanded)
|
||||||
expFolderLinks.Height = Double.NaN;
|
expAccessLinks.Height = Double.NaN;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void expExcludedPaths_Click(object sender, RoutedEventArgs e)
|
private void expExcludedPaths_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (expExcludedPaths.IsExpanded)
|
if (expExcludedPaths.IsExpanded)
|
||||||
expFolderLinks.Height = Double.NaN;
|
expAccessLinks.Height = Double.NaN;
|
||||||
|
|
||||||
if (expFolderLinks.IsExpanded)
|
if (expAccessLinks.IsExpanded)
|
||||||
expFolderLinks.IsExpanded = false;
|
expAccessLinks.IsExpanded = false;
|
||||||
|
|
||||||
if (expActionKeywords.IsExpanded)
|
if (expActionKeywords.IsExpanded)
|
||||||
expActionKeywords.IsExpanded = false;
|
expActionKeywords.IsExpanded = false;
|
||||||
|
|
@ -161,7 +161,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
||||||
|
|
||||||
private void btnDelete_Click(object sender, RoutedEventArgs e)
|
private void btnDelete_Click(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
var selectedRow = lbxFolderLinks.SelectedItem as AccessLink?? lbxExcludedPaths.SelectedItem as AccessLink;
|
var selectedRow = lbxAccessLinks.SelectedItem as AccessLink?? lbxExcludedPaths.SelectedItem as AccessLink;
|
||||||
|
|
||||||
if (selectedRow != null)
|
if (selectedRow != null)
|
||||||
{
|
{
|
||||||
|
|
@ -169,7 +169,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
||||||
|
|
||||||
if (MessageBox.Show(msg, string.Empty, MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
if (MessageBox.Show(msg, string.Empty, MessageBoxButton.YesNo) == MessageBoxResult.Yes)
|
||||||
{
|
{
|
||||||
if (expFolderLinks.IsExpanded)
|
if (expAccessLinks.IsExpanded)
|
||||||
viewModel.RemoveFolderLinkFromQuickFolders(selectedRow);
|
viewModel.RemoveFolderLinkFromQuickFolders(selectedRow);
|
||||||
|
|
||||||
if (expExcludedPaths.IsExpanded)
|
if (expExcludedPaths.IsExpanded)
|
||||||
|
|
@ -199,7 +199,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
var selectedRow = lbxFolderLinks.SelectedItem as AccessLink ?? lbxExcludedPaths.SelectedItem as AccessLink;
|
var selectedRow = lbxAccessLinks.SelectedItem as AccessLink ?? lbxExcludedPaths.SelectedItem as AccessLink;
|
||||||
|
|
||||||
if (selectedRow != null)
|
if (selectedRow != null)
|
||||||
{
|
{
|
||||||
|
|
@ -207,7 +207,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
||||||
folderBrowserDialog.SelectedPath = selectedRow.Path;
|
folderBrowserDialog.SelectedPath = selectedRow.Path;
|
||||||
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
if (folderBrowserDialog.ShowDialog() == DialogResult.OK)
|
||||||
{
|
{
|
||||||
if (expFolderLinks.IsExpanded)
|
if (expAccessLinks.IsExpanded)
|
||||||
{
|
{
|
||||||
var link = viewModel.Settings.QuickAccessLinks.First(x => x.Path == selectedRow.Path);
|
var link = viewModel.Settings.QuickAccessLinks.First(x => x.Path == selectedRow.Path);
|
||||||
link.Path = folderBrowserDialog.SelectedPath;
|
link.Path = folderBrowserDialog.SelectedPath;
|
||||||
|
|
@ -246,13 +246,13 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
||||||
RefreshView();
|
RefreshView();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void lbxFolders_Drop(object sender, DragEventArgs e)
|
private void lbxAccessLinks_Drop(object sender, DragEventArgs e)
|
||||||
{
|
{
|
||||||
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
|
string[] files = (string[])e.Data.GetData(DataFormats.FileDrop);
|
||||||
|
|
||||||
if (files != null && files.Count() > 0)
|
if (files != null && files.Count() > 0)
|
||||||
{
|
{
|
||||||
if (expFolderLinks.IsExpanded && viewModel.Settings.QuickAccessLinks == null)
|
if (expAccessLinks.IsExpanded && viewModel.Settings.QuickAccessLinks == null)
|
||||||
viewModel.Settings.QuickAccessLinks = new List<AccessLink>();
|
viewModel.Settings.QuickAccessLinks = new List<AccessLink>();
|
||||||
|
|
||||||
foreach (string s in files)
|
foreach (string s in files)
|
||||||
|
|
@ -274,7 +274,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
||||||
|
|
||||||
private void AddFolderLink(AccessLink newFolderLink)
|
private void AddFolderLink(AccessLink newFolderLink)
|
||||||
{
|
{
|
||||||
if (expFolderLinks.IsExpanded
|
if (expAccessLinks.IsExpanded
|
||||||
&& !viewModel.Settings.QuickAccessLinks.Any(x => x.Path == newFolderLink.Path))
|
&& !viewModel.Settings.QuickAccessLinks.Any(x => x.Path == newFolderLink.Path))
|
||||||
{
|
{
|
||||||
if (viewModel.Settings.QuickAccessLinks == null)
|
if (viewModel.Settings.QuickAccessLinks == null)
|
||||||
|
|
@ -293,7 +293,7 @@ namespace Flow.Launcher.Plugin.Explorer.Views
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void lbxFolders_DragEnter(object sender, DragEventArgs e)
|
private void lbxAccessLinks_DragEnter(object sender, DragEventArgs e)
|
||||||
{
|
{
|
||||||
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
if (e.Data.GetDataPresent(DataFormats.FileDrop))
|
||||||
{
|
{
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue