mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Merge branch 'dev' into ProgramIndexPATH
This commit is contained in:
commit
25e3825fa0
25 changed files with 956 additions and 27455 deletions
|
|
@ -1,4 +1,4 @@
|
|||
using System.Diagnostics;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Reflection;
|
||||
|
||||
|
|
@ -21,6 +21,7 @@ namespace Flow.Launcher.Infrastructure
|
|||
public static readonly string PreinstalledDirectory = Path.Combine(ProgramDirectory, Plugins);
|
||||
public const string Issue = "https://github.com/Flow-Launcher/Flow.Launcher/issues/new";
|
||||
public static readonly string Version = FileVersionInfo.GetVersionInfo(Assembly.Location.NonNull()).ProductVersion;
|
||||
public static readonly string Dev = "Dev";
|
||||
public const string Documentation = "https://flowlauncher.com/docs/#/usage-tips";
|
||||
|
||||
public static readonly int ThumbnailSize = 64;
|
||||
|
|
|
|||
|
|
@ -64,16 +64,5 @@
|
|||
<PackageReference Include="ToolGood.Words.Pinyin" Version="3.0.1.4" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<None Update="pinyindb\pinyin_gwoyeu_mapping.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="pinyindb\pinyin_mapping.xml">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Update="pinyindb\unicode_to_hanyu_pinyin.txt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
|
||||
</Project>
|
||||
|
|
@ -15,7 +15,7 @@ namespace Flow.Launcher.Infrastructure
|
|||
|
||||
private List<int> originalIndexs = new List<int>();
|
||||
private List<int> translatedIndexs = new List<int>();
|
||||
private int translaedLength = 0;
|
||||
private int translatedLength = 0;
|
||||
|
||||
public string key { get; private set; }
|
||||
|
||||
|
|
@ -32,13 +32,13 @@ namespace Flow.Launcher.Infrastructure
|
|||
originalIndexs.Add(originalIndex);
|
||||
translatedIndexs.Add(translatedIndex);
|
||||
translatedIndexs.Add(translatedIndex + length);
|
||||
translaedLength += length - 1;
|
||||
translatedLength += length - 1;
|
||||
}
|
||||
|
||||
public int MapToOriginalIndex(int translatedIndex)
|
||||
{
|
||||
if (translatedIndex > translatedIndexs.Last())
|
||||
return translatedIndex - translaedLength - 1;
|
||||
return translatedIndex - translatedLength - 1;
|
||||
|
||||
int lowerBound = 0;
|
||||
int upperBound = originalIndexs.Count - 1;
|
||||
|
|
@ -83,7 +83,7 @@ namespace Flow.Launcher.Infrastructure
|
|||
translatedIndex < translatedIndexs[upperBound * 2])
|
||||
{
|
||||
int indexDef = 0;
|
||||
|
||||
|
||||
for (int j = 0; j < upperBound; j++)
|
||||
{
|
||||
indexDef += translatedIndexs[j * 2 + 1] - translatedIndexs[j * 2];
|
||||
|
|
@ -102,9 +102,24 @@ namespace Flow.Launcher.Infrastructure
|
|||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Translate a language to English letters using a given rule.
|
||||
/// </summary>
|
||||
public interface IAlphabet
|
||||
{
|
||||
/// <summary>
|
||||
/// Translate a string to English letters, using a given rule.
|
||||
/// </summary>
|
||||
/// <param name="stringToTranslate">String to translate.</param>
|
||||
/// <returns></returns>
|
||||
public (string translation, TranslationMapping map) Translate(string stringToTranslate);
|
||||
|
||||
/// <summary>
|
||||
/// Determine if a string can be translated to English letter with this Alphabet.
|
||||
/// </summary>
|
||||
/// <param name="stringToTranslate">String to translate.</param>
|
||||
/// <returns></returns>
|
||||
public bool CanBeTranslated(string stringToTranslate);
|
||||
}
|
||||
|
||||
public class PinyinAlphabet : IAlphabet
|
||||
|
|
@ -119,63 +134,70 @@ namespace Flow.Launcher.Infrastructure
|
|||
_settings = settings ?? throw new ArgumentNullException(nameof(settings));
|
||||
}
|
||||
|
||||
public bool CanBeTranslated(string stringToTranslate)
|
||||
{
|
||||
return WordsHelper.HasChinese(stringToTranslate);
|
||||
}
|
||||
|
||||
public (string translation, TranslationMapping map) Translate(string content)
|
||||
{
|
||||
if (_settings.ShouldUsePinyin)
|
||||
{
|
||||
if (!_pinyinCache.ContainsKey(content))
|
||||
{
|
||||
if (WordsHelper.HasChinese(content))
|
||||
{
|
||||
var resultList = WordsHelper.GetPinyinList(content);
|
||||
|
||||
StringBuilder resultBuilder = new StringBuilder();
|
||||
TranslationMapping map = new TranslationMapping();
|
||||
|
||||
bool pre = false;
|
||||
|
||||
for (int i = 0; i < resultList.Length; i++)
|
||||
{
|
||||
if (content[i] >= 0x3400 && content[i] <= 0x9FD5)
|
||||
{
|
||||
map.AddNewIndex(i, resultBuilder.Length, resultList[i].Length + 1);
|
||||
resultBuilder.Append(' ');
|
||||
resultBuilder.Append(resultList[i]);
|
||||
pre = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pre)
|
||||
{
|
||||
pre = false;
|
||||
resultBuilder.Append(' ');
|
||||
}
|
||||
|
||||
resultBuilder.Append(resultList[i]);
|
||||
}
|
||||
}
|
||||
|
||||
map.endConstruct();
|
||||
|
||||
var key = resultBuilder.ToString();
|
||||
map.setKey(key);
|
||||
|
||||
return _pinyinCache[content] = (key, map);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (content, null);
|
||||
}
|
||||
return BuildCacheFromContent(content);
|
||||
}
|
||||
else
|
||||
{
|
||||
return _pinyinCache[content];
|
||||
}
|
||||
}
|
||||
return (content, null);
|
||||
}
|
||||
|
||||
private (string translation, TranslationMapping map) BuildCacheFromContent(string content)
|
||||
{
|
||||
if (WordsHelper.HasChinese(content))
|
||||
{
|
||||
var resultList = WordsHelper.GetPinyinList(content);
|
||||
|
||||
StringBuilder resultBuilder = new StringBuilder();
|
||||
TranslationMapping map = new TranslationMapping();
|
||||
|
||||
bool pre = false;
|
||||
|
||||
for (int i = 0; i < resultList.Length; i++)
|
||||
{
|
||||
if (content[i] >= 0x3400 && content[i] <= 0x9FD5)
|
||||
{
|
||||
map.AddNewIndex(i, resultBuilder.Length, resultList[i].Length + 1);
|
||||
resultBuilder.Append(' ');
|
||||
resultBuilder.Append(resultList[i]);
|
||||
pre = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (pre)
|
||||
{
|
||||
pre = false;
|
||||
resultBuilder.Append(' ');
|
||||
}
|
||||
|
||||
resultBuilder.Append(resultList[i]);
|
||||
}
|
||||
}
|
||||
|
||||
map.endConstruct();
|
||||
|
||||
var key = resultBuilder.ToString();
|
||||
map.setKey(key);
|
||||
|
||||
return _pinyinCache[content] = (key, map);
|
||||
}
|
||||
else
|
||||
{
|
||||
return (content, null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using Flow.Launcher.Plugin.SharedModels;
|
||||
using Flow.Launcher.Plugin.SharedModels;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
|
|
@ -60,8 +60,13 @@ namespace Flow.Launcher.Infrastructure
|
|||
return new MatchResult(false, UserSettingSearchPrecision);
|
||||
|
||||
query = query.Trim();
|
||||
TranslationMapping translationMapping;
|
||||
(stringToCompare, translationMapping) = _alphabet?.Translate(stringToCompare) ?? (stringToCompare, null);
|
||||
TranslationMapping translationMapping = null;
|
||||
if (_alphabet is not null && !_alphabet.CanBeTranslated(query))
|
||||
{
|
||||
// We assume that if a query can be translated (containing characters of a language, like Chinese)
|
||||
// it actually means user doesn't want it to be translated to English letters.
|
||||
(stringToCompare, translationMapping) = _alphabet.Translate(stringToCompare);
|
||||
}
|
||||
|
||||
var currentAcronymQueryIndex = 0;
|
||||
var acronymMatchData = new List<int>();
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
File diff suppressed because it is too large
Load diff
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
|
|
|||
|
|
@ -38,9 +38,8 @@
|
|||
FontSize="13"
|
||||
FontWeight="SemiBold"
|
||||
Foreground="{DynamicResource Color05B}"
|
||||
Visibility="Visible">
|
||||
Press key
|
||||
</TextBlock>
|
||||
Text="{DynamicResource flowlauncherPressHotkey}"
|
||||
Visibility="Visible" />
|
||||
</Border>
|
||||
</Popup>
|
||||
|
||||
|
|
@ -49,8 +48,8 @@
|
|||
Margin="0,0,18,0"
|
||||
VerticalContentAlignment="Center"
|
||||
input:InputMethod.IsInputMethodEnabled="False"
|
||||
LostFocus="tbHotkey_LostFocus"
|
||||
PreviewKeyDown="TbHotkey_OnPreviewKeyDown"
|
||||
TabIndex="100"
|
||||
LostFocus="tbHotkey_LostFocus"/>
|
||||
TabIndex="100" />
|
||||
</Grid>
|
||||
</UserControl>
|
||||
|
|
@ -9,6 +9,7 @@ using Flow.Launcher.Helper;
|
|||
using Flow.Launcher.Infrastructure.Hotkey;
|
||||
using Flow.Launcher.Plugin;
|
||||
using System.Threading;
|
||||
using System.Windows.Interop;
|
||||
|
||||
namespace Flow.Launcher
|
||||
{
|
||||
|
|
@ -113,7 +114,7 @@ namespace Flow.Launcher
|
|||
private void tbHotkey_LostFocus(object sender, RoutedEventArgs e)
|
||||
{
|
||||
tbMsg.Text = tbMsgTextOriginal;
|
||||
tbMsg.Foreground = tbMsgForegroundColorOriginal;
|
||||
tbMsg.SetResourceReference(TextBox.ForegroundProperty, "Color05B");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@
|
|||
<system:String x:Key="PositionResetToolTip">Reset search window position</system:String>
|
||||
|
||||
<!-- Setting General -->
|
||||
<system:String x:Key="flowlauncher_settings">Flow Launcher Settings</system:String>
|
||||
<system:String x:Key="flowlauncher_settings">Settings</system:String>
|
||||
<system:String x:Key="general">General</system:String>
|
||||
<system:String x:Key="portableMode">Portable Mode</system:String>
|
||||
<system:String x:Key="portableModeToolTIp">Store all settings and user data in one folder (Useful when used with removable drives or cloud services).</system:String>
|
||||
|
|
@ -105,9 +105,9 @@
|
|||
<system:String x:Key="installbtn">Install</system:String>
|
||||
<system:String x:Key="uninstallbtn">Uninstall</system:String>
|
||||
<system:String x:Key="updatebtn">Update</system:String>
|
||||
<system:String x:Key="LabelInstalledToolTip">Plug-in already installed</system:String>
|
||||
<system:String x:Key="LabelInstalledToolTip">Plugin already installed</system:String>
|
||||
<system:String x:Key="LabelNew">New Version</system:String>
|
||||
<system:String x:Key="LabelNewToolTip">This plug-in has been updated within the last 7 days</system:String>
|
||||
<system:String x:Key="LabelNewToolTip">This plugin has been updated within the last 7 days</system:String>
|
||||
<system:String x:Key="LabelUpdateToolTip">New Update is Available</system:String>
|
||||
|
||||
|
||||
|
|
@ -146,6 +146,7 @@
|
|||
<system:String x:Key="showOpenResultHotkeyToolTip">Show result selection hotkey with results.</system:String>
|
||||
<system:String x:Key="customQueryHotkey">Custom Query Hotkey</system:String>
|
||||
<system:String x:Key="customQueryShortcut">Custom Query Shortcut</system:String>
|
||||
<system:String x:Key="builtinShortcuts">Built-in Shortcuts</system:String>
|
||||
<system:String x:Key="customQuery">Query</system:String>
|
||||
<system:String x:Key="customShortcut">Shortcut</system:String>
|
||||
<system:String x:Key="customShortcutExpansion">Expanded</system:String>
|
||||
|
|
@ -163,6 +164,7 @@
|
|||
<system:String x:Key="windowWidthSizeToolTip">You can also quickly adjust this by using Ctrl+[ and Ctrl+].</system:String>
|
||||
<system:String x:Key="useGlyphUI">Use Segoe Fluent Icons</system:String>
|
||||
<system:String x:Key="useGlyphUIEffect">Use Segoe Fluent Icons for query results where supported</system:String>
|
||||
<system:String x:Key="flowlauncherPressHotkey">Press Key</system:String>
|
||||
|
||||
<!-- Setting Proxy -->
|
||||
<system:String x:Key="proxy">HTTP Proxy</system:String>
|
||||
|
|
@ -186,6 +188,7 @@
|
|||
<system:String x:Key="github">Github</system:String>
|
||||
<system:String x:Key="docs">Docs</system:String>
|
||||
<system:String x:Key="version">Version</system:String>
|
||||
<system:String x:Key="icons">Icons</system:String>
|
||||
<system:String x:Key="about_activate_times">You have activated Flow Launcher {0} times</system:String>
|
||||
<system:String x:Key="checkUpdates">Check for Updates</system:String>
|
||||
<system:String x:Key="newVersionTips">New version {0} is available, would you like to restart Flow Launcher to use the update?</system:String>
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
xmlns:flowlauncher="clr-namespace:Flow.Launcher"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:svgc="http://sharpvectors.codeplex.com/svgc/"
|
||||
xmlns:ui="http://schemas.modernwpf.com/2019"
|
||||
xmlns:vm="clr-namespace:Flow.Launcher.ViewModel"
|
||||
Name="FlowMainWindow"
|
||||
Title="Flow Launcher"
|
||||
|
|
@ -80,30 +81,26 @@
|
|||
Command="{Binding LoadContextMenuCommand}" />
|
||||
<KeyBinding Key="Left"
|
||||
Command="{Binding EscCommand}" />
|
||||
<KeyBinding
|
||||
Key="H"
|
||||
<KeyBinding Key="H"
|
||||
Command="{Binding LoadHistoryCommand}"
|
||||
Modifiers="Ctrl" />
|
||||
<KeyBinding Key="Right" Command="{Binding LoadContextMenuCommand}" />
|
||||
<KeyBinding Key="Left" Command="{Binding EscCommand}" />
|
||||
<KeyBinding
|
||||
Key="OemCloseBrackets"
|
||||
<KeyBinding Key="Right"
|
||||
Command="{Binding LoadContextMenuCommand}" />
|
||||
<KeyBinding Key="Left"
|
||||
Command="{Binding EscCommand}" />
|
||||
<KeyBinding Key="OemCloseBrackets"
|
||||
Command="{Binding IncreaseWidthCommand}"
|
||||
Modifiers="Control" />
|
||||
<KeyBinding
|
||||
Key="OemOpenBrackets"
|
||||
<KeyBinding Key="OemOpenBrackets"
|
||||
Command="{Binding DecreaseWidthCommand}"
|
||||
Modifiers="Control" />
|
||||
<KeyBinding
|
||||
Key="OemPlus"
|
||||
<KeyBinding Key="OemPlus"
|
||||
Command="{Binding IncreaseMaxResultCommand}"
|
||||
Modifiers="Control" />
|
||||
<KeyBinding
|
||||
Key="OemMinus"
|
||||
<KeyBinding Key="OemMinus"
|
||||
Command="{Binding DecreaseMaxResultCommand}"
|
||||
Modifiers="Control" />
|
||||
<KeyBinding
|
||||
Key="H"
|
||||
<KeyBinding Key="H"
|
||||
Command="{Binding LoadHistoryCommand}"
|
||||
Modifiers="Ctrl" />
|
||||
<KeyBinding Key="Enter"
|
||||
|
|
@ -195,32 +192,51 @@
|
|||
<TextBox.ContextMenu>
|
||||
<ContextMenu>
|
||||
<MenuItem Command="ApplicationCommands.Cut"
|
||||
Header="{DynamicResource cut}" />
|
||||
Header="{DynamicResource cut}">
|
||||
<MenuItem.Icon>
|
||||
<ui:FontIcon Glyph="" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="ApplicationCommands.Copy"
|
||||
Header="{DynamicResource copy}" />
|
||||
Header="{DynamicResource copy}">
|
||||
<MenuItem.Icon>
|
||||
<ui:FontIcon Glyph="" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="ApplicationCommands.Paste"
|
||||
Header="{DynamicResource paste}" />
|
||||
Header="{DynamicResource paste}">
|
||||
<MenuItem.Icon>
|
||||
<ui:FontIcon Glyph="" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<Separator Margin="0"
|
||||
Padding="0,4,0,4"
|
||||
Background="{DynamicResource ContextSeparator}" />
|
||||
<MenuItem Click="OnContextMenusForSettingsClick"
|
||||
Header="{DynamicResource flowlauncher_settings}" />
|
||||
Header="{DynamicResource flowlauncher_settings}">
|
||||
<MenuItem.Icon>
|
||||
<ui:FontIcon Glyph="" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Command="{Binding EscCommand}"
|
||||
Header="{DynamicResource closeWindow}" />
|
||||
Header="{DynamicResource closeWindow}">
|
||||
<MenuItem.Icon>
|
||||
<ui:FontIcon Glyph="" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ContextMenu>
|
||||
</TextBox.ContextMenu>
|
||||
</TextBox>
|
||||
|
||||
<StackPanel x:Name="ClockPanel"
|
||||
Style="{DynamicResource ClockPanel}"
|
||||
IsHitTestVisible="False">
|
||||
<TextBlock
|
||||
Visibility="{Binding Settings.UseDate, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Style="{DynamicResource DateBox}"
|
||||
Text="{Binding DateText}" />
|
||||
IsHitTestVisible="False"
|
||||
Style="{DynamicResource ClockPanel}">
|
||||
<TextBlock Style="{DynamicResource DateBox}"
|
||||
Text="{Binding DateText}"
|
||||
Visibility="{Binding Settings.UseDate, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
||||
<TextBlock Style="{DynamicResource ClockBox}"
|
||||
Visibility="{Binding Settings.UseClock, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
Text="{Binding ClockText}"/>
|
||||
Text="{Binding ClockText}"
|
||||
Visibility="{Binding Settings.UseClock, Converter={StaticResource BooleanToVisibilityConverter}}" />
|
||||
</StackPanel>
|
||||
|
||||
<Canvas Style="{DynamicResource SearchIconPosition}">
|
||||
|
|
@ -300,7 +316,8 @@
|
|||
<ContentControl>
|
||||
<flowlauncher:ResultListBox x:Name="ResultListBox"
|
||||
DataContext="{Binding Results}"
|
||||
PreviewMouseLeftButtonUp="OnPreviewMouseButtonDown" />
|
||||
LeftClickResultCommand="{Binding LeftClickResultCommand}"
|
||||
RightClickResultCommand="{Binding RightClickResultCommand}" />
|
||||
</ContentControl>
|
||||
</Border>
|
||||
<Border Style="{DynamicResource WindowRadius}">
|
||||
|
|
@ -317,7 +334,8 @@
|
|||
<ContentControl>
|
||||
<flowlauncher:ResultListBox x:Name="ContextMenu"
|
||||
DataContext="{Binding ContextMenu}"
|
||||
PreviewMouseDown="OnPreviewMouseButtonDown" />
|
||||
LeftClickResultCommand="{Binding LeftClickResultCommand}"
|
||||
RightClickResultCommand="{Binding RightClickResultCommand}" />
|
||||
</ContentControl>
|
||||
</Border>
|
||||
<Border Style="{DynamicResource WindowRadius}">
|
||||
|
|
@ -334,7 +352,8 @@
|
|||
<ContentControl>
|
||||
<flowlauncher:ResultListBox x:Name="History"
|
||||
DataContext="{Binding History}"
|
||||
PreviewMouseDown="OnPreviewMouseButtonDown" />
|
||||
LeftClickResultCommand="{Binding LeftClickResultCommand}"
|
||||
RightClickResultCommand="{Binding RightClickResultCommand}" />
|
||||
</ContentControl>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Threading.Tasks;
|
||||
using System.Windows;
|
||||
|
|
@ -27,6 +27,9 @@ using Microsoft.AspNetCore.Http;
|
|||
using System.IO;
|
||||
using System.Windows.Threading;
|
||||
using System.Windows.Data;
|
||||
using ModernWpf.Controls;
|
||||
using System.Drawing;
|
||||
using System.Windows.Forms.Design.Behavior;
|
||||
|
||||
namespace Flow.Launcher
|
||||
{
|
||||
|
|
@ -224,11 +227,12 @@ namespace Flow.Launcher
|
|||
private void UpdateNotifyIconText()
|
||||
{
|
||||
var menu = contextMenu;
|
||||
((MenuItem)menu.Items[1]).Header = InternationalizationManager.Instance.GetTranslation("iconTrayOpen") + " (" + _settings.Hotkey + ")";
|
||||
((MenuItem)menu.Items[2]).Header = InternationalizationManager.Instance.GetTranslation("GameMode");
|
||||
((MenuItem)menu.Items[3]).Header = InternationalizationManager.Instance.GetTranslation("PositionReset");
|
||||
((MenuItem)menu.Items[4]).Header = InternationalizationManager.Instance.GetTranslation("iconTraySettings");
|
||||
((MenuItem)menu.Items[5]).Header = InternationalizationManager.Instance.GetTranslation("iconTrayExit");
|
||||
((MenuItem)menu.Items[0]).Header = InternationalizationManager.Instance.GetTranslation("iconTrayOpen") + " (" + _settings.Hotkey + ")";
|
||||
((MenuItem)menu.Items[1]).Header = InternationalizationManager.Instance.GetTranslation("GameMode");
|
||||
((MenuItem)menu.Items[2]).Header = InternationalizationManager.Instance.GetTranslation("PositionReset");
|
||||
((MenuItem)menu.Items[3]).Header = InternationalizationManager.Instance.GetTranslation("iconTraySettings");
|
||||
((MenuItem)menu.Items[4]).Header = InternationalizationManager.Instance.GetTranslation("iconTrayExit");
|
||||
|
||||
}
|
||||
|
||||
private void InitializeNotifyIcon()
|
||||
|
|
@ -240,31 +244,35 @@ namespace Flow.Launcher
|
|||
Visible = !_settings.HideNotifyIcon
|
||||
};
|
||||
contextMenu = new ContextMenu();
|
||||
|
||||
var header = new MenuItem
|
||||
{
|
||||
Header = "Flow Launcher",
|
||||
IsEnabled = false
|
||||
};
|
||||
var openIcon = new FontIcon { Glyph = "\ue71e" };
|
||||
var open = new MenuItem
|
||||
{
|
||||
Header = InternationalizationManager.Instance.GetTranslation("iconTrayOpen") + " (" +_settings.Hotkey + ")"
|
||||
Header = InternationalizationManager.Instance.GetTranslation("iconTrayOpen") + " (" + _settings.Hotkey + ")",
|
||||
Icon = openIcon
|
||||
};
|
||||
var gamemodeIcon = new FontIcon { Glyph = "\ue7fc" };
|
||||
var gamemode = new MenuItem
|
||||
{
|
||||
Header = InternationalizationManager.Instance.GetTranslation("GameMode")
|
||||
Header = InternationalizationManager.Instance.GetTranslation("GameMode"),
|
||||
Icon = gamemodeIcon
|
||||
};
|
||||
var positionresetIcon = new FontIcon { Glyph = "\ue73f" };
|
||||
var positionreset = new MenuItem
|
||||
{
|
||||
Header = InternationalizationManager.Instance.GetTranslation("PositionReset")
|
||||
Header = InternationalizationManager.Instance.GetTranslation("PositionReset"),
|
||||
Icon = positionresetIcon
|
||||
};
|
||||
var settingsIcon = new FontIcon { Glyph = "\ue713" };
|
||||
var settings = new MenuItem
|
||||
{
|
||||
Header = InternationalizationManager.Instance.GetTranslation("iconTraySettings")
|
||||
Header = InternationalizationManager.Instance.GetTranslation("iconTraySettings"),
|
||||
Icon = settingsIcon
|
||||
};
|
||||
var exitIcon = new FontIcon { Glyph = "\ue7e8" };
|
||||
var exit = new MenuItem
|
||||
{
|
||||
Header = InternationalizationManager.Instance.GetTranslation("iconTrayExit")
|
||||
Header = InternationalizationManager.Instance.GetTranslation("iconTrayExit"),
|
||||
Icon = exitIcon
|
||||
};
|
||||
|
||||
open.Click += (o, e) => _viewModel.ToggleFlowLauncher();
|
||||
|
|
@ -272,7 +280,6 @@ namespace Flow.Launcher
|
|||
positionreset.Click += (o, e) => PositionReset();
|
||||
settings.Click += (o, e) => App.API.OpenSettingDialog();
|
||||
exit.Click += (o, e) => Close();
|
||||
contextMenu.Items.Add(header);
|
||||
contextMenu.Items.Add(open);
|
||||
gamemode.ToolTip = InternationalizationManager.Instance.GetTranslation("GameModeToolTip");
|
||||
positionreset.ToolTip = InternationalizationManager.Instance.GetTranslation("PositionResetToolTip");
|
||||
|
|
@ -398,28 +405,6 @@ namespace Flow.Launcher
|
|||
if (e.ChangedButton == MouseButton.Left) DragMove();
|
||||
}
|
||||
|
||||
private void OnPreviewMouseButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (sender != null && e.OriginalSource != null)
|
||||
{
|
||||
var r = (ResultListBox)sender;
|
||||
var d = (DependencyObject)e.OriginalSource;
|
||||
var item = ItemsControl.ContainerFromElement(r, d) as ListBoxItem;
|
||||
var result = (ResultViewModel)item?.DataContext;
|
||||
if (result != null)
|
||||
{
|
||||
if (e.ChangedButton == MouseButton.Left)
|
||||
{
|
||||
_viewModel.OpenResultCommand.Execute(null);
|
||||
}
|
||||
else if (e.ChangedButton == MouseButton.Right)
|
||||
{
|
||||
_viewModel.LoadContextMenuCommand.Execute(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private void OnPreviewDragOver(object sender, DragEventArgs e)
|
||||
{
|
||||
e.Handled = true;
|
||||
|
|
|
|||
|
|
@ -1407,7 +1407,8 @@
|
|||
Padding="{TemplateBinding Padding}"
|
||||
BorderBrush="{DynamicResource ButtonInsideBorder}"
|
||||
BorderThickness="{DynamicResource CustomButtonInsideBorderThickness}"
|
||||
CornerRadius="4">
|
||||
CornerRadius="4"
|
||||
SnapsToDevicePixels="True">
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
|
|
@ -2727,73 +2728,491 @@
|
|||
</Style>
|
||||
<!--#endregion-->
|
||||
|
||||
<Style TargetType="{x:Type MenuItem}">
|
||||
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
|
||||
<Setter Property="VerticalContentAlignment" Value="{Binding VerticalContentAlignment, RelativeSource={RelativeSource AncestorType={x:Type ItemsControl}}}" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource Color05B}" />
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
|
||||
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||
|
||||
<system:Double x:Key="MenuBarHeight">40</system:Double>
|
||||
<Thickness x:Key="MenuFlyoutScrollerMargin">4,4,4,4</Thickness>
|
||||
<Thickness x:Key="MenuFlyoutItemRevealBorderThickness">1</Thickness>
|
||||
<Thickness x:Key="ToggleMenuFlyoutItemRevealBorderThickness">1</Thickness>
|
||||
<Thickness x:Key="MenuFlyoutSubItemRevealBorderThickness">1</Thickness>
|
||||
|
||||
<ui:SharedSizeGroupConverter x:Key="SharedSizeGroupConverter" />
|
||||
|
||||
<Style x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type FrameworkElement}, ResourceId=MenuScrollViewer}" TargetType="ScrollViewer">
|
||||
<Setter Property="HorizontalScrollBarVisibility" Value="Disabled" />
|
||||
<Setter Property="VerticalScrollBarVisibility" Value="Auto" />
|
||||
<Setter Property="PanningMode" Value="VerticalOnly" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="DefaultMenuItemSeparatorStyle" TargetType="Separator">
|
||||
<Setter Property="Background" Value="{DynamicResource MenuFlyoutSeparatorBackground}" />
|
||||
<Setter Property="Padding" Value="{DynamicResource MenuFlyoutSeparatorThemePadding}" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="true" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type MenuItem}">
|
||||
<Border
|
||||
Name="bdr"
|
||||
Padding="24,6,24,6"
|
||||
Background="Transparent">
|
||||
<TextBlock
|
||||
Name="Menu"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Foreground="{DynamicResource Color05B}"
|
||||
Text="{Binding RelativeSource={RelativeSource Mode=TemplatedParent}, Path=Header}" />
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsVisible" Value="True">
|
||||
<Setter TargetName="bdr" Property="Background" Value="{DynamicResource CustomContextBackground}" />
|
||||
<Setter TargetName="Menu" Property="Foreground" Value="{DynamicResource Color05B}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="bdr" Property="Background" Value="{DynamicResource CustomContextHover}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="Menu" Property="Foreground" Value="{DynamicResource CustomContextDisabled}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
<ControlTemplate TargetType="Separator">
|
||||
<Rectangle
|
||||
Height="{DynamicResource MenuFlyoutSeparatorThemeHeight}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
Fill="{TemplateBinding Background}" />
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="{x:Type ContextMenu}">
|
||||
<Style
|
||||
x:Key="{x:Static MenuItem.SeparatorStyleKey}"
|
||||
BasedOn="{StaticResource DefaultMenuItemSeparatorStyle}"
|
||||
TargetType="Separator" />
|
||||
|
||||
<ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=TopLevelItemTemplateKey}" TargetType="{x:Type MenuItem}">
|
||||
<Grid
|
||||
x:Name="ContentRoot"
|
||||
Background="{TemplateBinding Background}"
|
||||
SnapsToDevicePixels="True">
|
||||
<Border
|
||||
x:Name="Background"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}" />
|
||||
|
||||
<ContentPresenter
|
||||
Margin="12,0,12,0"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
ContentSource="Header"
|
||||
RecognizesAccessKey="True"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Background" Property="Background" Value="{DynamicResource MenuBarItemBackgroundPointerOver}" />
|
||||
<Setter TargetName="Background" Property="BorderBrush" Value="{DynamicResource MenuBarItemBorderBrushPointerOver}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="Background" Property="Background" Value="{DynamicResource MenuBarItemBackgroundPressed}" />
|
||||
<Setter TargetName="Background" Property="BorderBrush" Value="{DynamicResource MenuBarItemBorderBrushPressed}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=TopLevelHeaderTemplateKey}" TargetType="{x:Type MenuItem}">
|
||||
<Grid
|
||||
x:Name="ContentRoot"
|
||||
Background="{TemplateBinding Background}"
|
||||
SnapsToDevicePixels="True">
|
||||
<Border
|
||||
x:Name="Background"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}" />
|
||||
|
||||
<ContentPresenter
|
||||
Margin="12,0,12,0"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
ContentSource="Header"
|
||||
RecognizesAccessKey="True"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
|
||||
<ui:MenuPopup
|
||||
x:Name="PART_Popup"
|
||||
AllowsTransparency="true"
|
||||
Focusable="false"
|
||||
IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Placement="Bottom"
|
||||
PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}">
|
||||
<ui:ThemeShadowChrome CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}" IsShadowEnabled="{DynamicResource {x:Static SystemParameters.DropShadowKey}}">
|
||||
<Border
|
||||
x:Name="SubMenuRoot"
|
||||
Background="{DynamicResource MenuFlyoutPresenterBackground}"
|
||||
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}">
|
||||
<Grid>
|
||||
<ScrollViewer
|
||||
x:Name="SubMenuScrollViewer"
|
||||
MinWidth="{DynamicResource FlyoutThemeMinWidth}"
|
||||
Margin="{DynamicResource MenuFlyoutPresenterThemePadding}"
|
||||
Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer,
|
||||
TypeInTargetAssembly={x:Type FrameworkElement}}}">
|
||||
<ItemsPresenter
|
||||
Grid.IsSharedSizeScope="true"
|
||||
KeyboardNavigation.DirectionalNavigation="Cycle"
|
||||
KeyboardNavigation.TabNavigation="Cycle"
|
||||
RenderOptions.ClearTypeHint="Enabled"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</ScrollViewer>
|
||||
<Border
|
||||
x:Name="SubMenuBorder"
|
||||
BorderBrush="{DynamicResource MenuFlyoutPresenterBorderBrush}"
|
||||
BorderThickness="{DynamicResource MenuFlyoutPresenterBorderThemeThickness}"
|
||||
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</ui:ThemeShadowChrome>
|
||||
</ui:MenuPopup>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSuspendingPopupAnimation" Value="true">
|
||||
<Setter TargetName="PART_Popup" Property="PopupAnimation" Value="None" />
|
||||
</Trigger>
|
||||
<Trigger SourceName="PART_Popup" Property="IsSuspendingAnimation" Value="true">
|
||||
<Setter TargetName="PART_Popup" Property="PopupAnimation" Value="None" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Background" Property="Background" Value="{DynamicResource MenuBarItemBackgroundPointerOver}" />
|
||||
<Setter TargetName="Background" Property="BorderBrush" Value="{DynamicResource MenuBarItemBorderBrushPointerOver}" />
|
||||
</Trigger>
|
||||
<!-- Selected -->
|
||||
<Trigger Property="IsSubmenuOpen" Value="True">
|
||||
<Setter TargetName="Background" Property="Background" Value="{DynamicResource MenuBarItemBackgroundSelected}" />
|
||||
<Setter TargetName="Background" Property="BorderBrush" Value="{DynamicResource MenuBarItemBorderBrushSelected}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="Background" Property="Background" Value="{DynamicResource MenuBarItemBackgroundPressed}" />
|
||||
<Setter TargetName="Background" Property="BorderBrush" Value="{DynamicResource MenuBarItemBorderBrushPressed}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<!-- DefaultMenuFlyoutSubItemStyle -->
|
||||
<ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=SubmenuItemTemplateKey}" TargetType="{x:Type MenuItem}">
|
||||
<ControlTemplate.Resources>
|
||||
<StreamGeometry x:Key="CheckMark">F1 M 17.939453 5.439453 L 7.5 15.888672 L 2.060547 10.439453 L 2.939453 9.560547 L 7.5 14.111328 L 17.060547 4.560547 Z</StreamGeometry>
|
||||
</ControlTemplate.Resources>
|
||||
<Border
|
||||
x:Name="LayoutRoot"
|
||||
Height="Auto"
|
||||
Margin="5,2,5,2"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
|
||||
SnapsToDevicePixels="true"
|
||||
TextElement.Foreground="{DynamicResource Color05B}"
|
||||
UseLayoutRounding="True">
|
||||
<Grid x:Name="AnimationRoot">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="{TemplateBinding Visibility, Converter={StaticResource SharedSizeGroupConverter}, ConverterParameter=MenuItemCheckColumnGroup}" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="{TemplateBinding Visibility, Converter={StaticResource SharedSizeGroupConverter}, ConverterParameter=MenuItemIconColumnGroup}" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<ui:FontIconFallback
|
||||
x:Name="CheckGlyph"
|
||||
Margin="0,0,16,0"
|
||||
Data="{StaticResource CheckMark}"
|
||||
FontFamily="{DynamicResource SymbolThemeFontFamily}"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource ToggleMenuFlyoutItemCheckGlyphForeground}"
|
||||
Opacity="0"
|
||||
Visibility="Collapsed" />
|
||||
<Viewbox
|
||||
x:Name="IconRoot"
|
||||
Grid.Column="1"
|
||||
Width="16"
|
||||
Height="16"
|
||||
Margin="0,1,12,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Stretch"
|
||||
TextBlock.FontFamily="/Resources/#Segoe Fluent Icons">
|
||||
<ContentPresenter
|
||||
x:Name="IconContent"
|
||||
ContentSource="Icon"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</Viewbox>
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
ContentSource="Header"
|
||||
RecognizesAccessKey="True"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
TextElement.Foreground="{DynamicResource Color05B}" />
|
||||
<TextBlock
|
||||
x:Name="KeyboardAcceleratorTextBlock"
|
||||
Grid.Column="3"
|
||||
Margin="24,4,0,0"
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
Foreground="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForeground}"
|
||||
Style="{StaticResource CaptionTextBlockStyle}"
|
||||
Text="{TemplateBinding InputGestureText}"
|
||||
Visibility="Collapsed" />
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsVisible" Value="True">
|
||||
<Setter TargetName="LayoutRoot" Property="TextElement.Foreground" Value="{DynamicResource Color05B}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource Color05B}" />
|
||||
</Trigger>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter TargetName="IconRoot" Property="Visibility" Value="Collapsed" />
|
||||
</Trigger>
|
||||
<Trigger Property="InputGestureText" Value="">
|
||||
<Setter TargetName="KeyboardAcceleratorTextBlock" Property="Visibility" Value="Collapsed" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsChecked" Value="True">
|
||||
<Setter TargetName="CheckGlyph" Property="Opacity" Value="1" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsCheckable" Value="True">
|
||||
<Setter TargetName="CheckGlyph" Property="Visibility" Value="Visible" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsHighlighted" Value="True">
|
||||
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource CustomContextHover}" />
|
||||
<Setter TargetName="LayoutRoot" Property="TextElement.Foreground" Value="{DynamicResource Color05B}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource Color05B}" />
|
||||
<Setter TargetName="KeyboardAcceleratorTextBlock" Property="Foreground" Value="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForegroundPointerOver}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource CustomContextClick}" />
|
||||
<Setter TargetName="LayoutRoot" Property="TextElement.Foreground" Value="{DynamicResource Color05B}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource Color05B}" />
|
||||
<Setter TargetName="KeyboardAcceleratorTextBlock" Property="Foreground" Value="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForegroundPressed}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource MenuFlyoutItemBackgroundDisabled}" />
|
||||
<Setter TargetName="LayoutRoot" Property="TextElement.Foreground" Value="{DynamicResource MenuFlyoutItemForegroundDisabled}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource MenuFlyoutItemForegroundDisabled}" />
|
||||
<Setter TargetName="KeyboardAcceleratorTextBlock" Property="Foreground" Value="{DynamicResource MenuFlyoutItemKeyboardAcceleratorTextForegroundDisabled}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<!-- DefaultMenuFlyoutItemStyle -->
|
||||
<ControlTemplate x:Key="{ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=SubmenuHeaderTemplateKey}" TargetType="{x:Type MenuItem}">
|
||||
<ControlTemplate.Resources>
|
||||
<StreamGeometry x:Key="ChevronRight">M 5.029297 19.091797 L 14.111328 10 L 5.029297 0.908203 L 5.908203 0.029297 L 15.888672 10 L 5.908203 19.970703 Z</StreamGeometry>
|
||||
</ControlTemplate.Resources>
|
||||
<Border
|
||||
x:Name="LayoutRoot"
|
||||
Margin="{DynamicResource MenuFlyoutItemMargin}"
|
||||
Padding="{TemplateBinding Padding}"
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
|
||||
SnapsToDevicePixels="True">
|
||||
<Grid x:Name="AnimationRoot">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemCheckColumnGroup" />
|
||||
<ColumnDefinition Width="Auto" SharedSizeGroup="MenuItemIconColumnGroup" />
|
||||
<ColumnDefinition Width="*" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Viewbox
|
||||
x:Name="IconRoot"
|
||||
Grid.Column="1"
|
||||
Width="16"
|
||||
Height="16"
|
||||
Margin="0,0,12,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center">
|
||||
<ContentPresenter
|
||||
x:Name="IconContent"
|
||||
ContentSource="Icon"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</Viewbox>
|
||||
<ContentPresenter
|
||||
x:Name="ContentPresenter"
|
||||
Grid.Column="2"
|
||||
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
|
||||
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
|
||||
ContentSource="Header"
|
||||
RecognizesAccessKey="True"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
|
||||
TextElement.Foreground="{TemplateBinding Foreground}" />
|
||||
<ui:FontIconFallback
|
||||
x:Name="SubItemChevron"
|
||||
Grid.Column="3"
|
||||
Margin="{DynamicResource MenuFlyoutItemChevronMargin}"
|
||||
Data="{StaticResource ChevronRight}"
|
||||
FontFamily="{DynamicResource SymbolThemeFontFamily}"
|
||||
FontSize="12"
|
||||
Foreground="{DynamicResource MenuFlyoutSubItemChevron}">
|
||||
<UIElement.RenderTransform>
|
||||
<TranslateTransform Y="1" />
|
||||
</UIElement.RenderTransform>
|
||||
</ui:FontIconFallback>
|
||||
<Popup
|
||||
x:Name="PART_Popup"
|
||||
AllowsTransparency="true"
|
||||
Focusable="false"
|
||||
IsOpen="{Binding IsSubmenuOpen, RelativeSource={RelativeSource TemplatedParent}}"
|
||||
Placement="Right"
|
||||
PlacementTarget="{Binding ElementName=LayoutRoot}"
|
||||
PopupAnimation="{DynamicResource {x:Static SystemParameters.MenuPopupAnimationKey}}">
|
||||
<Popup.PlacementRectangle>
|
||||
<MultiBinding>
|
||||
<MultiBinding.Converter>
|
||||
<ui:PlacementRectangleConverter Margin="4,-1" />
|
||||
</MultiBinding.Converter>
|
||||
<Binding ElementName="LayoutRoot" Path="ActualWidth" />
|
||||
<Binding ElementName="LayoutRoot" Path="ActualHeight" />
|
||||
</MultiBinding>
|
||||
</Popup.PlacementRectangle>
|
||||
<ui:ThemeShadowChrome CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}" IsShadowEnabled="{DynamicResource {x:Static SystemParameters.DropShadowKey}}">
|
||||
<Border
|
||||
x:Name="SubMenuRoot"
|
||||
Background="{DynamicResource MenuFlyoutPresenterBackground}"
|
||||
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}">
|
||||
<Grid>
|
||||
<ScrollViewer
|
||||
x:Name="SubMenuScrollViewer"
|
||||
MinWidth="{DynamicResource FlyoutThemeMinWidth}"
|
||||
Margin="{DynamicResource MenuFlyoutPresenterThemePadding}"
|
||||
Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer,
|
||||
TypeInTargetAssembly={x:Type FrameworkElement}}}">
|
||||
<ItemsPresenter
|
||||
Grid.IsSharedSizeScope="true"
|
||||
KeyboardNavigation.DirectionalNavigation="Cycle"
|
||||
KeyboardNavigation.TabNavigation="Cycle"
|
||||
RenderOptions.ClearTypeHint="Enabled"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</ScrollViewer>
|
||||
<Border
|
||||
x:Name="SubMenuBorder"
|
||||
BorderBrush="{DynamicResource MenuFlyoutPresenterBorderBrush}"
|
||||
BorderThickness="{DynamicResource MenuFlyoutPresenterBorderThemeThickness}"
|
||||
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</ui:ThemeShadowChrome>
|
||||
</Popup>
|
||||
</Grid>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsVisible" Value="True">
|
||||
<Setter TargetName="LayoutRoot" Property="TextElement.Foreground" Value="{DynamicResource Color05B}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource Color05B}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsSuspendingPopupAnimation" Value="true">
|
||||
<Setter TargetName="PART_Popup" Property="PopupAnimation" Value="None" />
|
||||
</Trigger>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter TargetName="IconRoot" Property="Visibility" Value="Collapsed" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsHighlighted" Value="True">
|
||||
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource MenuFlyoutSubItemBackgroundPointerOver}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource MenuFlyoutSubItemForegroundPointerOver}" />
|
||||
<Setter TargetName="SubItemChevron" Property="Foreground" Value="{DynamicResource MenuFlyoutSubItemChevronPointerOver}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsPressed" Value="True">
|
||||
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource MenuFlyoutSubItemBackgroundPressed}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource MenuFlyoutSubItemForegroundPressed}" />
|
||||
<Setter TargetName="SubItemChevron" Property="Foreground" Value="{DynamicResource MenuFlyoutSubItemChevronPressed}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsSubmenuOpen" Value="True">
|
||||
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource MenuFlyoutSubItemBackgroundSubMenuOpened}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource MenuFlyoutSubItemForegroundSubMenuOpened}" />
|
||||
<Setter TargetName="SubItemChevron" Property="Foreground" Value="{DynamicResource MenuFlyoutSubItemChevronSubMenuOpened}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsEnabled" Value="False">
|
||||
<Setter TargetName="LayoutRoot" Property="Background" Value="{DynamicResource MenuFlyoutSubItemBackgroundDisabled}" />
|
||||
<Setter TargetName="ContentPresenter" Property="TextElement.Foreground" Value="{DynamicResource MenuFlyoutSubItemForegroundDisabled}" />
|
||||
<Setter TargetName="SubItemChevron" Property="Foreground" Value="{DynamicResource MenuFlyoutSubItemChevronDisabled}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
|
||||
<Style x:Key="DefaultMenuItemStyle" TargetType="{x:Type MenuItem}">
|
||||
<Setter Property="OverridesDefaultStyle" Value="True" />
|
||||
<Setter Property="SnapsToDevicePixels" Value="True" />
|
||||
<Setter Property="Background" Value="{DynamicResource MenuFlyoutItemBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource MenuFlyoutItemForeground}" />
|
||||
<Setter Property="Padding" Value="{DynamicResource MenuFlyoutItemThemePaddingNarrow}" />
|
||||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Center" />
|
||||
<Setter Property="ScrollViewer.PanningMode" Value="Both" />
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
|
||||
<Setter Property="FocusVisualStyle" Value="{DynamicResource {x:Static SystemParameters.FocusVisualStyleKey}}" />
|
||||
<Setter Property="ui:FocusVisualHelper.UseSystemFocusVisuals" Value="{DynamicResource UseSystemFocusVisuals}" />
|
||||
<Setter Property="ui:ControlHelper.CornerRadius" Value="{DynamicResource ControlCornerRadius}" />
|
||||
<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=SubmenuItemTemplateKey}}" />
|
||||
<Style.Triggers>
|
||||
<Trigger Property="Role" Value="TopLevelHeader">
|
||||
<Setter Property="Background" Value="{DynamicResource MenuBarItemBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource MenuBarItemBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource MenuBarItemBorderThickness}" />
|
||||
<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=TopLevelHeaderTemplateKey}}" />
|
||||
<Setter Property="IsTabStop" Value="True" />
|
||||
<Setter Property="Height" Value="{StaticResource MenuBarHeight}" />
|
||||
</Trigger>
|
||||
<Trigger Property="Role" Value="TopLevelItem">
|
||||
<Setter Property="Background" Value="{DynamicResource MenuBarItemBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource MenuBarItemBorderBrush}" />
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource MenuBarItemBorderThickness}" />
|
||||
<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=TopLevelItemTemplateKey}}" />
|
||||
<Setter Property="IsTabStop" Value="True" />
|
||||
<Setter Property="Height" Value="{StaticResource MenuBarHeight}" />
|
||||
</Trigger>
|
||||
<Trigger Property="Role" Value="SubmenuHeader">
|
||||
<Setter Property="Background" Value="{DynamicResource MenuFlyoutSubItemBackground}" />
|
||||
<Setter Property="Foreground" Value="{DynamicResource MenuFlyoutSubItemForeground}" />
|
||||
<Setter Property="Template" Value="{DynamicResource {ComponentResourceKey TypeInTargetAssembly={x:Type MenuItem}, ResourceId=SubmenuHeaderTemplateKey}}" />
|
||||
</Trigger>
|
||||
<Trigger Property="IsCheckable" Value="True">
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="ui:FocusVisualHelper.UseSystemFocusVisuals" Value="True" />
|
||||
</Trigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style BasedOn="{StaticResource DefaultMenuItemStyle}" TargetType="{x:Type MenuItem}" />
|
||||
|
||||
|
||||
|
||||
<Style TargetType="{x:Type ContextMenu}">
|
||||
<Setter Property="Background" Value="{DynamicResource CustomContextBackground}" />
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource CustomContextBorder}" />
|
||||
<Setter Property="BorderThickness" Value="{DynamicResource MenuFlyoutPresenterBorderThemeThickness}" />
|
||||
<Setter Property="Padding" Value="{DynamicResource MenuFlyoutPresenterThemePadding}" />
|
||||
<Setter Property="FontFamily" Value="{DynamicResource ContentControlThemeFontFamily}" />
|
||||
<Setter Property="FontSize" Value="{DynamicResource ControlContentThemeFontSize}" />
|
||||
<Setter Property="FontStyle" Value="Normal" />
|
||||
<Setter Property="FontWeight" Value="Normal" />
|
||||
<Setter Property="Grid.IsSharedSizeScope" Value="true" />
|
||||
<Setter Property="HasDropShadow" Value="{DynamicResource {x:Static SystemParameters.DropShadowKey}}" />
|
||||
<!--<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled" />-->
|
||||
<!--<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />-->
|
||||
<!--<Setter Property="ScrollViewer.PanningMode" Value="VerticalOnly" />-->
|
||||
<Setter Property="Stylus.IsFlicksEnabled" Value="False" />
|
||||
<Setter Property="MaxWidth" Value="{DynamicResource FlyoutThemeMaxWidth}" />
|
||||
<Setter Property="MinHeight" Value="{DynamicResource MenuFlyoutThemeMinHeight}" />
|
||||
<Setter Property="ui:ControlHelper.CornerRadius" Value="{DynamicResource OverlayCornerRadius}" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ContextMenu}">
|
||||
<Border
|
||||
x:Name="Border"
|
||||
Margin="5,4,5,12"
|
||||
Padding="0,4,0,4"
|
||||
Background="{DynamicResource CustomContextBackground}"
|
||||
BorderBrush="{DynamicResource CustomContextBorder}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="8"
|
||||
UseLayoutRounding="True">
|
||||
<Border.Effect>
|
||||
<DropShadowEffect
|
||||
BlurRadius="12"
|
||||
Direction="-90"
|
||||
Opacity=".15"
|
||||
ShadowDepth="6"
|
||||
Color="Black" />
|
||||
</Border.Effect>
|
||||
<StackPanel
|
||||
x:Name="Panel"
|
||||
ClipToBounds="True"
|
||||
IsItemsHost="True"
|
||||
Orientation="Vertical" />
|
||||
</Border>
|
||||
<ui:ThemeShadowChrome
|
||||
x:Name="Shdw"
|
||||
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}"
|
||||
IsShadowEnabled="{TemplateBinding HasDropShadow}"
|
||||
SnapsToDevicePixels="True">
|
||||
<Border
|
||||
x:Name="Border"
|
||||
Padding="0,4,0,4"
|
||||
Background="{DynamicResource CustomContextBackground}"
|
||||
BorderBrush="{DynamicResource CustomContextBorder}"
|
||||
BorderThickness="1"
|
||||
CornerRadius="8">
|
||||
<Grid>
|
||||
<ScrollViewer
|
||||
x:Name="ContextMenuScrollViewer"
|
||||
MinWidth="{DynamicResource FlyoutThemeMinWidth}"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
Style="{DynamicResource {ComponentResourceKey ResourceId=MenuScrollViewer,
|
||||
TypeInTargetAssembly={x:Type FrameworkElement}}}">
|
||||
<ItemsPresenter
|
||||
KeyboardNavigation.DirectionalNavigation="Cycle"
|
||||
RenderOptions.ClearTypeHint="Enabled"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</ScrollViewer>
|
||||
<Border
|
||||
x:Name="ContextMenuBorder"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="0"
|
||||
CornerRadius="{TemplateBinding ui:ControlHelper.CornerRadius}" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</ui:ThemeShadowChrome>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsVisible" Value="true">
|
||||
<Setter TargetName="Border" Property="Background" Value="{DynamicResource CustomContextBackground}" />
|
||||
|
|
@ -2808,4 +3227,7 @@
|
|||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<ui:TextContextMenu x:Key="TextControlContextMenu" x:Shared="False" />
|
||||
|
||||
</ResourceDictionary>
|
||||
|
|
|
|||
|
|
@ -65,7 +65,8 @@
|
|||
|
||||
<SolidColorBrush x:Key="CustomContextBorder" Color="#1b1b1b" />
|
||||
<SolidColorBrush x:Key="CustomContextBackground" Color="#2b2b2b" />
|
||||
<SolidColorBrush x:Key="CustomContextHover" Color="#3c3c3c" />
|
||||
<SolidColorBrush x:Key="CustomContextHover" Color="#3a3a3a" />
|
||||
<SolidColorBrush x:Key="CustomContextClick" Color="#353535" />
|
||||
<SolidColorBrush x:Key="CustomContextDisabled" Color="#868686" />
|
||||
<SolidColorBrush x:Key="ContextSeparator" Color="#3c3c3c" />
|
||||
|
||||
|
|
|
|||
|
|
@ -58,7 +58,8 @@
|
|||
|
||||
<SolidColorBrush x:Key="CustomContextBorder" Color="#dadada" />
|
||||
<SolidColorBrush x:Key="CustomContextBackground" Color="#f2f2f2" />
|
||||
<SolidColorBrush x:Key="CustomContextHover" Color="#DBDBDB" />
|
||||
<SolidColorBrush x:Key="CustomContextHover" Color="#e4e4e4" />
|
||||
<SolidColorBrush x:Key="CustomContextClick" Color="#ececec" />
|
||||
<SolidColorBrush x:Key="CustomContextDisabled" Color="#868686" />
|
||||
<SolidColorBrush x:Key="ContextSeparator" Color="#dadada" />
|
||||
|
||||
|
|
|
|||
|
|
@ -27,7 +27,9 @@
|
|||
Visibility="{Binding Visbility}"
|
||||
mc:Ignorable="d"
|
||||
PreviewMouseMove="ResultList_MouseMove"
|
||||
PreviewMouseLeftButtonDown="ResultList_PreviewMouseLeftButtonDown">
|
||||
PreviewMouseLeftButtonDown="ResultList_PreviewMouseLeftButtonDown"
|
||||
PreviewMouseLeftButtonUp="ResultListBox_OnPreviewMouseUp"
|
||||
PreviewMouseRightButtonDown="ResultListBox_OnPreviewMouseRightButtonDown">
|
||||
<!-- IsSynchronizedWithCurrentItem: http://stackoverflow.com/a/7833798/2833083 -->
|
||||
|
||||
<ListBox.ItemTemplate>
|
||||
|
|
@ -137,10 +139,11 @@
|
|||
x:Name="Title"
|
||||
VerticalAlignment="Center"
|
||||
DockPanel.Dock="Left"
|
||||
IsHitTestVisible="False"
|
||||
Style="{DynamicResource ItemTitleStyle}"
|
||||
Text="{Binding Result.Title}"
|
||||
ToolTip="{Binding ShowTitleToolTip}">
|
||||
ToolTip="{Binding ShowTitleToolTip}"
|
||||
ToolTipService.ShowOnDisabled="True"
|
||||
IsEnabled="False">
|
||||
<vm:ResultsViewModel.FormattedText>
|
||||
<MultiBinding Converter="{StaticResource HighlightTextConverter}">
|
||||
<Binding Path="Result.Title" />
|
||||
|
|
@ -151,11 +154,11 @@
|
|||
<TextBlock
|
||||
x:Name="SubTitle"
|
||||
Grid.Row="1"
|
||||
IsHitTestVisible="False"
|
||||
IsEnabled="False"
|
||||
ToolTipService.ShowOnDisabled="True"
|
||||
Style="{DynamicResource ItemSubTitleStyle}"
|
||||
Text="{Binding Result.SubTitle}"
|
||||
ToolTip="{Binding ShowSubTitleToolTip}" />
|
||||
|
||||
ToolTip="{Binding ShowSubTitleToolTip}"/>
|
||||
</Grid>
|
||||
|
||||
</Grid>
|
||||
|
|
|
|||
|
|
@ -17,6 +17,36 @@ namespace Flow.Launcher
|
|||
InitializeComponent();
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty RightClickResultCommandProperty =
|
||||
DependencyProperty.Register("RightClickResultCommand", typeof(ICommand), typeof(ResultListBox), new UIPropertyMetadata(null));
|
||||
|
||||
public ICommand RightClickResultCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return (ICommand)GetValue(RightClickResultCommandProperty);
|
||||
}
|
||||
set
|
||||
{
|
||||
SetValue(RightClickResultCommandProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty LeftClickResultCommandProperty =
|
||||
DependencyProperty.Register("LeftClickResultCommand", typeof(ICommand), typeof(ResultListBox), new UIPropertyMetadata(null));
|
||||
|
||||
public ICommand LeftClickResultCommand
|
||||
{
|
||||
get
|
||||
{
|
||||
return (ICommand)GetValue(LeftClickResultCommandProperty);
|
||||
}
|
||||
set
|
||||
{
|
||||
SetValue(LeftClickResultCommandProperty, value);
|
||||
}
|
||||
}
|
||||
|
||||
private void OnSelectionChanged(object sender, SelectionChangedEventArgs e)
|
||||
{
|
||||
if (e.AddedItems.Count > 0 && e.AddedItems[0] != null)
|
||||
|
|
@ -98,10 +128,24 @@ namespace Flow.Launcher
|
|||
path
|
||||
});
|
||||
DragDrop.DoDragDrop((DependencyObject)sender, data, DragDropEffects.Move | DragDropEffects.Copy);
|
||||
|
||||
|
||||
App.API.ChangeQuery(query, true);
|
||||
|
||||
|
||||
e.Handled = true;
|
||||
}
|
||||
private void ResultListBox_OnPreviewMouseRightButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (Mouse.DirectlyOver is not FrameworkElement { DataContext: ResultViewModel result })
|
||||
return;
|
||||
|
||||
RightClickResultCommand?.Execute(result.Result);
|
||||
}
|
||||
private void ResultListBox_OnPreviewMouseUp(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (Mouse.DirectlyOver is not FrameworkElement { DataContext: ResultViewModel result })
|
||||
return;
|
||||
|
||||
LeftClickResultCommand?.Execute(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
Title="{DynamicResource flowlauncher_settings}"
|
||||
Width="{Binding SettingWindowWidth, Mode=TwoWay}"
|
||||
Height="{Binding SettingWindowHeight, Mode=TwoWay}"
|
||||
MinWidth="900"
|
||||
MinWidth="940"
|
||||
MinHeight="600"
|
||||
d:DataContext="{d:DesignInstance vm:SettingWindowViewModel}"
|
||||
Closed="OnClosed"
|
||||
|
|
@ -98,6 +98,7 @@
|
|||
<Style x:Key="SettingTitleLabel" TargetType="{x:Type TextBlock}">
|
||||
<Setter Property="Foreground" Value="{DynamicResource Color05B}" />
|
||||
<Setter Property="Margin" Value="0,0,0,0" />
|
||||
<Setter Property="TextWrapping" Value="Wrap" />
|
||||
</Style>
|
||||
|
||||
<Style x:Key="SettingSubTitleLabel" TargetType="{x:Type TextBlock}">
|
||||
|
|
@ -201,52 +202,46 @@
|
|||
</Setter>
|
||||
<!--#endregion-->
|
||||
</Style>
|
||||
<Style TargetType="{x:Type TabItem}">
|
||||
<Style x:Key="NavTabItem" TargetType="{x:Type TabItem}">
|
||||
<Setter Property="DockPanel.Dock" Value="Top" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type TabItem}">
|
||||
<Border>
|
||||
<Grid>
|
||||
<Grid>
|
||||
<Border
|
||||
x:Name="border"
|
||||
Height="40"
|
||||
Margin="14,4,8,4"
|
||||
Padding="0,0,0,0"
|
||||
HorizontalAlignment="Stretch"
|
||||
Background="{DynamicResource Color01B}"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<Border
|
||||
x:Name="Spacer"
|
||||
Width="Auto"
|
||||
Height="Auto"
|
||||
Margin="14,4,8,4"
|
||||
Padding="0,0,0,0"
|
||||
BorderBrush="Transparent"
|
||||
BorderThickness="0">
|
||||
<Border
|
||||
x:Name="border"
|
||||
Height="40"
|
||||
Background="{DynamicResource Color01B}"
|
||||
CornerRadius="5">
|
||||
<Grid>
|
||||
<Canvas>
|
||||
<Rectangle
|
||||
x:Name="Bullet"
|
||||
Canvas.Left="0"
|
||||
Width="4"
|
||||
Height="18"
|
||||
Margin="0,11,0,11"
|
||||
Fill="{DynamicResource ToggleSwitchFillOn}"
|
||||
RadiusX="2"
|
||||
RadiusY="2"
|
||||
Visibility="Hidden" />
|
||||
<ContentPresenter
|
||||
x:Name="ContentSite"
|
||||
Margin="12,11,0,11"
|
||||
HorizontalAlignment="LEFT"
|
||||
VerticalAlignment="Center"
|
||||
ContentSource="Header"
|
||||
TextBlock.Foreground="#000" />
|
||||
</Canvas>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Border>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="4" />
|
||||
<ColumnDefinition />
|
||||
</Grid.ColumnDefinitions>
|
||||
<Rectangle
|
||||
x:Name="Bullet"
|
||||
Grid.Column="0"
|
||||
Width="4"
|
||||
Height="18"
|
||||
Margin="0,11,0,11"
|
||||
Fill="{DynamicResource ToggleSwitchFillOn}"
|
||||
RadiusX="2"
|
||||
RadiusY="2"
|
||||
Visibility="Hidden" />
|
||||
<ContentPresenter
|
||||
x:Name="ContentSite"
|
||||
Grid.Column="1"
|
||||
Margin="12,11,18,11"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Center"
|
||||
ContentSource="Header"
|
||||
TextBlock.Foreground="#000" />
|
||||
</Grid>
|
||||
</Grid>
|
||||
</Border>
|
||||
</Border>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="border" Property="Background" Value="{DynamicResource Color06B}" />
|
||||
|
|
@ -418,30 +413,62 @@
|
|||
</Style.Triggers>
|
||||
</Style>
|
||||
<!-- For Tab Header responsive Width -->
|
||||
<Style TargetType="{x:Type TabControl}">
|
||||
<Style x:Key="NavTabControl" TargetType="{x:Type TabControl}">
|
||||
<Setter Property="Padding" Value="0" />
|
||||
<Setter Property="HorizontalContentAlignment" Value="Left" />
|
||||
<Setter Property="VerticalContentAlignment" Value="Top" />
|
||||
<Setter Property="Background" Value="Transparent" />
|
||||
<Setter Property="BorderBrush" Value="Transparent" />
|
||||
<Setter Property="BorderThickness" Value="1" />
|
||||
<Setter Property="FontSize" Value="14" />
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type TabControl}">
|
||||
<Grid>
|
||||
<Grid
|
||||
x:Name="templateRoot"
|
||||
ClipToBounds="true"
|
||||
KeyboardNavigation.TabNavigation="Local"
|
||||
SnapsToDevicePixels="true">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="2.2*" />
|
||||
<ColumnDefinition Width="7.8*" />
|
||||
<ColumnDefinition
|
||||
x:Name="ColumnDefinition0"
|
||||
Width="Auto"
|
||||
MinWidth="230" />
|
||||
<ColumnDefinition x:Name="ColumnDefinition1" Width="7.5*" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<TabPanel
|
||||
<!-- here is the edit -->
|
||||
<DockPanel
|
||||
x:Name="headerPanel"
|
||||
Grid.Row="0"
|
||||
Grid.Column="0"
|
||||
Margin="0,0,0,0"
|
||||
Margin="2,2,2,0"
|
||||
Panel.ZIndex="1"
|
||||
Background="{DynamicResource Color01B}"
|
||||
IsItemsHost="True" />
|
||||
Background="Transparent"
|
||||
IsItemsHost="true"
|
||||
KeyboardNavigation.TabIndex="1"
|
||||
LastChildFill="False" />
|
||||
<Border
|
||||
x:Name="contentPanel"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
BorderBrush="Black"
|
||||
BorderThickness="0"
|
||||
CornerRadius="0">
|
||||
<ContentPresenter Grid.Column="1" ContentSource="SelectedContent" />
|
||||
Background="{TemplateBinding Background}"
|
||||
BorderBrush="{TemplateBinding BorderBrush}"
|
||||
BorderThickness="{TemplateBinding BorderThickness}"
|
||||
KeyboardNavigation.DirectionalNavigation="Contained"
|
||||
KeyboardNavigation.TabIndex="2"
|
||||
KeyboardNavigation.TabNavigation="Local">
|
||||
<ContentPresenter
|
||||
x:Name="PART_SelectedContentHost"
|
||||
Margin="{TemplateBinding Padding}"
|
||||
ContentSource="SelectedContent"
|
||||
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
|
||||
</Border>
|
||||
</Grid>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsEnabled" Value="false">
|
||||
<Setter TargetName="templateRoot" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
|
@ -568,8 +595,9 @@
|
|||
Grid.ColumnSpan="5"
|
||||
Height="auto"
|
||||
SelectedIndex="1"
|
||||
Style="{DynamicResource NavTabControl}"
|
||||
TabStripPlacement="Left">
|
||||
<TabItem Style="{DynamicResource logo}">
|
||||
<TabItem DockPanel.Dock="Top" Style="{DynamicResource logo}">
|
||||
<TabItem.Header>
|
||||
<Grid Margin="0,18,0,0">
|
||||
<Grid.RowDefinitions>
|
||||
|
|
@ -591,7 +619,7 @@
|
|||
</Grid>
|
||||
</TabItem.Header>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<TabItem DockPanel.Dock="Top" Style="{DynamicResource NavTabItem}">
|
||||
<!-- LEFT TAB WIDTH -->
|
||||
<TabItem.Header>
|
||||
<Grid>
|
||||
|
|
@ -947,7 +975,7 @@
|
|||
</VirtualizingStackPanel>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
<TabItem KeyDown="OnPluginSettingKeydown">
|
||||
<TabItem KeyDown="OnPluginSettingKeydown" Style="{DynamicResource NavTabItem}">
|
||||
<TabItem.Header>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
|
|
@ -1047,7 +1075,7 @@
|
|||
Background="{DynamicResource Color01B}"
|
||||
ItemContainerStyle="{StaticResource PluginList}"
|
||||
ItemsSource="{Binding PluginViewModels}"
|
||||
ScrollViewer.CanContentScroll="True"
|
||||
ScrollViewer.CanContentScroll="False"
|
||||
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
|
||||
SelectedItem="{Binding SelectedPlugin}"
|
||||
SnapsToDevicePixels="True"
|
||||
|
|
@ -1057,7 +1085,7 @@
|
|||
VirtualizingStackPanel.VirtualizationMode="Recycling">
|
||||
<ListBox.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<VirtualizingStackPanel Margin="0,0,0,0" />
|
||||
<VirtualizingStackPanel Margin="0,0,0,10" />
|
||||
</ItemsPanelTemplate>
|
||||
</ListBox.ItemsPanel>
|
||||
<ListBox.ItemTemplate>
|
||||
|
|
@ -1368,7 +1396,7 @@
|
|||
</TabItem>
|
||||
|
||||
<!--#region Plugin Store-->
|
||||
<TabItem KeyDown="PluginStore_OnKeyDown">
|
||||
<TabItem KeyDown="PluginStore_OnKeyDown" Style="{DynamicResource NavTabItem}">
|
||||
<TabItem.Header>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
|
|
@ -1721,7 +1749,7 @@
|
|||
</TabItem>
|
||||
<!--#endregion-->
|
||||
|
||||
<TabItem>
|
||||
<TabItem Style="{DynamicResource NavTabItem}">
|
||||
<TabItem.Header>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
|
|
@ -1848,7 +1876,7 @@
|
|||
</StackPanel>
|
||||
<StackPanel Grid.Column="2" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Width="100"
|
||||
Width="Auto"
|
||||
Margin="0,0,8,2"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource Color05B}"
|
||||
|
|
@ -1856,7 +1884,7 @@
|
|||
TextAlignment="Right" />
|
||||
<Slider
|
||||
Name="WindowWidthValue"
|
||||
Width="300"
|
||||
Width="250"
|
||||
Margin="0,0,18,0"
|
||||
VerticalAlignment="Center"
|
||||
IsMoveToPointEnabled="True"
|
||||
|
|
@ -2300,7 +2328,7 @@
|
|||
</TabItem>
|
||||
|
||||
|
||||
<TabItem>
|
||||
<TabItem Style="{DynamicResource NavTabItem}">
|
||||
<TabItem.Header>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
|
|
@ -2323,23 +2351,7 @@
|
|||
VirtualizingStackPanel.IsVirtualizing="True"
|
||||
VirtualizingStackPanel.ScrollUnit="Pixel">
|
||||
<Border>
|
||||
<Grid Margin="5,18,18,10">
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="43" />
|
||||
<RowDefinition Height="80" />
|
||||
<RowDefinition Height="146" />
|
||||
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="50" />
|
||||
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="*" />
|
||||
<RowDefinition Height="50" />
|
||||
|
||||
<RowDefinition Height="50" />
|
||||
<RowDefinition Height="*" />
|
||||
</Grid.RowDefinitions>
|
||||
<StackPanel Margin="5,18,18,10">
|
||||
<TextBlock
|
||||
Grid.Row="0"
|
||||
Margin="0,5,0,2"
|
||||
|
|
@ -2349,7 +2361,7 @@
|
|||
TextAlignment="left" />
|
||||
|
||||
<StackPanel Grid.Row="1">
|
||||
<Border Margin="0,12,0,0" Style="{DynamicResource SettingGroupBox}">
|
||||
<Border Margin="0,8,0,0" Style="{DynamicResource SettingGroupBox}">
|
||||
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||
<StackPanel Style="{StaticResource TextPanel}">
|
||||
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource flowlauncherHotkey}" />
|
||||
|
|
@ -2411,7 +2423,7 @@
|
|||
Style="{StaticResource SettingSeparatorStyle}" />
|
||||
<Border
|
||||
Margin="0"
|
||||
Padding="0,10,0,0"
|
||||
Padding="0,10,0,10"
|
||||
BorderThickness="0"
|
||||
Style="{DynamicResource SettingGroupBox}">
|
||||
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||
|
|
@ -2434,7 +2446,7 @@
|
|||
|
||||
<TextBlock
|
||||
Grid.Row="3"
|
||||
Margin="0,0,12,2"
|
||||
Margin="0,10,12,10"
|
||||
Padding="0,12,0,0"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
|
|
@ -2459,7 +2471,7 @@
|
|||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
<GridViewColumn Width="540" Header="{DynamicResource customQuery}">
|
||||
<GridViewColumn Width="430" Header="{DynamicResource customQuery}">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate DataType="userSettings:CustomPluginHotkey">
|
||||
<TextBlock Text="{Binding ActionKeyword}" />
|
||||
|
|
@ -2520,7 +2532,7 @@
|
|||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
<GridViewColumn Width="540" Header="{DynamicResource customShortcutExpansion}">
|
||||
<GridViewColumn Width="430" Header="{DynamicResource customShortcutExpansion}">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Value}" />
|
||||
|
|
@ -2560,11 +2572,11 @@
|
|||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Foreground="{DynamicResource Color05B}"
|
||||
Text="Built-in Shortcuts" />
|
||||
Text="{DynamicResource builtinShortcuts}" />
|
||||
<ListView
|
||||
Grid.Row="10"
|
||||
MinHeight="160"
|
||||
Margin="0,6,0,0"
|
||||
Margin="0,6,0,20"
|
||||
Background="{DynamicResource Color02B}"
|
||||
BorderBrush="DarkGray"
|
||||
BorderThickness="1"
|
||||
|
|
@ -2579,7 +2591,7 @@
|
|||
</DataTemplate>
|
||||
</GridViewColumn.CellTemplate>
|
||||
</GridViewColumn>
|
||||
<GridViewColumn Width="540" Header="{DynamicResource builtinShortcutDescription}">
|
||||
<GridViewColumn Width="430" Header="{DynamicResource builtinShortcutDescription}">
|
||||
<GridViewColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<TextBlock Text="{Binding Description, Converter={StaticResource TranlationConverter}}" />
|
||||
|
|
@ -2589,13 +2601,13 @@
|
|||
</GridView>
|
||||
</ListView.View>
|
||||
</ListView>
|
||||
</Grid>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
|
||||
|
||||
<TabItem>
|
||||
<TabItem Style="{DynamicResource NavTabItem}">
|
||||
<TabItem.Header>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
|
|
@ -2771,7 +2783,7 @@
|
|||
</Border>
|
||||
</ScrollViewer>
|
||||
</TabItem>
|
||||
<TabItem>
|
||||
<TabItem Style="{DynamicResource NavTabItem}">
|
||||
<TabItem.Header>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
|
|
@ -2802,54 +2814,54 @@
|
|||
Style="{DynamicResource PageTitle}"
|
||||
Text="{DynamicResource about}"
|
||||
TextAlignment="left" />
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<Border
|
||||
Width="200"
|
||||
Height="120"
|
||||
Margin="0,8,0,0"
|
||||
Padding="24,24,24,24"
|
||||
HorizontalAlignment="Left"
|
||||
Style="{DynamicResource SettingGroupBox}">
|
||||
<Grid>
|
||||
<TextBlock
|
||||
FontSize="14"
|
||||
Foreground="{DynamicResource Color05B}"
|
||||
Text="{DynamicResource version}"
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
<TextBlock
|
||||
HorizontalAlignment="Right"
|
||||
VerticalAlignment="Bottom"
|
||||
DockPanel.Dock="Bottom"
|
||||
FontSize="22"
|
||||
Foreground="{DynamicResource Color05B}"
|
||||
Text="{Binding Version}"
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
</Grid>
|
||||
</Border>
|
||||
</StackPanel>
|
||||
|
||||
<Border Margin="0,4,0,0" Style="{DynamicResource SettingGroupBox}">
|
||||
|
||||
<Border Margin="0,9,0,0" Style="{DynamicResource SettingGroupBox}">
|
||||
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||
<StackPanel Style="{StaticResource TextPanel}">
|
||||
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource update}" />
|
||||
<TextBlock
|
||||
Grid.Column="1"
|
||||
VerticalAlignment="Center"
|
||||
FontWeight="Bold"
|
||||
Style="{DynamicResource SettingTitleLabel}"
|
||||
Text="{Binding Version}" />
|
||||
<TextBlock Style="{DynamicResource SettingSubTitleLabel}" Text="{DynamicResource version}" />
|
||||
</StackPanel>
|
||||
<Button
|
||||
Grid.Column="1"
|
||||
Margin="0,0,-20,0"
|
||||
Margin="0,0,-14,0"
|
||||
HorizontalAlignment="Right"
|
||||
Click="OnCheckUpdates"
|
||||
Content="{DynamicResource checkUpdates}"
|
||||
Style="{StaticResource AccentButtonStyle}" />
|
||||
<TextBlock Style="{StaticResource Glyph}">
|
||||

|
||||

|
||||
</TextBlock>
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
|
||||
<Border Height="62" Style="{DynamicResource SettingGroupBox}">
|
||||
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||
<StackPanel Style="{StaticResource TextPanel}">
|
||||
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource releaseNotes}" />
|
||||
</StackPanel>
|
||||
<TextBlock
|
||||
Margin="0,0,-12,0"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource SideTextAbout}">
|
||||
<Hyperlink NavigateUri="{Binding ReleaseNotes, Mode=OneWay}" RequestNavigate="OnRequestNavigate">
|
||||
<Run Text="{DynamicResource releaseNotes}" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<TextBlock Style="{StaticResource Glyph}">
|
||||

|
||||
</TextBlock>
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
|
||||
<Border
|
||||
Height="62"
|
||||
Margin="0,4,0,0"
|
||||
Margin="0,14,0,0"
|
||||
Style="{DynamicResource SettingGroupBox}">
|
||||
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||
<StackPanel Style="{StaticResource TextPanel}">
|
||||
|
|
@ -2877,25 +2889,6 @@
|
|||
</ItemsControl>
|
||||
</Border>
|
||||
|
||||
<Border Height="62" Style="{DynamicResource SettingGroupBox}">
|
||||
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||
<StackPanel Style="{StaticResource TextPanel}">
|
||||
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource releaseNotes}" />
|
||||
</StackPanel>
|
||||
<TextBlock
|
||||
Margin="0,0,-12,0"
|
||||
VerticalAlignment="Center"
|
||||
Style="{StaticResource SideTextAbout}">
|
||||
<Hyperlink NavigateUri="{Binding ReleaseNotes, Mode=OneWay}" RequestNavigate="OnRequestNavigate">
|
||||
<Run Text="{DynamicResource releaseNotes}" />
|
||||
</Hyperlink>
|
||||
</TextBlock>
|
||||
<TextBlock Style="{StaticResource Glyph}">
|
||||

|
||||
</TextBlock>
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
|
||||
<Border Height="62" Style="{DynamicResource SettingGroupBox}">
|
||||
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||
<StackPanel Style="{StaticResource TextPanel}">
|
||||
|
|
@ -2923,10 +2916,13 @@
|
|||
</ItemsControl>
|
||||
</Border>
|
||||
|
||||
<Border Height="62" Style="{DynamicResource SettingGroupBox}">
|
||||
<Border
|
||||
Height="62"
|
||||
Margin="0,14,0,0"
|
||||
Style="{DynamicResource SettingGroupBox}">
|
||||
<ItemsControl Style="{StaticResource SettingGrid}">
|
||||
<StackPanel Style="{StaticResource TextPanel}">
|
||||
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="Icons" />
|
||||
<TextBlock Style="{DynamicResource SettingTitleLabel}" Text="{DynamicResource icons}" />
|
||||
</StackPanel>
|
||||
<TextBlock
|
||||
Margin="0,0,-12,0"
|
||||
|
|
@ -2953,26 +2949,43 @@
|
|||
Margin="0,0,-20,0"
|
||||
HorizontalAlignment="Right"
|
||||
Orientation="Horizontal">
|
||||
<Button
|
||||
Margin="0,0,12,0"
|
||||
Click="OpenWelcomeWindow"
|
||||
Content="{DynamicResource welcomewindow}" />
|
||||
<Button
|
||||
Margin="0,0,12,0"
|
||||
Click="OpenSettingFolder"
|
||||
Content="{DynamicResource settingfolder}" />
|
||||
<Button
|
||||
Name="ClearLogFolderBtn"
|
||||
Margin="0,0,12,0"
|
||||
Click="ClearLogFolder"
|
||||
Content="{Binding CheckLogFolder, UpdateSourceTrigger=PropertyChanged}" />
|
||||
<Button Click="OpenLogFolder" Content="{DynamicResource logfolder}" />
|
||||
<Button
|
||||
Margin="0,0,8,0"
|
||||
Content=""
|
||||
FontFamily="/Resources/#Segoe Fluent Icons"
|
||||
FontSize="20">
|
||||
<ui:FlyoutService.Flyout>
|
||||
<ui:MenuFlyout>
|
||||
<MenuItem Click="OpenWelcomeWindow" Header="{DynamicResource welcomewindow}">
|
||||
<MenuItem.Icon>
|
||||
<ui:FontIcon Glyph="" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Click="OpenSettingFolder" Header="{DynamicResource settingfolder}">
|
||||
<MenuItem.Icon>
|
||||
<ui:FontIcon Glyph="" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
<MenuItem Click="OpenLogFolder" Header="{DynamicResource logfolder}">
|
||||
<MenuItem.Icon>
|
||||
<ui:FontIcon Glyph="" />
|
||||
</MenuItem.Icon>
|
||||
</MenuItem>
|
||||
</ui:MenuFlyout>
|
||||
</ui:FlyoutService.Flyout>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
<TextBlock Style="{StaticResource Glyph}">
|
||||

|
||||

|
||||
</TextBlock>
|
||||
</ItemsControl>
|
||||
</Border>
|
||||
|
||||
<TextBlock
|
||||
Margin="14,20,0,0"
|
||||
HorizontalAlignment="Center"
|
||||
|
|
@ -2982,7 +2995,6 @@
|
|||
Foreground="{DynamicResource Color15B}"
|
||||
Text="{Binding ActivatedTimes, Mode=OneWay}"
|
||||
TextWrapping="WrapWithOverflow" />
|
||||
|
||||
</StackPanel>
|
||||
</ScrollViewer>
|
||||
</Border>
|
||||
|
|
|
|||
|
|
@ -77,12 +77,22 @@ namespace Flow.Launcher.ViewModel
|
|||
_userSelectedRecord = _userSelectedRecordStorage.Load();
|
||||
_topMostRecord = _topMostRecordStorage.Load();
|
||||
|
||||
ContextMenu = new ResultsViewModel(Settings);
|
||||
Results = new ResultsViewModel(Settings);
|
||||
History = new ResultsViewModel(Settings);
|
||||
InitializeKeyCommands();
|
||||
|
||||
ContextMenu = new ResultsViewModel(Settings)
|
||||
{
|
||||
LeftClickResultCommand = OpenResultCommand, RightClickResultCommand = LoadContextMenuCommand
|
||||
};
|
||||
Results = new ResultsViewModel(Settings)
|
||||
{
|
||||
LeftClickResultCommand = OpenResultCommand, RightClickResultCommand = LoadContextMenuCommand
|
||||
};
|
||||
History = new ResultsViewModel(Settings)
|
||||
{
|
||||
LeftClickResultCommand = OpenResultCommand, RightClickResultCommand = LoadContextMenuCommand
|
||||
};
|
||||
_selectedResults = Results;
|
||||
|
||||
InitializeKeyCommands();
|
||||
|
||||
RegisterViewUpdate();
|
||||
RegisterResultsUpdatedEvent();
|
||||
|
|
@ -199,15 +209,10 @@ namespace Flow.Launcher.ViewModel
|
|||
PluginManager.API.OpenUrl("https://github.com/Flow-Launcher/Flow.Launcher/wiki/Flow-Launcher/");
|
||||
});
|
||||
OpenSettingCommand = new RelayCommand(_ => { App.API.OpenSettingDialog(); });
|
||||
OpenResultCommand = new RelayCommand(async index =>
|
||||
OpenResultCommand = new AsyncRelayCommand(async _ =>
|
||||
{
|
||||
var results = SelectedResults;
|
||||
|
||||
if (index != null)
|
||||
{
|
||||
results.SelectedIndex = int.Parse(index.ToString()!);
|
||||
}
|
||||
|
||||
var result = results.SelectedItem?.Result;
|
||||
if (result == null)
|
||||
{
|
||||
|
|
@ -363,9 +368,9 @@ namespace Flow.Launcher.ViewModel
|
|||
{
|
||||
if (MainWindowWidth + 100 > 1920 || Settings.WindowSize == 1920)
|
||||
{
|
||||
Settings.WindowSize = 1920;
|
||||
Settings.WindowSize = 1920;
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
Settings.WindowSize += 100;
|
||||
Settings.WindowLeft -= 50;
|
||||
|
|
@ -648,7 +653,7 @@ namespace Flow.Launcher.ViewModel
|
|||
|
||||
if (currentCancellationToken.IsCancellationRequested)
|
||||
return;
|
||||
|
||||
|
||||
|
||||
// handle the exclusiveness of plugin using action keyword
|
||||
RemoveOldQueryResults(query);
|
||||
|
|
|
|||
|
|
@ -8,6 +8,8 @@ using System.Windows;
|
|||
using System.Windows.Controls;
|
||||
using System.Windows.Data;
|
||||
using System.Windows.Documents;
|
||||
using System.Windows.Input;
|
||||
using JetBrains.Annotations;
|
||||
|
||||
namespace Flow.Launcher.ViewModel
|
||||
{
|
||||
|
|
@ -49,6 +51,9 @@ namespace Flow.Launcher.ViewModel
|
|||
public ResultViewModel SelectedItem { get; set; }
|
||||
public Thickness Margin { get; set; }
|
||||
public Visibility Visbility { get; set; } = Visibility.Collapsed;
|
||||
|
||||
public ICommand RightClickResultCommand { get; init; }
|
||||
public ICommand LeftClickResultCommand { get; init; }
|
||||
|
||||
#endregion
|
||||
|
||||
|
|
|
|||
|
|
@ -758,7 +758,20 @@ namespace Flow.Launcher.ViewModel
|
|||
public string Documentation => Constant.Documentation;
|
||||
public string Docs => Constant.Docs;
|
||||
public string Github => Constant.GitHub;
|
||||
public static string Version => Constant.Version;
|
||||
public string Version
|
||||
{
|
||||
get
|
||||
{
|
||||
if (Constant.Version == "1.0.0")
|
||||
{
|
||||
return Constant.Dev;
|
||||
}
|
||||
else
|
||||
{
|
||||
return Constant.Version;
|
||||
}
|
||||
}
|
||||
}
|
||||
public string ActivatedTimes => string.Format(_translater.GetTranslation("about_activate_times"), Settings.ActivateTimes);
|
||||
|
||||
public string CheckLogFolder
|
||||
|
|
|
|||
|
|
@ -6,12 +6,13 @@
|
|||
xmlns:local="clr-namespace:Flow.Launcher.Plugin.Explorer.Views"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
Title="{DynamicResource plugin_explorer_manageactionkeywords_header}"
|
||||
Width="400"
|
||||
SizeToContent="Height"
|
||||
Width="Auto"
|
||||
Height="255"
|
||||
Background="{DynamicResource PopuBGColor}"
|
||||
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||
Foreground="{DynamicResource PopupTextColor}"
|
||||
ResizeMode="NoResize"
|
||||
SizeToContent="Width"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
mc:Ignorable="d">
|
||||
<WindowChrome.WindowChrome>
|
||||
|
|
@ -68,7 +69,7 @@
|
|||
|
||||
<StackPanel Margin="0,10,0,0" Orientation="Horizontal">
|
||||
<TextBlock
|
||||
Width="150"
|
||||
MinWidth="150"
|
||||
Margin="0,10,15,10"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
|
|
@ -78,18 +79,19 @@
|
|||
Name="TxtCurrentActionKeyword"
|
||||
Grid.Row="0"
|
||||
Grid.Column="1"
|
||||
Width="105"
|
||||
Width="135"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
PreviewKeyDown="TxtCurrentActionKeyword_OnKeyDown"
|
||||
Text="{Binding ActionKeyword}" />
|
||||
</StackPanel>
|
||||
<StackPanel Margin="0,10,0,15" Orientation="Horizontal">
|
||||
<TextBlock Margin="0 0 15 0 "
|
||||
<TextBlock
|
||||
MinWidth="150"
|
||||
Margin="0,0,18,0"
|
||||
HorizontalAlignment="Left"
|
||||
VerticalAlignment="Center"
|
||||
FontSize="14"
|
||||
Width="150"
|
||||
Text="{DynamicResource plugin_explorer_actionkeyword_enabled}" />
|
||||
<CheckBox
|
||||
Name="ChkActionKeywordEnabled"
|
||||
|
|
|
|||
|
|
@ -8,8 +8,8 @@
|
|||
Title="{DynamicResource flowlauncher_plugin_program_suffixes}"
|
||||
Width="600"
|
||||
Background="{DynamicResource PopuBGColor}"
|
||||
Foreground="{DynamicResource PopupTextColor}"
|
||||
DataContext="{Binding RelativeSource={RelativeSource Self}}"
|
||||
Foreground="{DynamicResource PopupTextColor}"
|
||||
ResizeMode="NoResize"
|
||||
SizeToContent="Height"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
|
|
@ -163,17 +163,32 @@
|
|||
FontSize="16"
|
||||
FontWeight="SemiBold"
|
||||
Text="{DynamicResource flowlauncher_plugin_program_suffixes_excutable_types}" />
|
||||
<CheckBox Name="apprefMS" Margin="10,0,0,0" IsChecked="{Binding SuffixesStatus[appref-ms]}">appref-ms</CheckBox>
|
||||
<CheckBox Name="exe" Margin="10,0,0,0" IsChecked="{Binding SuffixesStatus[exe]}">exe</CheckBox>
|
||||
<CheckBox Name="lnk" Margin="10,0,0,0" IsChecked="{Binding SuffixesStatus[lnk]}">lnk</CheckBox>
|
||||
<CheckBox
|
||||
Name="apprefMS"
|
||||
Margin="10,0,0,0"
|
||||
IsChecked="{Binding SuffixesStatus[appref-ms]}">
|
||||
appref-ms
|
||||
</CheckBox>
|
||||
<CheckBox
|
||||
Name="exe"
|
||||
Margin="10,0,0,0"
|
||||
IsChecked="{Binding SuffixesStatus[exe]}">
|
||||
exe
|
||||
</CheckBox>
|
||||
<CheckBox
|
||||
Name="lnk"
|
||||
Margin="10,0,0,0"
|
||||
IsChecked="{Binding SuffixesStatus[lnk]}">
|
||||
lnk
|
||||
</CheckBox>
|
||||
<CheckBox
|
||||
Name="CustomFiles"
|
||||
Margin="10,0,0,0"
|
||||
IsChecked="{Binding UseCustomSuffixes}"
|
||||
Content="{DynamicResource flowlauncher_plugin_program_suffixes_custom_file_types}" />
|
||||
Content="{DynamicResource flowlauncher_plugin_program_suffixes_custom_file_types}"
|
||||
IsChecked="{Binding UseCustomSuffixes}" />
|
||||
<TextBox
|
||||
x:Name="tbSuffixes"
|
||||
Margin="10,4,0,6"
|
||||
Margin="10,4,0,10"
|
||||
Style="{StaticResource CustomFileTypeTextBox}" />
|
||||
</StackPanel>
|
||||
|
||||
|
|
@ -189,17 +204,29 @@
|
|||
FontSize="16"
|
||||
FontWeight="SemiBold"
|
||||
Text="{DynamicResource flowlauncher_plugin_program_suffixes_URL_types}" />
|
||||
<CheckBox Name="steam" Margin="10,0,0,0" IsChecked="{Binding ProtocolsStatus[steam]}" Content="{DynamicResource flowlauncher_plugin_program_suffixes_URL_steam}"></CheckBox>
|
||||
<CheckBox Name="epic" Margin="10,0,0,0" IsChecked="{Binding ProtocolsStatus[epic]}" Content="{DynamicResource flowlauncher_plugin_program_suffixes_URL_epic}"></CheckBox>
|
||||
<CheckBox Name="http" Margin="10,0,0,0" IsChecked="{Binding ProtocolsStatus[http]}" Content="{DynamicResource flowlauncher_plugin_program_suffixes_URL_http}"></CheckBox>
|
||||
<CheckBox
|
||||
Name="steam"
|
||||
Margin="10,0,0,0"
|
||||
Content="{DynamicResource flowlauncher_plugin_program_suffixes_URL_steam}"
|
||||
IsChecked="{Binding ProtocolsStatus[steam]}" />
|
||||
<CheckBox
|
||||
Name="epic"
|
||||
Margin="10,0,0,0"
|
||||
Content="{DynamicResource flowlauncher_plugin_program_suffixes_URL_epic}"
|
||||
IsChecked="{Binding ProtocolsStatus[epic]}" />
|
||||
<CheckBox
|
||||
Name="http"
|
||||
Margin="10,0,0,0"
|
||||
Content="{DynamicResource flowlauncher_plugin_program_suffixes_URL_http}"
|
||||
IsChecked="{Binding ProtocolsStatus[http]}" />
|
||||
<CheckBox
|
||||
Name="CustomProtocol"
|
||||
Margin="10,0,0,0"
|
||||
IsChecked="{Binding UseCustomProtocols}"
|
||||
Content="{DynamicResource flowlauncher_plugin_program_suffixes_custom_urls}" />
|
||||
Content="{DynamicResource flowlauncher_plugin_program_suffixes_custom_urls}"
|
||||
IsChecked="{Binding UseCustomProtocols}" />
|
||||
<TextBox
|
||||
x:Name="tbProtocols"
|
||||
Margin="10,4,0,6"
|
||||
Margin="10,4,0,0"
|
||||
Style="{StaticResource CustomURLTypeTextBox}" />
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
|
|
|||
|
|
@ -91,6 +91,7 @@
|
|||
BorderThickness="1" />
|
||||
<StackPanel
|
||||
Width="Auto"
|
||||
Height="55"
|
||||
Margin="60,6,0,0"
|
||||
HorizontalAlignment="Left"
|
||||
Orientation="Horizontal">
|
||||
|
|
@ -145,8 +146,8 @@
|
|||
DragEnter="programSourceView_DragEnter"
|
||||
Drop="programSourceView_Drop"
|
||||
GridViewColumnHeader.Click="GridViewColumnHeaderClickedHandler"
|
||||
PreviewMouseRightButtonUp="ProgramSourceView_PreviewMouseRightButtonUp"
|
||||
MouseDoubleClick="programSourceView_MouseDoubleClick"
|
||||
PreviewMouseRightButtonUp="ProgramSourceView_PreviewMouseRightButtonUp"
|
||||
SelectionChanged="programSourceView_SelectionChanged"
|
||||
SelectionMode="Extended">
|
||||
<ListView.View>
|
||||
|
|
|
|||
Loading…
Reference in a new issue