Merge branch 'dev' into rename-file

This commit is contained in:
Jack Ye 2025-10-05 19:35:26 +08:00 committed by GitHub
commit 5c4c80259d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
87 changed files with 3147 additions and 9085 deletions

View file

@ -1,24 +0,0 @@
using System.ComponentModel;
namespace Flow.Launcher.Core.Resource
{
public class LocalizedDescriptionAttribute : DescriptionAttribute
{
private readonly string _resourceKey;
public LocalizedDescriptionAttribute(string resourceKey)
{
_resourceKey = resourceKey;
}
public override string Description
{
get
{
string description = PublicApi.Instance.GetTranslation(_resourceKey);
return string.IsNullOrWhiteSpace(description) ?
string.Format("[[{0}]]", _resourceKey) : description;
}
}
}
}

View file

@ -449,9 +449,19 @@ namespace Flow.Launcher.Core.Resource
} }
return false; return false;
} }
catch (XamlParseException) catch (XamlParseException e)
{ {
_api.LogError(ClassName, $"Theme <{theme}> fail to parse"); _api.LogException(ClassName, $"Theme <{theme}> fail to parse xaml", e);
if (theme != Constant.DefaultTheme)
{
_api.ShowMsgBox(Localize.theme_load_failure_parse_error(theme));
ChangeTheme(Constant.DefaultTheme);
}
return false;
}
catch (Exception e)
{
_api.LogException(ClassName, $"Theme <{theme}> fail to load", e);
if (theme != Constant.DefaultTheme) if (theme != Constant.DefaultTheme)
{ {
_api.ShowMsgBox(Localize.theme_load_failure_parse_error(theme)); _api.ShowMsgBox(Localize.theme_load_failure_parse_error(theme));

View file

@ -85,5 +85,10 @@ QueryFullProcessImageName
EVENT_OBJECT_HIDE EVENT_OBJECT_HIDE
EVENT_SYSTEM_DIALOGEND EVENT_SYSTEM_DIALOGEND
DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS
WM_POWERBROADCAST WM_POWERBROADCAST
PBT_APMRESUMEAUTOMATIC PBT_APMRESUMEAUTOMATIC
PBT_APMRESUMESUSPEND
PowerRegisterSuspendResumeNotification
PowerUnregisterSuspendResumeNotification
DeviceNotifyCallbackRoutine

View file

@ -19,6 +19,7 @@ using Microsoft.Win32.SafeHandles;
using Windows.Win32; using Windows.Win32;
using Windows.Win32.Foundation; using Windows.Win32.Foundation;
using Windows.Win32.Graphics.Dwm; using Windows.Win32.Graphics.Dwm;
using Windows.Win32.System.Power;
using Windows.Win32.System.Threading; using Windows.Win32.System.Threading;
using Windows.Win32.UI.Input.KeyboardAndMouse; using Windows.Win32.UI.Input.KeyboardAndMouse;
using Windows.Win32.UI.Shell.Common; using Windows.Win32.UI.Shell.Common;
@ -338,9 +339,6 @@ namespace Flow.Launcher.Infrastructure
public const int SC_MAXIMIZE = (int)PInvoke.SC_MAXIMIZE; public const int SC_MAXIMIZE = (int)PInvoke.SC_MAXIMIZE;
public const int SC_MINIMIZE = (int)PInvoke.SC_MINIMIZE; public const int SC_MINIMIZE = (int)PInvoke.SC_MINIMIZE;
public const int WM_POWERBROADCAST = (int)PInvoke.WM_POWERBROADCAST;
public const int PBT_APMRESUMEAUTOMATIC = (int)PInvoke.PBT_APMRESUMEAUTOMATIC;
#endregion #endregion
#region Window Handle #region Window Handle
@ -918,5 +916,105 @@ namespace Flow.Launcher.Infrastructure
} }
#endregion #endregion
#region Sleep Mode Listener
private static Action _func;
private static PDEVICE_NOTIFY_CALLBACK_ROUTINE _callback = null;
private static DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS _recipient;
private static SafeHandle _recipientHandle;
private static HPOWERNOTIFY _handle = HPOWERNOTIFY.Null;
/// <summary>
/// Registers a listener for sleep mode events.
/// Inspired from: https://github.com/XKaguya/LenovoLegionToolkit
/// https://blog.csdn.net/mochounv/article/details/114668594
/// </summary>
/// <param name="func"></param>
/// <exception cref="Win32Exception"></exception>
public static unsafe void RegisterSleepModeListener(Action func)
{
if (_callback != null)
{
// Only register if not already registered
return;
}
_func = func;
_callback = new PDEVICE_NOTIFY_CALLBACK_ROUTINE(DeviceNotifyCallback);
_recipient = new DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS()
{
Callback = _callback,
Context = null
};
_recipientHandle = new StructSafeHandle<DEVICE_NOTIFY_SUBSCRIBE_PARAMETERS>(_recipient);
_handle = PInvoke.PowerRegisterSuspendResumeNotification(
REGISTER_NOTIFICATION_FLAGS.DEVICE_NOTIFY_CALLBACK,
_recipientHandle,
out var handle) == WIN32_ERROR.ERROR_SUCCESS ?
new HPOWERNOTIFY(new IntPtr(handle)) :
HPOWERNOTIFY.Null;
if (_handle.IsNull)
{
throw new Win32Exception("Error registering for power notifications: " + Marshal.GetLastWin32Error());
}
}
/// <summary>
/// Unregisters the sleep mode listener.
/// </summary>
public static void UnregisterSleepModeListener()
{
if (!_handle.IsNull)
{
PInvoke.PowerUnregisterSuspendResumeNotification(_handle);
_handle = HPOWERNOTIFY.Null;
_func = null;
_callback = null;
_recipientHandle = null;
}
}
private static unsafe uint DeviceNotifyCallback(void* context, uint type, void* setting)
{
switch (type)
{
case PInvoke.PBT_APMRESUMEAUTOMATIC:
// Operation is resuming automatically from a low-power state.This message is sent every time the system resumes
_func?.Invoke();
break;
case PInvoke.PBT_APMRESUMESUSPEND:
// Operation is resuming from a low-power state.This message is sent after PBT_APMRESUMEAUTOMATIC if the resume is triggered by user input, such as pressing a key
_func?.Invoke();
break;
}
return 0;
}
private sealed class StructSafeHandle<T> : SafeHandle where T : struct
{
private readonly nint _ptr = nint.Zero;
public StructSafeHandle(T recipient) : base(nint.Zero, true)
{
var pRecipient = Marshal.AllocHGlobal(Marshal.SizeOf<T>());
Marshal.StructureToPtr(recipient, pRecipient, false);
SetHandle(pRecipient);
_ptr = pRecipient;
}
public override bool IsInvalid => handle == nint.Zero;
protected override bool ReleaseHandle()
{
Marshal.FreeHGlobal(_ptr);
return true;
}
}
#endregion
} }
} }

View file

@ -2,7 +2,8 @@
x:Class="Flow.Launcher.App" x:Class="Flow.Launcher.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
ShutdownMode="OnMainWindowClose" ShutdownMode="OnMainWindowClose"
Startup="OnStartup"> Startup="OnStartup">
<Application.Resources> <Application.Resources>
@ -10,17 +11,17 @@
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ui:ThemeResources> <ui:ThemeResources>
<ui:ThemeResources.ThemeDictionaries> <ui:ThemeResources.ThemeDictionaries>
<ResourceDictionary x:Key="Light"> <ResourceDictionary x:Key="Light" ui:ThemeDictionary.Key="Light">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Resources/Light.xaml" /> <ResourceDictionary Source="pack://application:,,,/Resources/Light.xaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
<ResourceDictionary x:Key="Dark"> <ResourceDictionary x:Key="Dark" ui:ThemeDictionary.Key="Dark">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Resources/Dark.xaml" /> <ResourceDictionary Source="pack://application:,,,/Resources/Dark.xaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
</ResourceDictionary> </ResourceDictionary>
<ResourceDictionary x:Key="HighContrast"> <ResourceDictionary x:Key="HighContrast" ui:ThemeDictionary.Key="HighContrast">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Resources/Dark.xaml" /> <ResourceDictionary Source="pack://application:,,,/Resources/Dark.xaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
@ -33,6 +34,15 @@
<ResourceDictionary Source="pack://application:,,,/Themes/Win11Light.xaml" /> <ResourceDictionary Source="pack://application:,,,/Themes/Win11Light.xaml" />
<ResourceDictionary Source="pack://application:,,,/Languages/en.xaml" /> <ResourceDictionary Source="pack://application:,,,/Languages/en.xaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<!-- Override styles in UI.Modern.WPF -->
<Thickness x:Key="ListViewItemCompactSelectedBorderThemeThickness">2</Thickness>
<sys:Double x:Key="CheckBoxMinWidth">0</sys:Double>
<sys:Double x:Key="GridViewItemMinWidth">0</sys:Double>
<sys:Double x:Key="GridViewItemMinHeight">40</sys:Double>
<sys:Double x:Key="ListViewItemMinWidth">0</sys:Double>
<sys:Double x:Key="ListViewItemMinHeight">36</sys:Double>
<SolidColorBrush x:Key="NavigationViewSelectionIndicatorForeground" Color="#FF0063B1" />
</ResourceDictionary> </ResourceDictionary>
</Application.Resources> </Application.Resources>
</Application> </Application>

View file

@ -22,6 +22,7 @@ using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin; using Flow.Launcher.Plugin;
using Flow.Launcher.SettingPages.ViewModels; using Flow.Launcher.SettingPages.ViewModels;
using Flow.Launcher.ViewModel; using Flow.Launcher.ViewModel;
using iNKORE.UI.WPF.Modern.Common;
using Microsoft.Extensions.DependencyInjection; using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting; using Microsoft.Extensions.Hosting;
using Microsoft.VisualStudio.Threading; using Microsoft.VisualStudio.Threading;
@ -56,6 +57,9 @@ namespace Flow.Launcher
public App() public App()
{ {
// Do not use bitmap cache since it can cause WPF second window freezing issue
ShadowAssist.UseBitmapCache = false;
// Initialize settings // Initialize settings
_settings.WMPInstalled = WindowsMediaPlayerHelper.IsWindowsMediaPlayerInstalled(); _settings.WMPInstalled = WindowsMediaPlayerHelper.IsWindowsMediaPlayerInstalled();

View file

@ -5,7 +5,7 @@ using System.Windows.Input;
namespace Flow.Launcher.Converters; namespace Flow.Launcher.Converters;
internal class BoolToIMEConversionModeConverter : IValueConverter public class BoolToIMEConversionModeConverter : IValueConverter
{ {
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{ {
@ -22,7 +22,7 @@ internal class BoolToIMEConversionModeConverter : IValueConverter
} }
} }
internal class BoolToIMEStateConverter : IValueConverter public class BoolToIMEStateConverter : IValueConverter
{ {
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{ {

View file

@ -0,0 +1,91 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace Flow.Launcher.Converters;
public class CornerRadiusFilterConverter : DependencyObject, IValueConverter
{
public CornerRadiusFilterKind Filter { get; set; }
public double Scale { get; set; } = 1.0;
public static CornerRadius Convert(CornerRadius radius, CornerRadiusFilterKind filterKind)
{
CornerRadius result = radius;
switch (filterKind)
{
case CornerRadiusFilterKind.Top:
result.BottomLeft = 0;
result.BottomRight = 0;
break;
case CornerRadiusFilterKind.Right:
result.TopLeft = 0;
result.BottomLeft = 0;
break;
case CornerRadiusFilterKind.Bottom:
result.TopLeft = 0;
result.TopRight = 0;
break;
case CornerRadiusFilterKind.Left:
result.TopRight = 0;
result.BottomRight = 0;
break;
}
return result;
}
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var cornerRadius = (CornerRadius)value;
var scale = Scale;
if (!double.IsNaN(scale))
{
cornerRadius.TopLeft *= scale;
cornerRadius.TopRight *= scale;
cornerRadius.BottomRight *= scale;
cornerRadius.BottomLeft *= scale;
}
var filterType = Filter;
if (filterType == CornerRadiusFilterKind.TopLeftValue ||
filterType == CornerRadiusFilterKind.BottomRightValue)
{
return GetDoubleValue(cornerRadius, filterType);
}
return Convert(cornerRadius, filterType);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
private static double GetDoubleValue(CornerRadius radius, CornerRadiusFilterKind filterKind)
{
switch (filterKind)
{
case CornerRadiusFilterKind.TopLeftValue:
return radius.TopLeft;
case CornerRadiusFilterKind.BottomRightValue:
return radius.BottomRight;
}
return 0;
}
}
public enum CornerRadiusFilterKind
{
None,
Top,
Right,
Bottom,
Left,
TopLeftValue,
BottomRightValue
}

View file

@ -0,0 +1,32 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace Flow.Launcher.Converters;
public class PlacementRectangleConverter : IMultiValueConverter
{
public Thickness Margin { get; set; }
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (values.Length == 2 &&
values[0] is double width &&
values[1] is double height)
{
var margin = Margin;
var topLeft = new Point(margin.Left, margin.Top);
var bottomRight = new Point(width - margin.Right, height - margin.Bottom);
var rect = new Rect(topLeft, bottomRight);
return rect;
}
return Rect.Empty;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}

View file

@ -0,0 +1,19 @@
using System;
using System.Globalization;
using System.Windows;
using System.Windows.Data;
namespace Flow.Launcher.Converters;
public class SharedSizeGroupConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return (Visibility)value != Visibility.Collapsed ? (string)parameter : null;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}

View file

@ -5,7 +5,7 @@ using System.Windows.Input;
namespace Flow.Launcher.Converters; namespace Flow.Launcher.Converters;
class StringToKeyBindingConverter : IValueConverter public class StringToKeyBindingConverter : IValueConverter
{ {
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{ {

View file

@ -138,6 +138,7 @@
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets>
</PackageReference> </PackageReference>
<PackageReference Include="iNKORE.UI.WPF.Modern" Version="0.10.1" />
<PackageReference Include="MdXaml" Version="1.27.0" /> <PackageReference Include="MdXaml" Version="1.27.0" />
<PackageReference Include="MdXaml.AnimatedGif" Version="1.27.0" /> <PackageReference Include="MdXaml.AnimatedGif" Version="1.27.0" />
<PackageReference Include="MdXaml.Html" Version="1.27.0" /> <PackageReference Include="MdXaml.Html" Version="1.27.0" />
@ -146,9 +147,6 @@
<PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.9" /> <PackageReference Include="Microsoft.Extensions.DependencyInjection" Version="9.0.9" />
<PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.9" /> <PackageReference Include="Microsoft.Extensions.Hosting" Version="9.0.9" />
<PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" /> <PackageReference Include="Microsoft.Toolkit.Uwp.Notifications" Version="7.1.3" />
<!-- ModernWpfUI v0.9.5 introduced WinRT changes that causes Notification platform unavailable error on some machines -->
<!-- https://github.com/Flow-Launcher/Flow.Launcher/issues/1772#issuecomment-1502440801 -->
<PackageReference Include="ModernWpfUI" Version="0.9.4" />
<PackageReference Include="PropertyChanged.Fody" Version="4.1.0"> <PackageReference Include="PropertyChanged.Fody" Version="4.1.0">
<PrivateAssets>all</PrivateAssets> <PrivateAssets>all</PrivateAssets>
</PackageReference> </PackageReference>

View file

@ -0,0 +1,33 @@
using System.Windows;
using System.Windows.Controls;
namespace Flow.Launcher.Helper;
public static class BorderHelper
{
#region Child
public static readonly DependencyProperty ChildProperty =
DependencyProperty.RegisterAttached(
"Child",
typeof(UIElement),
typeof(BorderHelper),
new PropertyMetadata(default(UIElement), OnChildChanged));
public static UIElement GetChild(Border border)
{
return (UIElement)border.GetValue(ChildProperty);
}
public static void SetChild(Border border, UIElement value)
{
border.SetValue(ChildProperty, value);
}
private static void OnChildChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
((Border)d).Child = (UIElement)e.NewValue;
}
#endregion
}

View file

@ -2,7 +2,7 @@
x:Class="Flow.Launcher.HotkeyControlDialog" x:Class="Flow.Launcher.HotkeyControlDialog"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
Background="{DynamicResource PopuBGColor}" Background="{DynamicResource PopuBGColor}"
BorderBrush="{DynamicResource PopupButtonAreaBorderColor}" BorderBrush="{DynamicResource PopupButtonAreaBorderColor}"
BorderThickness="0 1 0 0" BorderThickness="0 1 0 0"

View file

@ -9,7 +9,7 @@ using Flow.Launcher.Helper;
using Flow.Launcher.Infrastructure.Hotkey; using Flow.Launcher.Infrastructure.Hotkey;
using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin; using Flow.Launcher.Plugin;
using ModernWpf.Controls; using iNKORE.UI.WPF.Modern.Controls;
namespace Flow.Launcher; namespace Flow.Launcher;

View file

@ -6,7 +6,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:flowlauncher="clr-namespace:Flow.Launcher" xmlns:flowlauncher="clr-namespace:Flow.Launcher"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:vm="clr-namespace:Flow.Launcher.ViewModel" xmlns:vm="clr-namespace:Flow.Launcher.ViewModel"
Name="FlowMainWindow" Name="FlowMainWindow"
Title="Flow Launcher" Title="Flow Launcher"

View file

@ -2,6 +2,7 @@
using System.ComponentModel; using System.ComponentModel;
using System.Linq; using System.Linq;
using System.Media; using System.Media;
using System.Threading;
using System.Threading.Tasks; using System.Threading.Tasks;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
@ -24,7 +25,8 @@ using Flow.Launcher.Plugin;
using Flow.Launcher.Plugin.SharedCommands; using Flow.Launcher.Plugin.SharedCommands;
using Flow.Launcher.Plugin.SharedModels; using Flow.Launcher.Plugin.SharedModels;
using Flow.Launcher.ViewModel; using Flow.Launcher.ViewModel;
using ModernWpf.Controls; using iNKORE.UI.WPF.Modern;
using iNKORE.UI.WPF.Modern.Controls;
using DataObject = System.Windows.DataObject; using DataObject = System.Windows.DataObject;
using Key = System.Windows.Input.Key; using Key = System.Windows.Input.Key;
using MouseButtons = System.Windows.Forms.MouseButtons; using MouseButtons = System.Windows.Forms.MouseButtons;
@ -61,8 +63,9 @@ namespace Flow.Launcher
private bool _isArrowKeyPressed = false; private bool _isArrowKeyPressed = false;
// Window Sound Effects // Window Sound Effects
private MediaPlayer animationSoundWMP; private MediaPlayer _animationSoundWMP;
private SoundPlayer animationSoundWPF; private SoundPlayer _animationSoundWPF;
private readonly Lock _soundLock = new();
// Window WndProc // Window WndProc
private HwndSource _hwndSource; private HwndSource _hwndSource;
@ -93,6 +96,7 @@ namespace Flow.Launcher
UpdatePosition(); UpdatePosition();
InitSoundEffects(); InitSoundEffects();
RegisterSoundEffectsEvent();
DataObject.AddPastingHandler(QueryTextBox, QueryTextBox_OnPaste); DataObject.AddPastingHandler(QueryTextBox, QueryTextBox_OnPaste);
_viewModel.ActualApplicationThemeChanged += ViewModel_ActualApplicationThemeChanged; _viewModel.ActualApplicationThemeChanged += ViewModel_ActualApplicationThemeChanged;
} }
@ -188,11 +192,11 @@ namespace Flow.Launcher
// Initialize color scheme // Initialize color scheme
if (_settings.ColorScheme == Constant.Light) if (_settings.ColorScheme == Constant.Light)
{ {
ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Light; ThemeManager.Current.ApplicationTheme = ApplicationTheme.Light;
} }
else if (_settings.ColorScheme == Constant.Dark) else if (_settings.ColorScheme == Constant.Dark)
{ {
ModernWpf.ThemeManager.Current.ApplicationTheme = ModernWpf.ApplicationTheme.Dark; ThemeManager.Current.ApplicationTheme = ApplicationTheme.Dark;
} }
// Initialize position // Initialize position
@ -666,16 +670,6 @@ namespace Flow.Launcher
handled = true; handled = true;
} }
break; break;
case Win32Helper.WM_POWERBROADCAST: // Handle power broadcast messages
// https://learn.microsoft.com/en-us/windows/win32/power/wm-powerbroadcast
if (wParam.ToInt32() == Win32Helper.PBT_APMRESUMEAUTOMATIC)
{
// Fix for sound not playing after sleep / hibernate
// https://stackoverflow.com/questions/64805186/mediaplayer-doesnt-play-after-computer-sleeps
InitSoundEffects();
}
handled = true;
break;
} }
return IntPtr.Zero; return IntPtr.Zero;
@ -687,31 +681,78 @@ namespace Flow.Launcher
private void InitSoundEffects() private void InitSoundEffects()
{ {
if (_settings.WMPInstalled) lock (_soundLock)
{ {
animationSoundWMP?.Close(); if (_settings.WMPInstalled)
animationSoundWMP = new MediaPlayer(); {
animationSoundWMP.Open(new Uri(AppContext.BaseDirectory + "Resources\\open.wav")); _animationSoundWMP?.Close();
} _animationSoundWMP = new MediaPlayer();
else _animationSoundWMP.Open(new Uri(AppContext.BaseDirectory + "Resources\\open.wav"));
{ }
animationSoundWPF?.Dispose(); else
animationSoundWPF = new SoundPlayer(AppContext.BaseDirectory + "Resources\\open.wav"); {
animationSoundWPF.Load(); _animationSoundWPF?.Dispose();
_animationSoundWPF = new SoundPlayer(AppContext.BaseDirectory + "Resources\\open.wav");
_animationSoundWPF.Load();
}
} }
} }
private void SoundPlay() private void SoundPlay()
{ {
if (_settings.WMPInstalled) lock (_soundLock)
{ {
animationSoundWMP.Position = TimeSpan.Zero; if (_settings.WMPInstalled)
animationSoundWMP.Volume = _settings.SoundVolume / 100.0; {
animationSoundWMP.Play(); _animationSoundWMP.Position = TimeSpan.Zero;
_animationSoundWMP.Volume = _settings.SoundVolume / 100.0;
_animationSoundWMP.Play();
}
else
{
_animationSoundWPF.Play();
}
} }
else }
private void RegisterSoundEffectsEvent()
{
// Fix for sound not playing after sleep / hibernate for both modern standby and legacy standby
// https://stackoverflow.com/questions/64805186/mediaplayer-doesnt-play-after-computer-sleeps
try
{ {
animationSoundWPF.Play(); Win32Helper.RegisterSleepModeListener(() =>
{
if (Application.Current == null)
{
return;
}
// We must run InitSoundEffects on UI thread because MediaPlayer is a DispatcherObject
if (!Application.Current.Dispatcher.CheckAccess())
{
Application.Current.Dispatcher.Invoke(InitSoundEffects);
return;
}
InitSoundEffects();
});
}
catch (Exception e)
{
App.API.LogException(ClassName, "Failed to register sound effect event", e);
}
}
private static void UnregisterSoundEffectsEvent()
{
try
{
Win32Helper.UnregisterSleepModeListener();
}
catch (Exception e)
{
App.API.LogException(ClassName, "Failed to unregister sound effect event", e);
} }
} }
@ -1436,9 +1477,10 @@ namespace Flow.Launcher
{ {
_hwndSource?.Dispose(); _hwndSource?.Dispose();
_notifyIcon?.Dispose(); _notifyIcon?.Dispose();
animationSoundWMP?.Close(); _animationSoundWMP?.Close();
animationSoundWPF?.Dispose(); _animationSoundWPF?.Dispose();
_viewModel.ActualApplicationThemeChanged -= ViewModel_ActualApplicationThemeChanged; _viewModel.ActualApplicationThemeChanged -= ViewModel_ActualApplicationThemeChanged;
UnregisterSoundEffectsEvent();
} }
_disposed = true; _disposed = true;

View file

@ -4,6 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:flowlauncher="clr-namespace:Flow.Launcher" xmlns:flowlauncher="clr-namespace:Flow.Launcher"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
Title="{DynamicResource updateAllPluginsButtonContent}" Title="{DynamicResource updateAllPluginsButtonContent}"
Width="530" Width="530"
Background="{DynamicResource PopuBGColor}" Background="{DynamicResource PopuBGColor}"
@ -66,13 +67,13 @@
Text="{DynamicResource updateAllPluginsButtonContent}" Text="{DynamicResource updateAllPluginsButtonContent}"
TextAlignment="Left" /> TextAlignment="Left" />
<ScrollViewer <ui:ScrollViewerEx
MaxHeight="300" MaxHeight="300"
Margin="0 5 0 5" Margin="0 5 0 5"
HorizontalScrollBarVisibility="Disabled" HorizontalScrollBarVisibility="Disabled"
VerticalScrollBarVisibility="Auto"> VerticalScrollBarVisibility="Auto">
<StackPanel x:Name="UpdatePluginStackPanel" /> <StackPanel x:Name="UpdatePluginStackPanel" />
</ScrollViewer> </ui:ScrollViewerEx>
<Rectangle <Rectangle
Height="1" Height="1"

View file

@ -31,8 +31,8 @@ using Flow.Launcher.Plugin;
using Flow.Launcher.Plugin.SharedCommands; using Flow.Launcher.Plugin.SharedCommands;
using Flow.Launcher.Plugin.SharedModels; using Flow.Launcher.Plugin.SharedModels;
using Flow.Launcher.ViewModel; using Flow.Launcher.ViewModel;
using iNKORE.UI.WPF.Modern;
using JetBrains.Annotations; using JetBrains.Annotations;
using ModernWpf;
using Squirrel; using Squirrel;
using Stopwatch = Flow.Launcher.Infrastructure.Stopwatch; using Stopwatch = Flow.Launcher.Infrastructure.Stopwatch;

View file

@ -7,7 +7,7 @@
xmlns:local="clr-namespace:Flow.Launcher" xmlns:local="clr-namespace:Flow.Launcher"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:mdxam="clr-namespace:MdXaml;assembly=MdXaml" xmlns:mdxam="clr-namespace:MdXaml;assembly=MdXaml"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:vm="clr-namespace:Flow.Launcher.ViewModel" xmlns:vm="clr-namespace:Flow.Launcher.ViewModel"
Title="{DynamicResource releaseNotes}" Title="{DynamicResource releaseNotes}"
Width="940" Width="940"
@ -16,6 +16,7 @@
MinHeight="600" MinHeight="600"
Background="{DynamicResource PopuBGColor}" Background="{DynamicResource PopuBGColor}"
Closed="Window_Closed" Closed="Window_Closed"
DataContext="{Binding RelativeSource={RelativeSource Self}}"
Foreground="{DynamicResource PopupTextColor}" Foreground="{DynamicResource PopupTextColor}"
Loaded="Window_Loaded" Loaded="Window_Loaded"
ResizeMode="CanResize" ResizeMode="CanResize"
@ -44,7 +45,7 @@
</Grid.ColumnDefinitions> </Grid.ColumnDefinitions>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="32" /> <RowDefinition Height="32" />
<RowDefinition Height="24" /> <RowDefinition Height="Auto" />
<RowDefinition Height="*" /> <RowDefinition Height="*" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<!-- TitleBar and Control --> <!-- TitleBar and Control -->
@ -161,18 +162,23 @@
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
Grid.ColumnSpan="5" Grid.ColumnSpan="5"
Margin="18 0 18 0"> Margin="6 0 18 0">
<cc:HyperLink x:Name="SeeMore" Text="{DynamicResource seeMoreReleaseNotes}" /> <ui:HyperlinkButton
x:Name="SeeMore"
Content="{DynamicResource seeMoreReleaseNotes}"
NavigateUri="{Binding ReleaseNotes}" />
</Grid> </Grid>
<!-- Do not use scroll function of MarkdownViewer because it does not support smooth scroll --> <!-- Do not use scroll function of MarkdownViewer because it does not support smooth scroll -->
<ScrollViewer <ui:ScrollViewerEx
x:Name="MarkdownScrollViewer" x:Name="MarkdownScrollViewer"
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"
Grid.ColumnSpan="5" Grid.ColumnSpan="5"
Width="500" Height="500"
Height="500"> Margin="15 0 0 0"
Padding="0 0 15 0"
HorizontalAlignment="Stretch">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="Auto" /> <RowDefinition Height="Auto" />
@ -193,11 +199,11 @@
VerticalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Disabled"
Visibility="Collapsed" /> Visibility="Collapsed" />
</Grid> </Grid>
</ScrollViewer> </ui:ScrollViewerEx>
<!-- This Grid is for display progress ring and refresh button. --> <!-- This Grid is for display progress ring and refresh button. -->
<!-- And it is also for changing the size of the MarkdownViewer. --> <!-- And it is also for changing the size of the MarkdownViewer. -->
<!-- Because VerticalAlignment="Stretch" can cause size issue with MarkdownScrollViewer. --> <!-- Because VerticalAlignment="Stretch" can cause height issue with MarkdownScrollViewer. -->
<Grid <Grid
Grid.Row="2" Grid.Row="2"
Grid.Column="0" Grid.Column="0"

View file

@ -10,27 +10,27 @@ using System.Windows;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Media; using System.Windows.Media;
using Flow.Launcher.Infrastructure.Http; using Flow.Launcher.Infrastructure.Http;
using iNKORE.UI.WPF.Modern;
namespace Flow.Launcher namespace Flow.Launcher
{ {
public partial class ReleaseNotesWindow : Window public partial class ReleaseNotesWindow : Window
{ {
private static readonly string ReleaseNotes = Properties.Settings.Default.GithubRepo + "/releases"; public string ReleaseNotes => Properties.Settings.Default.GithubRepo + "/releases";
public ReleaseNotesWindow() public ReleaseNotesWindow()
{ {
InitializeComponent(); InitializeComponent();
SeeMore.Uri = ReleaseNotes; ThemeManager.Current.ActualApplicationThemeChanged += ThemeManager_ActualApplicationThemeChanged;
ModernWpf.ThemeManager.Current.ActualApplicationThemeChanged += ThemeManager_ActualApplicationThemeChanged;
} }
#region Window Events #region Window Events
private void ThemeManager_ActualApplicationThemeChanged(ModernWpf.ThemeManager sender, object args) private void ThemeManager_ActualApplicationThemeChanged(ThemeManager sender, object args)
{ {
Application.Current.Dispatcher.Invoke(() => Application.Current.Dispatcher.Invoke(() =>
{ {
if (ModernWpf.ThemeManager.Current.ActualApplicationTheme == ModernWpf.ApplicationTheme.Light) if (ThemeManager.Current.ActualApplicationTheme == ApplicationTheme.Light)
{ {
MarkdownViewer.MarkdownStyle = (Style)Application.Current.Resources["DocumentStyleGithubLikeLight"]; MarkdownViewer.MarkdownStyle = (Style)Application.Current.Resources["DocumentStyleGithubLikeLight"];
MarkdownViewer.Foreground = Brushes.Black; MarkdownViewer.Foreground = Brushes.Black;
@ -58,7 +58,7 @@ namespace Flow.Launcher
private void Window_Closed(object sender, EventArgs e) private void Window_Closed(object sender, EventArgs e)
{ {
ModernWpf.ThemeManager.Current.ActualApplicationThemeChanged -= ThemeManager_ActualApplicationThemeChanged; ThemeManager.Current.ActualApplicationThemeChanged -= ThemeManager_ActualApplicationThemeChanged;
} }
#endregion #endregion
@ -147,7 +147,6 @@ namespace Flow.Launcher
private void Grid_SizeChanged(object sender, SizeChangedEventArgs e) private void Grid_SizeChanged(object sender, SizeChangedEventArgs e)
{ {
MarkdownScrollViewer.Height = e.NewSize.Height; MarkdownScrollViewer.Height = e.NewSize.Height;
MarkdownScrollViewer.Width = e.NewSize.Width;
} }
private void MarkdownViewer_MouseWheel(object sender, MouseWheelEventArgs e) private void MarkdownViewer_MouseWheel(object sender, MouseWheelEventArgs e)

View file

@ -1,139 +0,0 @@
<UserControl
x:Class="Flow.Launcher.Resources.Controls.Card"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher.Resources.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:ui="http://schemas.modernwpf.com/2019"
d:DesignHeight="450"
d:DesignWidth="800"
mc:Ignorable="d">
<UserControl.Template>
<ControlTemplate TargetType="UserControl">
<Border x:Name="BD" HorizontalAlignment="Stretch">
<Border.Style>
<Style TargetType="{x:Type Border}">
<Setter Property="Background" Value="{DynamicResource Color00B}" />
<Setter Property="BorderBrush" Value="{DynamicResource Color03B}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="5" />
<Setter Property="MinHeight" Value="68" />
<Setter Property="Padding" Value="0 15 0 15" />
<Setter Property="Margin" Value="0 4 0 0" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Style.Triggers>
<DataTrigger Binding="{Binding Type, RelativeSource={RelativeSource AncestorType=local:Card}}" Value="Inside">
<Setter Property="BorderThickness" Value="0 1 0 0" />
<Setter Property="CornerRadius" Value="0" />
<Setter Property="Margin" Value="0 0 0 0" />
<Setter Property="Background" Value="Transparent" />
</DataTrigger>
<DataTrigger Binding="{Binding Type, RelativeSource={RelativeSource AncestorType=local:Card}}" Value="InsideFit">
<Setter Property="BorderThickness" Value="0 1 0 0" />
<Setter Property="CornerRadius" Value="0" />
<Setter Property="Margin" Value="0 0 0 0" />
<Setter Property="Padding" Value="35 0 26 0" />
<Setter Property="Background" Value="Transparent" />
</DataTrigger>
<DataTrigger Binding="{Binding Type, RelativeSource={RelativeSource AncestorType=local:Card}}" Value="First">
<Setter Property="Margin" Value="0" />
<Setter Property="CornerRadius" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
</DataTrigger>
<DataTrigger Binding="{Binding Type, RelativeSource={RelativeSource AncestorType=local:Card}}" Value="Middle">
<Setter Property="Margin" Value="0" />
<Setter Property="CornerRadius" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0 1 0 0" />
</DataTrigger>
<DataTrigger Binding="{Binding Type, RelativeSource={RelativeSource AncestorType=local:Card}}" Value="Last">
<Setter Property="Margin" Value="0" />
<Setter Property="CornerRadius" Value="0" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderThickness" Value="0 1 0 0" />
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition
Width="auto"
MinWidth="20"
MaxWidth="60" />
<ColumnDefinition Width="8*" />
<ColumnDefinition Width="Auto" MinWidth="30" />
</Grid.ColumnDefinitions>
<ContentControl
Grid.Row="0"
Grid.Column="2"
Margin="0 0 16 0"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Content="{TemplateBinding Content}" />
<StackPanel>
<StackPanel.Style>
<Style TargetType="{x:Type StackPanel}">
<Setter Property="Grid.Column" Value="1" />
<Setter Property="Width" Value="Auto" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
</StackPanel.Style>
<TextBlock x:Name="ItemTitle" Text="{Binding Title, RelativeSource={RelativeSource AncestorType=local:Card}}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="{DynamicResource Color05B}" />
<Setter Property="Margin" Value="0 0 0 0" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock x:Name="SubTitle" Text="{Binding Sub, RelativeSource={RelativeSource AncestorType=local:Card}}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=SubTitle, Path=Text}" Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
<Setter Property="Foreground" Value="{DynamicResource Color04B}" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Margin" Value="0 0 0 0" />
<Setter Property="Padding" Value="0 0 24 0" />
<Setter Property="TextWrapping" Value="WrapWithOverflow" />
</Style>
</TextBlock.Style>
</TextBlock>
</StackPanel>
<TextBlock x:Name="ItemIcon" Text="{Binding Icon, RelativeSource={RelativeSource AncestorType=local:Card}}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=ItemIcon, Path=Text}" Value="{x:Static sys:String.Empty}">
<Setter Property="Margin" Value="24 0 0 0" />
</DataTrigger>
</Style.Triggers>
<Setter Property="Grid.Column" Value="0" />
<Setter Property="Margin" Value="24 0 16 0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="20" />
<Setter Property="FontFamily" Value="/Resources/#Segoe Fluent Icons" />
<Setter Property="Foreground" Value="{DynamicResource Color05B}" />
</Style>
</TextBlock.Style>
</TextBlock>
</Grid>
</Border>
</ControlTemplate>
</UserControl.Template>
</UserControl>

View file

@ -1,67 +0,0 @@
using System.Windows;
using UserControl = System.Windows.Controls.UserControl;
namespace Flow.Launcher.Resources.Controls
{
public partial class Card : UserControl
{
public enum CardType
{
Default,
Inside,
InsideFit,
First,
Middle,
Last
}
public Card()
{
InitializeComponent();
}
public string Title
{
get { return (string)GetValue(TitleProperty); }
set { SetValue(TitleProperty, value); }
}
public static readonly DependencyProperty TitleProperty =
DependencyProperty.Register(nameof(Title), typeof(string), typeof(Card), new PropertyMetadata(string.Empty));
public string Sub
{
get { return (string)GetValue(SubProperty); }
set { SetValue(SubProperty, value); }
}
public static readonly DependencyProperty SubProperty =
DependencyProperty.Register(nameof(Sub), typeof(string), typeof(Card), new PropertyMetadata(string.Empty));
public string Icon
{
get { return (string)GetValue(IconProperty); }
set { SetValue(IconProperty, value); }
}
public static readonly DependencyProperty IconProperty =
DependencyProperty.Register(nameof(Icon), typeof(string), typeof(Card), new PropertyMetadata(string.Empty));
/// <summary>
/// Gets or sets additional content for the UserControl
/// </summary>
public object AdditionalContent
{
get { return (object)GetValue(AdditionalContentProperty); }
set { SetValue(AdditionalContentProperty, value); }
}
public static readonly DependencyProperty AdditionalContentProperty =
DependencyProperty.Register(nameof(AdditionalContent), typeof(object), typeof(Card),
new PropertyMetadata(null));
public CardType Type
{
get { return (CardType)GetValue(TypeProperty); }
set { SetValue(TypeProperty, value); }
}
public static readonly DependencyProperty TypeProperty =
DependencyProperty.Register(nameof(Type), typeof(CardType), typeof(Card),
new PropertyMetadata(CardType.Default));
}
}

View file

@ -1,32 +0,0 @@
<UserControl x:Class="Flow.Launcher.Resources.Controls.CardGroup"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls"
mc:Ignorable="d"
d:DataContext="{d:DesignInstance cc:CardGroup}"
d:DesignHeight="300" d:DesignWidth="300">
<UserControl.Resources>
<Style TargetType="cc:Card" x:Key="FirstStyle">
<Setter Property="cc:CardGroup.Position" Value="First" />
</Style>
<Style TargetType="cc:Card" x:Key="MiddleStyle">
<Setter Property="cc:CardGroup.Position" Value="Middle" />
</Style>
<Style TargetType="cc:Card" x:Key="LastStyle">
<Setter Property="cc:CardGroup.Position" Value="Last" />
</Style>
<cc:CardGroupCardStyleSelector
x:Key="CardStyleSelector"
FirstStyle="{StaticResource FirstStyle}"
MiddleStyle="{StaticResource MiddleStyle}"
LastStyle="{StaticResource LastStyle}" />
</UserControl.Resources>
<Border Background="{DynamicResource Color00B}" BorderBrush="{DynamicResource Color03B}" BorderThickness="1"
CornerRadius="5">
<ItemsControl ItemsSource="{Binding Content, RelativeSource={RelativeSource AncestorType=cc:CardGroup}}"
ItemContainerStyleSelector="{StaticResource CardStyleSelector}" />
</Border>
</UserControl>

View file

@ -1,47 +0,0 @@
using System;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Controls;
namespace Flow.Launcher.Resources.Controls;
public partial class CardGroup : UserControl
{
public enum CardGroupPosition
{
NotInGroup,
First,
Middle,
Last
}
public new ObservableCollection<Card> Content
{
get { return (ObservableCollection<Card>)GetValue(ContentProperty); }
set { SetValue(ContentProperty, value); }
}
public static new readonly DependencyProperty ContentProperty =
DependencyProperty.Register(nameof(Content), typeof(ObservableCollection<Card>), typeof(CardGroup));
public static readonly DependencyProperty PositionProperty = DependencyProperty.RegisterAttached(
"Position", typeof(CardGroupPosition), typeof(CardGroup),
new FrameworkPropertyMetadata(CardGroupPosition.NotInGroup, FrameworkPropertyMetadataOptions.AffectsRender)
);
public static void SetPosition(UIElement element, CardGroupPosition value)
{
element.SetValue(PositionProperty, value);
}
public static CardGroupPosition GetPosition(UIElement element)
{
return (CardGroupPosition)element.GetValue(PositionProperty);
}
public CardGroup()
{
InitializeComponent();
Content = new ObservableCollection<Card>();
}
}

View file

@ -1,21 +0,0 @@
using System.Windows;
using System.Windows.Controls;
namespace Flow.Launcher.Resources.Controls;
public class CardGroupCardStyleSelector : StyleSelector
{
public Style FirstStyle { get; set; }
public Style MiddleStyle { get; set; }
public Style LastStyle { get; set; }
public override Style SelectStyle(object item, DependencyObject container)
{
var itemsControl = ItemsControl.ItemsControlFromItemContainer(container);
var index = itemsControl.ItemContainerGenerator.IndexFromContainer(container);
if (index == 0) return FirstStyle;
if (index == itemsControl.Items.Count - 1) return LastStyle;
return MiddleStyle;
}
}

View file

@ -0,0 +1,253 @@
using iNKORE.UI.WPF.Modern.Controls;
using iNKORE.UI.WPF.Modern.Controls.Helpers;
using iNKORE.UI.WPF.Modern.Controls.Primitives;
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
namespace Flow.Launcher.Resources.Controls
{
// TODO: Use IsScrollAnimationEnabled property in future: https://github.com/iNKORE-NET/UI.WPF.Modern/pull/347
public class CustomScrollViewerEx : ScrollViewer
{
private double LastVerticalLocation = 0;
private double LastHorizontalLocation = 0;
public CustomScrollViewerEx()
{
Loaded += OnLoaded;
var valueSource = DependencyPropertyHelper.GetValueSource(this, AutoPanningMode.IsEnabledProperty).BaseValueSource;
if (valueSource == BaseValueSource.Default)
{
AutoPanningMode.SetIsEnabled(this, true);
}
}
#region Orientation
public static readonly DependencyProperty OrientationProperty =
DependencyProperty.Register(
nameof(Orientation),
typeof(Orientation),
typeof(CustomScrollViewerEx),
new PropertyMetadata(Orientation.Vertical));
public Orientation Orientation
{
get => (Orientation)GetValue(OrientationProperty);
set => SetValue(OrientationProperty, value);
}
#endregion
#region AutoHideScrollBars
public static readonly DependencyProperty AutoHideScrollBarsProperty =
ScrollViewerHelper.AutoHideScrollBarsProperty
.AddOwner(
typeof(CustomScrollViewerEx),
new PropertyMetadata(true, OnAutoHideScrollBarsChanged));
public bool AutoHideScrollBars
{
get => (bool)GetValue(AutoHideScrollBarsProperty);
set => SetValue(AutoHideScrollBarsProperty, value);
}
private static void OnAutoHideScrollBarsChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is CustomScrollViewerEx sv)
{
sv.UpdateVisualState();
}
}
#endregion
private void OnLoaded(object sender, RoutedEventArgs e)
{
LastVerticalLocation = VerticalOffset;
LastHorizontalLocation = HorizontalOffset;
UpdateVisualState(false);
}
/// <inheritdoc/>
protected override void OnInitialized(EventArgs e)
{
base.OnInitialized(e);
if (Style == null && ReadLocalValue(StyleProperty) == DependencyProperty.UnsetValue)
{
SetResourceReference(StyleProperty, typeof(ScrollViewer));
}
}
/// <inheritdoc/>
protected override void OnMouseWheel(MouseWheelEventArgs e)
{
var Direction = GetDirection();
ScrollViewerBehavior.SetIsAnimating(this, true);
if (Direction == Orientation.Vertical)
{
if (ScrollableHeight > 0)
{
e.Handled = true;
}
var WheelChange = e.Delta * (ViewportHeight / 1.5) / ActualHeight;
var newOffset = LastVerticalLocation - WheelChange;
if (newOffset < 0)
{
newOffset = 0;
}
if (newOffset > ScrollableHeight)
{
newOffset = ScrollableHeight;
}
if (newOffset == LastVerticalLocation)
{
return;
}
ScrollToVerticalOffset(LastVerticalLocation);
ScrollToValue(newOffset, Direction);
LastVerticalLocation = newOffset;
}
else
{
if (ScrollableWidth > 0)
{
e.Handled = true;
}
var WheelChange = e.Delta * (ViewportWidth / 1.5) / ActualWidth;
var newOffset = LastHorizontalLocation - WheelChange;
if (newOffset < 0)
{
newOffset = 0;
}
if (newOffset > ScrollableWidth)
{
newOffset = ScrollableWidth;
}
if (newOffset == LastHorizontalLocation)
{
return;
}
ScrollToHorizontalOffset(LastHorizontalLocation);
ScrollToValue(newOffset, Direction);
LastHorizontalLocation = newOffset;
}
}
/// <inheritdoc/>
protected override void OnScrollChanged(ScrollChangedEventArgs e)
{
base.OnScrollChanged(e);
if (!ScrollViewerBehavior.GetIsAnimating(this))
{
LastVerticalLocation = VerticalOffset;
LastHorizontalLocation = HorizontalOffset;
}
}
private Orientation GetDirection()
{
var isShiftDown = Keyboard.IsKeyDown(Key.LeftShift) || Keyboard.IsKeyDown(Key.RightShift);
if (Orientation == Orientation.Horizontal)
{
return isShiftDown ? Orientation.Vertical : Orientation.Horizontal;
}
else
{
return isShiftDown ? Orientation.Horizontal : Orientation.Vertical;
}
}
/// <summary>
/// Causes the <see cref="ScrollViewerEx"/> to load a new view into the viewport using the specified offsets and zoom factor.
/// </summary>
/// <param name="horizontalOffset">A value between 0 and <see cref="ScrollViewer.ScrollableWidth"/> that specifies the distance the content should be scrolled horizontally.</param>
/// <param name="verticalOffset">A value between 0 and <see cref="ScrollViewer.ScrollableHeight"/> that specifies the distance the content should be scrolled vertically.</param>
/// <param name="zoomFactor">A value between MinZoomFactor and MaxZoomFactor that specifies the required target ZoomFactor.</param>
/// <returns><see langword="true"/> if the view is changed; otherwise, <see langword="false"/>.</returns>
public bool ChangeView(double? horizontalOffset, double? verticalOffset, float? zoomFactor)
{
return ChangeView(horizontalOffset, verticalOffset, zoomFactor, false);
}
/// <summary>
/// Causes the <see cref="ScrollViewerEx"/> to load a new view into the viewport using the specified offsets and zoom factor, and optionally disables scrolling animation.
/// </summary>
/// <param name="horizontalOffset">A value between 0 and <see cref="ScrollViewer.ScrollableWidth"/> that specifies the distance the content should be scrolled horizontally.</param>
/// <param name="verticalOffset">A value between 0 and <see cref="ScrollViewer.ScrollableHeight"/> that specifies the distance the content should be scrolled vertically.</param>
/// <param name="zoomFactor">A value between MinZoomFactor and MaxZoomFactor that specifies the required target ZoomFactor.</param>
/// <param name="disableAnimation"><see langword="true"/> to disable zoom/pan animations while changing the view; otherwise, <see langword="false"/>. The default is false.</param>
/// <returns><see langword="true"/> if the view is changed; otherwise, <see langword="false"/>.</returns>
public bool ChangeView(double? horizontalOffset, double? verticalOffset, float? zoomFactor, bool disableAnimation)
{
if (disableAnimation)
{
if (horizontalOffset.HasValue)
{
ScrollToHorizontalOffset(horizontalOffset.Value);
}
if (verticalOffset.HasValue)
{
ScrollToVerticalOffset(verticalOffset.Value);
}
}
else
{
if (horizontalOffset.HasValue)
{
ScrollToHorizontalOffset(LastHorizontalLocation);
ScrollToValue(Math.Min(ScrollableWidth, horizontalOffset.Value), Orientation.Horizontal);
LastHorizontalLocation = horizontalOffset.Value;
}
if (verticalOffset.HasValue)
{
ScrollToVerticalOffset(LastVerticalLocation);
ScrollToValue(Math.Min(ScrollableHeight, verticalOffset.Value), Orientation.Vertical);
LastVerticalLocation = verticalOffset.Value;
}
}
return true;
}
private void ScrollToValue(double value, Orientation Direction)
{
if (Direction == Orientation.Vertical)
{
ScrollToVerticalOffset(value);
}
else
{
ScrollToHorizontalOffset(value);
}
ScrollViewerBehavior.SetIsAnimating(this, false);
}
private void UpdateVisualState(bool useTransitions = true)
{
var stateName = AutoHideScrollBars ? "NoIndicator" : "MouseIndicator";
VisualStateManager.GoToState(this, stateName, useTransitions);
}
}
}

View file

@ -1,312 +0,0 @@
<UserControl
x:Class="Flow.Launcher.Resources.Controls.ExCard"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher.Resources.Controls"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:ui="http://schemas.modernwpf.com/2019"
mc:Ignorable="d">
<UserControl.Template>
<ControlTemplate TargetType="UserControl">
<Expander
x:Name="expanderHeader"
Padding="0"
BorderThickness="1"
SnapsToDevicePixels="False">
<Expander.Style>
<Style TargetType="{x:Type Expander}">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" />
<Setter Property="Background" Value="{DynamicResource Color00B}" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="VerticalContentAlignment" Value="Stretch" />
<Setter Property="BorderBrush" Value="{DynamicResource Color03B}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Expander}">
<Border
x:Name="Bd"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="5"
SnapsToDevicePixels="true">
<DockPanel>
<ToggleButton
x:Name="HeaderSite"
MinWidth="0"
MinHeight="68"
Margin="0,0,0,0"
Padding="0,0,0,0"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Header}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
DockPanel.Dock="Top"
FocusVisualStyle="{DynamicResource ExpanderHeaderFocusVisual}"
FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}"
FontStretch="{TemplateBinding FontStretch}"
FontStyle="{TemplateBinding FontStyle}"
FontWeight="{TemplateBinding FontWeight}"
Foreground="{TemplateBinding Foreground}"
IsChecked="{Binding IsExpanded, Mode=TwoWay, RelativeSource={RelativeSource AncestorType=Expander}}">
<ToggleButton.Style>
<Style TargetType="{x:Type ToggleButton}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ToggleButton}">
<Border
x:Name="ToggleBtn"
Padding="{TemplateBinding Padding}"
Background="{DynamicResource Color00B}"
ClipToBounds="True"
CornerRadius="5">
<Grid SnapsToDevicePixels="True">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="30" />
</Grid.ColumnDefinitions>
<ContentPresenter
Grid.Column="0"
Margin="0,0,0,0"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Content="{TemplateBinding Content}"
RecognizesAccessKey="True"
SnapsToDevicePixels="True" />
<Grid
x:Name="ChevronGrid"
Grid.Column="2"
Margin="0,0,18,0"
VerticalAlignment="Center"
Background="Transparent"
RenderTransformOrigin="0.5, 0.5">
<Grid.RenderTransform>
<RotateTransform Angle="0" />
</Grid.RenderTransform>
<Ellipse
x:Name="circle"
Width="19"
Height="19"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Stroke="Transparent" />
<Path
x:Name="arrow"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M 1,1.5 L 4.5,5 L 8,1.5"
SnapsToDevicePixels="false"
Stroke="#666"
StrokeThickness="1" />
</Grid>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="arrow" Property="Data" Value="M 1,4.5 L 4.5,1 L 8,4.5" />
<Setter TargetName="ToggleBtn" Property="CornerRadius" Value="5 5 0 0" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
<Setter TargetName="circle" Property="Stroke" Value="Transparent" />
<Setter TargetName="arrow" Property="Stroke" Value="{DynamicResource Color05B}" />
<Setter TargetName="ToggleBtn" Property="Background" Value="{DynamicResource CustomExpanderHover}" />
</Trigger>
<Trigger Property="IsPressed" Value="true">
<Setter TargetName="circle" Property="Stroke" Value="Transparent" />
<Setter TargetName="circle" Property="StrokeThickness" Value="1.5" />
<Setter TargetName="arrow" Property="Stroke" Value="{DynamicResource Color17B}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ToggleButton.Style>
</ToggleButton>
<Border x:Name="ContentPresenterBorder" BorderThickness="0">
<ContentPresenter
x:Name="ExpandSite"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
DockPanel.Dock="Bottom"
Focusable="false" />
<Border.LayoutTransform>
<ScaleTransform ScaleY="0" />
</Border.LayoutTransform>
</Border>
</DockPanel>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsExpanded" Value="true">
<Setter TargetName="ExpandSite" Property="Visibility" Value="Visible" />
<Setter TargetName="ContentPresenterBorder" Property="BorderThickness" Value="0,0,0,0" />
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="ContentPresenterBorder"
Storyboard.TargetProperty="(Border.LayoutTransform).(ScaleTransform.ScaleY)"
From="0.0"
To="1.0"
Duration="00:00:00.00" />
<DoubleAnimation
Storyboard.TargetName="ContentPresenterBorder"
Storyboard.TargetProperty="(Border.Opacity)"
From="0.0"
To="1.0"
Duration="00:00:00.00" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Storyboard.TargetName="ContentPresenterBorder"
Storyboard.TargetProperty="(Border.LayoutTransform).(ScaleTransform.ScaleY)"
From="1.0"
To="0"
Duration="00:00:00.00" />
<!-- Animation 00:00:00.167 -->
<DoubleAnimation
Storyboard.TargetName="ContentPresenterBorder"
Storyboard.TargetProperty="(Border.Opacity)"
From="1.0"
To="0.0"
Duration="00:00:00.00" />
<!-- Animation 00:00:00.167 -->
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
<Trigger Property="ExpandDirection" Value="Right">
<Setter TargetName="ExpandSite" Property="DockPanel.Dock" Value="Right" />
<Setter TargetName="HeaderSite" Property="DockPanel.Dock" Value="Left" />
<Setter TargetName="HeaderSite" Property="Style" Value="{StaticResource ExpanderRightHeaderStyle}" />
</Trigger>
<Trigger Property="ExpandDirection" Value="Up">
<Setter TargetName="ExpandSite" Property="DockPanel.Dock" Value="Top" />
<Setter TargetName="HeaderSite" Property="DockPanel.Dock" Value="Bottom" />
<Setter TargetName="HeaderSite" Property="Style" Value="{StaticResource ExpanderUpHeaderStyle}" />
</Trigger>
<Trigger Property="ExpandDirection" Value="Left">
<Setter TargetName="ExpandSite" Property="DockPanel.Dock" Value="Left" />
<Setter TargetName="HeaderSite" Property="DockPanel.Dock" Value="Right" />
<Setter TargetName="HeaderSite" Property="Style" Value="{StaticResource ExpanderLeftHeaderStyle}" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Expander.Style>
<Expander.Header>
<Border Margin="0" Padding="0,12,0,12">
<Grid Width="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type Expander}}, Path=ActualWidth}" HorizontalAlignment="Left">
<Grid.ColumnDefinitions>
<ColumnDefinition
Width="auto"
MinWidth="20"
MaxWidth="60" />
<ColumnDefinition Width="7*" />
<ColumnDefinition Width="Auto" MinWidth="30" />
<ColumnDefinition Width="Auto" MinWidth="30" />
</Grid.ColumnDefinitions>
<ContentControl
x:Name="firstContentPresenter"
Grid.Column="2"
Margin="0,0,14,0"
HorizontalAlignment="Right"
Content="{Binding SideContent, RelativeSource={RelativeSource AncestorType=local:ExCard}}" />
<TextBlock
x:Name="ItemIcon"
Grid.Column="0"
VerticalAlignment="Center"
Text="{Binding Icon, RelativeSource={RelativeSource AncestorType=local:ExCard}}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=ItemIcon, Path=Text}" Value="{x:Static sys:String.Empty}">
<Setter Property="Margin" Value="24,0,0,0" />
</DataTrigger>
</Style.Triggers>
<Setter Property="Grid.Column" Value="0" />
<Setter Property="Margin" Value="24,0,16,0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="FontSize" Value="20" />
<Setter Property="FontFamily" Value="/Resources/#Segoe Fluent Icons" />
<Setter Property="Foreground" Value="{DynamicResource Color05B}" />
</Style>
</TextBlock.Style>
</TextBlock>
<StackPanel Grid.Column="1" Margin="0,0,14,0">
<StackPanel.Style>
<Style TargetType="{x:Type StackPanel}">
<Setter Property="Grid.Column" Value="1" />
<Setter Property="Width" Value="Auto" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
</StackPanel.Style>
<TextBlock x:Name="ItemTitle" Text="{Binding Title, RelativeSource={RelativeSource AncestorType=local:ExCard}}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="Foreground" Value="{DynamicResource Color05B}" />
<Setter Property="Margin" Value="0,0,0,0" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="VerticalAlignment" Value="Center" />
</Style>
</TextBlock.Style>
</TextBlock>
<TextBlock x:Name="SubTitle" Text="{Binding Sub, RelativeSource={RelativeSource AncestorType=local:ExCard}}">
<TextBlock.Style>
<Style TargetType="{x:Type TextBlock}">
<Style.Triggers>
<DataTrigger Binding="{Binding ElementName=SubTitle, Path=Text}" Value="{x:Static sys:String.Empty}">
<Setter Property="Visibility" Value="Collapsed" />
</DataTrigger>
</Style.Triggers>
<Setter Property="Foreground" Value="{DynamicResource Color04B}" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Margin" Value="0,0,0,0" />
<Setter Property="Padding" Value="0,0,24,0" />
<Setter Property="TextWrapping" Value="WrapWithOverflow" />
</Style>
</TextBlock.Style>
</TextBlock>
</StackPanel>
</Grid>
</Border>
</Expander.Header>
<Grid
Grid.Column="0"
Grid.ColumnSpan="4"
HorizontalAlignment="Stretch"
FlowDirection="LeftToRight">
<StackPanel Margin="0,0,0,0" Orientation="Vertical">
<ContentControl
Grid.Column="0"
Grid.ColumnSpan="4"
Margin="0,0,0,0"
HorizontalAlignment="Stretch"
VerticalAlignment="Center"
Content="{TemplateBinding Content}" />
</StackPanel>
</Grid>
</Expander>
</ControlTemplate>
</UserControl.Template>
</UserControl>

View file

@ -1,57 +0,0 @@
using System.Windows;
using System.Windows.Controls;
namespace Flow.Launcher.Resources.Controls
{
public partial class ExCard : UserControl
{
public ExCard()
{
InitializeComponent();
}
public string Title
{
get { return (string)GetValue(TitleProperty); }
set { SetValue(TitleProperty, value); }
}
public static readonly DependencyProperty TitleProperty =
DependencyProperty.Register(nameof(Title), typeof(string), typeof(ExCard), new PropertyMetadata(string.Empty));
public string Sub
{
get { return (string)GetValue(SubProperty); }
set { SetValue(SubProperty, value); }
}
public static readonly DependencyProperty SubProperty =
DependencyProperty.Register(nameof(Sub), typeof(string), typeof(ExCard), new PropertyMetadata(string.Empty));
public string Icon
{
get { return (string)GetValue(IconProperty); }
set { SetValue(IconProperty, value); }
}
public static readonly DependencyProperty IconProperty =
DependencyProperty.Register(nameof(Icon), typeof(string), typeof(ExCard), new PropertyMetadata(string.Empty));
/// <summary>
/// Gets or sets additional content for the UserControl
/// </summary>
public object AdditionalContent
{
get { return (object)GetValue(AdditionalContentProperty); }
set { SetValue(AdditionalContentProperty, value); }
}
public static readonly DependencyProperty AdditionalContentProperty =
DependencyProperty.Register(nameof(AdditionalContent), typeof(object), typeof(ExCard),
new PropertyMetadata(null));
public object SideContent
{
get { return (object)GetValue(SideContentProperty); }
set { SetValue(SideContentProperty, value); }
}
public static readonly DependencyProperty SideContentProperty =
DependencyProperty.Register(nameof(SideContent), typeof(object), typeof(ExCard),
new PropertyMetadata(null));
}
}

View file

@ -1,14 +0,0 @@
<UserControl x:Class="Flow.Launcher.Resources.Controls.HyperLink"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d"
d:DesignHeight="300" d:DesignWidth="300">
<TextBlock>
<Hyperlink NavigateUri="{Binding Uri, RelativeSource={RelativeSource AncestorType=UserControl}}"
RequestNavigate="Hyperlink_OnRequestNavigate">
<Run Text="{Binding Text, RelativeSource={RelativeSource AncestorType=UserControl}}" />
</Hyperlink>
</TextBlock>
</UserControl>

View file

@ -1,39 +0,0 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Navigation;
namespace Flow.Launcher.Resources.Controls;
public partial class HyperLink : UserControl
{
public static readonly DependencyProperty UriProperty = DependencyProperty.Register(
nameof(Uri), typeof(string), typeof(HyperLink), new PropertyMetadata(default(string))
);
public string Uri
{
get => (string)GetValue(UriProperty);
set => SetValue(UriProperty, value);
}
public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
nameof(Text), typeof(string), typeof(HyperLink), new PropertyMetadata(default(string))
);
public string Text
{
get => (string)GetValue(TextProperty);
set => SetValue(TextProperty, value);
}
public HyperLink()
{
InitializeComponent();
}
private void Hyperlink_OnRequestNavigate(object sender, RequestNavigateEventArgs e)
{
App.API.OpenUrl(e.Uri);
e.Handled = true;
}
}

View file

@ -1,81 +0,0 @@
<UserControl
x:Class="Flow.Launcher.Resources.Controls.InfoBar"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019"
d:DesignHeight="45"
d:DesignWidth="400"
mc:Ignorable="d">
<UserControl.Resources />
<Grid>
<Border
x:Name="PART_Border"
MinHeight="48"
Padding="18 18 18 18"
Background="{DynamicResource InfoBarInfoBG}"
BorderBrush="{DynamicResource Color03B}"
BorderThickness="1"
CornerRadius="5">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" MinWidth="24" />
</Grid.ColumnDefinitions>
<StackPanel Grid.Column="0" Orientation="Horizontal">
<Border
x:Name="PART_IconBorder"
Width="16"
Height="16"
Margin="0 0 12 0"
VerticalAlignment="Top"
CornerRadius="10">
<ui:FontIcon
x:Name="PART_Icon"
Margin="1 0 0 1"
VerticalAlignment="Center"
FontFamily="Segoe MDL2 Assets"
FontSize="13"
Foreground="{DynamicResource Color01B}"
Visibility="Visible" />
</Border>
</StackPanel>
<StackPanel
x:Name="PART_StackPanel"
Grid.Column="1"
VerticalAlignment="Center"
Orientation="Horizontal">
<TextBlock
x:Name="PART_Title"
Margin="0 0 12 0"
FontWeight="SemiBold"
Foreground="{DynamicResource Color05B}"
Text="{Binding RelativeSource={RelativeSource AncestorType=cc:InfoBar}, Path=Title}" />
<TextBlock
x:Name="PART_Message"
Foreground="{DynamicResource Color05B}"
Text="{Binding RelativeSource={RelativeSource AncestorType=cc:InfoBar}, Path=Message}"
TextWrapping="Wrap" />
</StackPanel>
<Button
x:Name="PART_CloseButton"
Grid.Column="2"
Width="32"
Height="32"
VerticalAlignment="Center"
AutomationProperties.Name="Close InfoBar"
Click="PART_CloseButton_Click"
Content="&#xE10A;"
FontFamily="Segoe MDL2 Assets"
FontSize="12"
ToolTip="Close"
Visibility="Visible" />
</Grid>
</Border>
</Grid>
</UserControl>

View file

@ -1,222 +0,0 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace Flow.Launcher.Resources.Controls
{
public partial class InfoBar : UserControl
{
public InfoBar()
{
InitializeComponent();
Loaded += InfoBar_Loaded;
}
private void InfoBar_Loaded(object sender, RoutedEventArgs e)
{
UpdateStyle();
UpdateTitleVisibility();
UpdateMessageVisibility();
UpdateOrientation();
UpdateIconAlignmentAndMargin();
UpdateIconVisibility();
UpdateCloseButtonVisibility();
}
public static readonly DependencyProperty TypeProperty =
DependencyProperty.Register(nameof(Type), typeof(InfoBarType), typeof(InfoBar), new PropertyMetadata(InfoBarType.Info, OnTypeChanged));
public InfoBarType Type
{
get => (InfoBarType)GetValue(TypeProperty);
set => SetValue(TypeProperty, value);
}
private static void OnTypeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is InfoBar infoBar)
{
infoBar.UpdateStyle();
}
}
public static readonly DependencyProperty MessageProperty =
DependencyProperty.Register(nameof(Message), typeof(string), typeof(InfoBar), new PropertyMetadata(string.Empty, OnMessageChanged));
public string Message
{
get => (string)GetValue(MessageProperty);
set
{
SetValue(MessageProperty, value);
}
}
private static void OnMessageChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is InfoBar infoBar)
{
infoBar.UpdateMessageVisibility();
}
}
private void UpdateMessageVisibility()
{
PART_Message.Visibility = string.IsNullOrEmpty(Message) ? Visibility.Collapsed : Visibility.Visible;
}
public static readonly DependencyProperty TitleProperty =
DependencyProperty.Register(nameof(Title), typeof(string), typeof(InfoBar), new PropertyMetadata(string.Empty, OnTitleChanged));
public string Title
{
get => (string)GetValue(TitleProperty);
set
{
SetValue(TitleProperty, value);
UpdateTitleVisibility(); // Visibility update when change Title
}
}
private static void OnTitleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is InfoBar infoBar)
{
infoBar.UpdateTitleVisibility();
}
}
private void UpdateTitleVisibility()
{
PART_Title.Visibility = string.IsNullOrEmpty(Title) ? Visibility.Collapsed : Visibility.Visible;
}
public static readonly DependencyProperty IsIconVisibleProperty =
DependencyProperty.Register(nameof(IsIconVisible), typeof(bool), typeof(InfoBar), new PropertyMetadata(true, OnIsIconVisibleChanged));
public bool IsIconVisible
{
get => (bool)GetValue(IsIconVisibleProperty);
set => SetValue(IsIconVisibleProperty, value);
}
public static readonly DependencyProperty LengthProperty =
DependencyProperty.Register(nameof(Length), typeof(InfoBarLength), typeof(InfoBar), new PropertyMetadata(InfoBarLength.Short, OnLengthChanged));
public InfoBarLength Length
{
get { return (InfoBarLength)GetValue(LengthProperty); }
set { SetValue(LengthProperty, value); }
}
private static void OnLengthChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
if (d is InfoBar infoBar)
{
infoBar.UpdateOrientation();
infoBar.UpdateIconAlignmentAndMargin();
}
}
private void UpdateOrientation()
{
PART_StackPanel.Orientation = Length == InfoBarLength.Long ? Orientation.Vertical : Orientation.Horizontal;
}
private void UpdateIconAlignmentAndMargin()
{
if (Length == InfoBarLength.Short)
{
PART_IconBorder.VerticalAlignment = VerticalAlignment.Center;
PART_IconBorder.Margin = new Thickness(0, 0, 12, 0);
}
else
{
PART_IconBorder.VerticalAlignment = VerticalAlignment.Top;
PART_IconBorder.Margin = new Thickness(0, 2, 12, 0);
}
}
public static readonly DependencyProperty ClosableProperty =
DependencyProperty.Register(nameof(Closable), typeof(bool), typeof(InfoBar), new PropertyMetadata(true, OnClosableChanged));
public bool Closable
{
get => (bool)GetValue(ClosableProperty);
set => SetValue(ClosableProperty, value);
}
private void PART_CloseButton_Click(object sender, RoutedEventArgs e)
{
Visibility = Visibility.Collapsed;
}
private void UpdateStyle()
{
switch (Type)
{
case InfoBarType.Info:
PART_Border.Background = (Brush)FindResource("InfoBarInfoBG");
PART_IconBorder.Background = (Brush)FindResource("InfoBarInfoIcon");
PART_Icon.Glyph = "\xF13F";
break;
case InfoBarType.Success:
PART_Border.Background = (Brush)FindResource("InfoBarSuccessBG");
PART_IconBorder.Background = (Brush)FindResource("InfoBarSuccessIcon");
PART_Icon.Glyph = "\xF13E";
break;
case InfoBarType.Warning:
PART_Border.Background = (Brush)FindResource("InfoBarWarningBG");
PART_IconBorder.Background = (Brush)FindResource("InfoBarWarningIcon");
PART_Icon.Glyph = "\xF13C";
break;
case InfoBarType.Error:
PART_Border.Background = (Brush)FindResource("InfoBarErrorBG");
PART_IconBorder.Background = (Brush)FindResource("InfoBarErrorIcon");
PART_Icon.Glyph = "\xF13D";
break;
default:
PART_Border.Background = (Brush)FindResource("InfoBarInfoBG");
PART_IconBorder.Background = (Brush)FindResource("InfoBarInfoIcon");
PART_Icon.Glyph = "\xF13F";
break;
}
}
private static void OnIsIconVisibleChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var infoBar = (InfoBar)d;
infoBar.UpdateIconVisibility();
}
private static void OnClosableChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var infoBar = (InfoBar)d;
infoBar.UpdateCloseButtonVisibility();
}
private void UpdateIconVisibility()
{
PART_IconBorder.Visibility = IsIconVisible ? Visibility.Visible : Visibility.Collapsed;
}
private void UpdateCloseButtonVisibility()
{
PART_CloseButton.Visibility = Closable ? Visibility.Visible : Visibility.Collapsed;
}
}
public enum InfoBarType
{
Info,
Success,
Warning,
Error
}
public enum InfoBarLength
{
Short,
Long
}
}

View file

@ -6,7 +6,7 @@
xmlns:converters="clr-namespace:Flow.Launcher.Converters" xmlns:converters="clr-namespace:Flow.Launcher.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:viewModel="clr-namespace:Flow.Launcher.ViewModel" xmlns:viewModel="clr-namespace:Flow.Launcher.ViewModel"
d:DataContext="{d:DesignInstance viewModel:PluginViewModel}" d:DataContext="{d:DesignInstance viewModel:PluginViewModel}"
d:DesignHeight="300" d:DesignHeight="300"
@ -66,6 +66,7 @@
Text="{DynamicResource priority}" Text="{DynamicResource priority}"
ToolTip="{DynamicResource priorityToolTip}" /> ToolTip="{DynamicResource priorityToolTip}" />
<ui:NumberBox <ui:NumberBox
MinWidth="120"
Margin="0 0 8 0" Margin="0 0 8 0"
Maximum="999" Maximum="999"
Minimum="-999" Minimum="-999"
@ -89,6 +90,7 @@
ToolTip="{DynamicResource searchDelayToolTip}" /> ToolTip="{DynamicResource searchDelayToolTip}" />
<ui:NumberBox <ui:NumberBox
Width="120" Width="120"
MinWidth="120"
Margin="0 0 8 0" Margin="0 0 8 0"
IsEnabled="{Binding SearchDelayEnabled}" IsEnabled="{Binding SearchDelayEnabled}"
Maximum="1000" Maximum="1000"

View file

@ -1,4 +1,4 @@
using ModernWpf.Controls; using iNKORE.UI.WPF.Modern.Controls;
namespace Flow.Launcher.Resources.Controls; namespace Flow.Launcher.Resources.Controls;

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

View file

@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher.Resources.Pages" xmlns:local="clr-namespace:Flow.Launcher.Resources.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
Title="WelcomePage1" Title="WelcomePage1"
DataContext="{Binding RelativeSource={RelativeSource Self}}" DataContext="{Binding RelativeSource={RelativeSource Self}}"
mc:Ignorable="d"> mc:Ignorable="d">
@ -99,11 +99,11 @@
</Style.Triggers> </Style.Triggers>
</Style> </Style>
</Page.Resources> </Page.Resources>
<ScrollViewer> <ui:ScrollViewerEx>
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="250" /> <RowDefinition Height="250" />
<RowDefinition Height="340"/> <RowDefinition Height="340" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border Grid.Row="0" HorizontalAlignment="Stretch"> <Border Grid.Row="0" HorizontalAlignment="Stretch">
@ -156,7 +156,8 @@
<TextBlock <TextBlock
FontSize="20" FontSize="20"
FontWeight="SemiBold" FontWeight="SemiBold"
Text="{DynamicResource Welcome_Page1_Title}" TextWrapping="WrapWithOverflow"/> Text="{DynamicResource Welcome_Page1_Title}"
TextWrapping="WrapWithOverflow" />
<TextBlock <TextBlock
Margin="0 10 24 0" Margin="0 10 24 0"
FontSize="14" FontSize="14"
@ -185,5 +186,5 @@
</StackPanel> </StackPanel>
</Canvas> </Canvas>
</Grid> </Grid>
</ScrollViewer> </ui:ScrollViewerEx>
</ui:Page> </ui:Page>

View file

@ -7,7 +7,7 @@
xmlns:flowlauncher="clr-namespace:Flow.Launcher" xmlns:flowlauncher="clr-namespace:Flow.Launcher"
xmlns:local="clr-namespace:Flow.Launcher.Resources.Pages" xmlns:local="clr-namespace:Flow.Launcher.Resources.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
Title="WelcomePage2" Title="WelcomePage2"
DataContext="{Binding RelativeSource={RelativeSource Self}}" DataContext="{Binding RelativeSource={RelativeSource Self}}"
mc:Ignorable="d"> mc:Ignorable="d">
@ -34,7 +34,7 @@
</Style.Triggers> </Style.Triggers>
</Style> </Style>
</Page.Resources> </Page.Resources>
<ScrollViewer> <ui:ScrollViewerEx>
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="250" /> <RowDefinition Height="250" />
@ -89,7 +89,7 @@
</StackPanel> </StackPanel>
</Border> </Border>
<ScrollViewer Grid.Row="1" VerticalScrollBarVisibility="Visible"> <Grid Grid.Row="1">
<StackPanel Margin="24 20 24 20"> <StackPanel Margin="24 20 24 20">
<TextBlock <TextBlock
FontSize="20" FontSize="20"
@ -118,8 +118,7 @@
ValidateKeyGesture="True" ValidateKeyGesture="True"
WindowTitle="{DynamicResource flowlauncherHotkey}" /> WindowTitle="{DynamicResource flowlauncherHotkey}" />
</StackPanel> </StackPanel>
</Grid>
</ScrollViewer>
</Grid> </Grid>
</ScrollViewer> </ui:ScrollViewerEx>
</ui:Page> </ui:Page>

View file

@ -4,9 +4,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls" xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:local="clr-namespace:Flow.Launcher.Resources.Pages" xmlns:local="clr-namespace:Flow.Launcher.Resources.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
Title="WelcomePage3" Title="WelcomePage3"
VerticalAlignment="Stretch" VerticalAlignment="Stretch"
mc:Ignorable="d"> mc:Ignorable="d">
@ -40,13 +41,83 @@
FontSize="20" FontSize="20"
FontWeight="SemiBold" FontWeight="SemiBold"
Text="{DynamicResource Welcome_Page3_Title}" /> Text="{DynamicResource Welcome_Page3_Title}" />
<ScrollViewer <ui:ScrollViewerEx
Grid.Row="1" Grid.Row="1"
Height="478" Height="483"
Margin="0 0 0 0"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
FontSize="13"> FontSize="13">
<StackPanel Margin="24 0 24 0"> <StackPanel Margin="24 0 24 0">
<ui:SettingsCard
Background="Transparent"
BorderThickness="0 0 0 0"
Header="{DynamicResource HotkeyUpDownDesc}">
<StackPanel Orientation="Horizontal">
<cc:HotkeyDisplay Keys="←+→" Type="Small" />
</StackPanel>
</ui:SettingsCard>
<Border
Height="1"
Background="{DynamicResource Color03B}"
BorderThickness="0" />
<ui:SettingsCard
Background="Transparent"
BorderThickness="0 0 0 0"
Header="{DynamicResource HotkeyLeftRightDesc}">
<StackPanel Orientation="Horizontal">
<cc:HotkeyDisplay Keys="↑+↓" Type="Small" />
</StackPanel>
</ui:SettingsCard>
<Border
Height="1"
Background="{DynamicResource Color03B}"
BorderThickness="0" />
<ui:SettingsCard
Background="Transparent"
BorderThickness="0 0 0 0"
Header="{DynamicResource HotkeyESCDesc}">
<StackPanel Orientation="Horizontal">
<cc:HotkeyDisplay Keys="ESC" Type="Small" />
</StackPanel>
</ui:SettingsCard>
<Border
Height="1"
Background="{DynamicResource Color03B}"
BorderThickness="0" />
<ui:SettingsCard
Background="Transparent"
BorderThickness="0 0 0 0"
Header="{DynamicResource HotkeyRunDesc}">
<cc:HotkeyDisplay Keys="ENTER" Type="Small" />
</ui:SettingsCard>
<Border
Height="1"
Background="{DynamicResource Color03B}"
BorderThickness="0" />
<ui:SettingsCard
Background="Transparent"
BorderThickness="0 0 0 0"
Header="{DynamicResource HotkeyShiftEnterDesc}">
<StackPanel Orientation="Horizontal">
<cc:HotkeyDisplay Keys="SHIFT+ENTER" Type="Small" />
</StackPanel>
</ui:SettingsCard>
<Border
Height="1"
Background="{DynamicResource Color03B}"
BorderThickness="0" />
<ui:SettingsCard
Background="Transparent"
BorderThickness="0 0 0 0"
Header="{DynamicResource HotkeyCtrlEnterDesc}">
<StackPanel Orientation="Horizontal">
<cc:HotkeyDisplay Keys="CTRL+ENTER" Type="Small" />
</StackPanel>
</ui:SettingsCard>
<Border <Border
BorderBrush="{DynamicResource Color03B}" BorderBrush="{DynamicResource Color03B}"
BorderThickness="0" BorderThickness="0"
@ -163,8 +234,8 @@
</StackPanel> </StackPanel>
</cc:Card> </cc:Card>
</StackPanel> </StackPanel>
</Border> </ui:SettingsCard>
</StackPanel> </StackPanel>
</ScrollViewer> </ui:ScrollViewerEx>
</Grid> </Grid>
</ui:Page> </ui:Page>

View file

@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher.Resources.Pages" xmlns:local="clr-namespace:Flow.Launcher.Resources.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
Title="WelcomePage4" Title="WelcomePage4"
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
@ -54,7 +54,7 @@
<Setter Property="Foreground" Value="{DynamicResource Color04B}" /> <Setter Property="Foreground" Value="{DynamicResource Color04B}" />
</Style> </Style>
</Page.Resources> </Page.Resources>
<ScrollViewer> <ui:ScrollViewerEx>
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="250" /> <RowDefinition Height="250" />
@ -93,7 +93,8 @@
<TextBlock <TextBlock
FontSize="20" FontSize="20"
FontWeight="SemiBold" FontWeight="SemiBold"
Text="{DynamicResource Welcome_Page4_Title}" TextWrapping="WrapWithOverflow"/> Text="{DynamicResource Welcome_Page4_Title}"
TextWrapping="WrapWithOverflow" />
<TextBlock <TextBlock
Margin="0 10 0 10" Margin="0 10 0 10"
FontSize="14" FontSize="14"
@ -132,5 +133,5 @@
</StackPanel> </StackPanel>
</Grid> </Grid>
</ScrollViewer> </ui:ScrollViewerEx>
</ui:Page> </ui:Page>

View file

@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher.Resources.Pages" xmlns:local="clr-namespace:Flow.Launcher.Resources.Pages"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure" xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure"
Title="WelcomePage5" Title="WelcomePage5"
d:DesignHeight="450" d:DesignHeight="450"
@ -49,11 +49,11 @@
</Style.Triggers> </Style.Triggers>
</Style> </Style>
</Page.Resources> </Page.Resources>
<ScrollViewer> <ui:ScrollViewerEx>
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="250" /> <RowDefinition Height="250" />
<RowDefinition Height="340"/> <RowDefinition Height="340" />
</Grid.RowDefinitions> </Grid.RowDefinitions>
<Border Grid.Row="0" HorizontalAlignment="Stretch"> <Border Grid.Row="0" HorizontalAlignment="Stretch">
@ -79,12 +79,13 @@
</StackPanel> </StackPanel>
</Border> </Border>
<StackPanel Grid.Row="1" Margin="24 20 24 20" > <StackPanel Grid.Row="1" Margin="24 20 24 20">
<StackPanel> <StackPanel>
<TextBlock <TextBlock
FontSize="20" FontSize="20"
FontWeight="SemiBold" FontWeight="SemiBold"
Text="{DynamicResource Welcome_Page5_Title}" TextWrapping="WrapWithOverflow"/> Text="{DynamicResource Welcome_Page5_Title}"
TextWrapping="WrapWithOverflow" />
<TextBlock <TextBlock
Margin="0 10 0 0" Margin="0 10 0 0"
FontSize="14" FontSize="14"
@ -118,5 +119,5 @@
</StackPanel> </StackPanel>
</Grid> </Grid>
</ScrollViewer> </ui:ScrollViewerEx>
</ui:Page> </ui:Page>

View file

@ -2,39 +2,17 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Flow.Launcher.Converters" xmlns:converters="clr-namespace:Flow.Launcher.Converters"
xmlns:core="clr-namespace:Flow.Launcher.Core.Resource;assembly=Flow.Launcher.Core"> xmlns:core="clr-namespace:Flow.Launcher.Core.Resource;assembly=Flow.Launcher.Core"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:wpftk="clr-namespace:WpfToolkit.Controls;assembly=VirtualizingWrapPanel">
<converters:BorderClipConverter x:Key="BorderClipConverter" /> <converters:BorderClipConverter x:Key="BorderClipConverter" />
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" /> <converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
<converters:TextConverter x:Key="TextConverter" /> <converters:TextConverter x:Key="TextConverter" />
<!-- Icon for Theme Type Label --> <!-- Icon for Theme Type Label -->
<Geometry x:Key="circle_half_stroke_solid">F1 M512,512z M0,0z M448,256C448,150,362,64,256,64L256,448C362,448,448,362,448,256z M0,256A256,256,0,1,1,512,256A256,256,0,1,1,0,256z</Geometry> <Geometry x:Key="circle_half_stroke_solid">F1 M512,512z M0,0z M448,256C448,150,362,64,256,64L256,448C362,448,448,362,448,256z M0,256A256,256,0,1,1,512,256A256,256,0,1,1,0,256z</Geometry>
<Style x:Key="StoreItemFocusVisualStyleKey">
<Setter Property="Control.Template"> <!-- Setting Controls -->
<Setter.Value>
<ControlTemplate>
<Rectangle
Margin="0"
Stroke="Black"
StrokeThickness="2" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SwitchFocusVisualStyleKey">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle
Margin="-8 -4 -8 -4"
RadiusX="5"
RadiusY="5"
Stroke="{DynamicResource Color05B}"
StrokeThickness="2" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SettingGrid" TargetType="ItemsControl"> <Style x:Key="SettingGrid" TargetType="ItemsControl">
<Setter Property="Focusable" Value="False" /> <Setter Property="Focusable" Value="False" />
<Setter Property="Margin" Value="0" /> <Setter Property="Margin" Value="0" />
@ -55,10 +33,73 @@
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
<Style x:Key="ThemeList" TargetType="ListBoxItem"> <Style x:Key="SettingGroupBox" TargetType="{x:Type Border}">
<Setter Property="Background" Value="{DynamicResource Color00B}" />
<Setter Property="BorderBrush" Value="{DynamicResource Color03B}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="5" />
<Setter Property="Margin" Value="0 5 0 0" />
<Setter Property="Padding" Value="0 15 0 15" />
<Setter Property="SnapsToDevicePixels" Value="True" />
</Style>
<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}">
<Setter Property="Foreground" Value="{DynamicResource Color04B}" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Margin" Value="0 0 0 0" />
<Setter Property="Padding" Value="0 0 24 0" />
<Setter Property="TextWrapping" Value="WrapWithOverflow" />
</Style>
<Style x:Key="TextPanel" TargetType="{x:Type StackPanel}">
<Setter Property="Grid.Column" Value="1" />
<Setter Property="Margin" Value="0 0 0 0" />
<Setter Property="Width" Value="Auto" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
<Style
x:Key="SideControlCheckBox"
BasedOn="{StaticResource DefaultCheckBoxStyle}"
TargetType="{x:Type CheckBox}">
<Setter Property="Width" Value="24" />
<Setter Property="Grid.Column" Value="2" />
<Setter Property="Margin" Value="0 4 10 4" />
<Setter Property="LayoutTransform">
<Setter.Value>
<ScaleTransform ScaleX="1" ScaleY="1" />
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SideTextAbout" TargetType="{x:Type TextBlock}">
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="Grid.Column" Value="1" />
<Setter Property="Margin" Value="0 0 -18 0" />
</Style>
<!--#region Theme Style-->
<Style
x:Key="ThemeListStyle"
BasedOn="{StaticResource DefaultListBoxStyle}"
TargetType="{x:Type ListBox}">
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="KeyboardNavigation.TabNavigation" Value="None" />
<Setter Property="Padding" Value="0 0 0 0" />
</Style>
<Style
x:Key="ThemeList"
BasedOn="{StaticResource DefaultListBoxItemStyle}"
TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Left" /> <Setter Property="HorizontalContentAlignment" Value="Left" />
<Setter Property="HorizontalAlignment" Value="Left" /> <Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Padding" Value="0" /> <Setter Property="Padding" Value="0" />
<Setter Property="UseLayoutRounding" Value="True" />
<Setter Property="Margin" Value="4" /> <Setter Property="Margin" Value="4" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
@ -96,167 +137,15 @@
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
<Style x:Key="SettingGroupBox" TargetType="{x:Type Border}">
<Setter Property="Background" Value="{DynamicResource Color00B}" />
<Setter Property="BorderBrush" Value="{DynamicResource Color03B}" />
<Setter Property="BorderThickness" Value="1" />
<Setter Property="CornerRadius" Value="5" />
<Setter Property="Margin" Value="0 5 0 0" />
<Setter Property="Padding" Value="0 15 0 15" />
<Setter Property="SnapsToDevicePixels" Value="True" />
</Style>
<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}"> <!--#region Plugin Style-->
<Setter Property="Foreground" Value="{DynamicResource Color04B}" />
<Setter Property="FontSize" Value="12" />
<Setter Property="Margin" Value="0 0 0 0" />
<Setter Property="Padding" Value="0 0 24 0" />
<Setter Property="TextWrapping" Value="WrapWithOverflow" />
</Style>
<Style x:Key="TextPanel" TargetType="{x:Type StackPanel}">
<Setter Property="Grid.Column" Value="1" />
<Setter Property="Margin" Value="0 0 0 0" />
<Setter Property="Width" Value="Auto" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Left" />
</Style>
<Style <Style
x:Key="SideControlCheckBox" x:Key="PluginList"
BasedOn="{StaticResource DefaultCheckBoxStyle}" BasedOn="{StaticResource DefaultListBoxItemStyle}"
TargetType="{x:Type CheckBox}"> TargetType="ListBoxItem">
<Setter Property="Width" Value="24" />
<Setter Property="Grid.Column" Value="2" />
<Setter Property="Margin" Value="0 4 10 4" />
<Setter Property="LayoutTransform">
<Setter.Value>
<ScaleTransform ScaleX="1" ScaleY="1" />
</Setter.Value>
</Setter>
</Style>
<Style x:Key="SideTextAbout" TargetType="{x:Type TextBlock}">
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="Grid.Column" Value="1" />
<Setter Property="Margin" Value="0 0 -18 0" />
</Style>
<Style x:Key="logo" TargetType="{x:Type TabItem}">
<!--#region Logo Style-->
<Setter Property="Margin" Value="0" />
<Setter Property="HorizontalAlignment" Value="center" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="black" />
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Focusable" Value="false" />
<Setter Property="Cursor" Value="Arrow" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<Border>
<Grid>
<Grid>
<Border
x:Name="Spacer"
Width="Auto"
Height="Auto"
Margin="0 10 5 0"
Padding="0 0 0 0"
BorderBrush="Transparent"
BorderThickness="0">
<Border
x:Name="border"
Background="Transparent"
CornerRadius="5">
<ContentPresenter
x:Name="ContentSite"
Margin="12 12 0 12"
HorizontalAlignment="LEFT"
VerticalAlignment="Center"
ContentSource="Header"
TextBlock.Foreground="#000" />
</Border>
</Border>
</Grid>
</Grid>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="Transparent" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="border" Property="Background" Value="transparent" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<!--#endregion-->
</Style>
<Style x:Key="NavTabItem" TargetType="{x:Type TabItem}">
<Setter Property="DockPanel.Dock" Value="Top" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TabItem}">
<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>
<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>
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="Background" Value="{DynamicResource Color06B}" />
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="border" Property="Background" Value="{DynamicResource Color06B}" />
<Setter TargetName="Bullet" Property="Visibility" Value="Visible" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="PluginList" TargetType="ListBoxItem">
<Setter Property="Background" Value="{DynamicResource Color00B}" /> <Setter Property="Background" Value="{DynamicResource Color00B}" />
<Setter Property="Padding" Value="0 0 0 0" /> <Setter Property="Padding" Value="0 0 0 0" />
<Setter Property="UseLayoutRounding" Value="True" /> <Setter Property="UseLayoutRounding" Value="True" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Margin" Value="0 0 18 5" /> <Setter Property="Margin" Value="0 0 18 5" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="BorderBrush" Value="{DynamicResource Color03B}" /> <Setter Property="BorderBrush" Value="{DynamicResource Color03B}" />
@ -288,7 +177,6 @@
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource Color07B}" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource Color07B}" />
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Color03B}" /> <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Color03B}" />
<Setter TargetName="Bd" Property="CornerRadius" Value="5" /> <Setter TargetName="Bd" Property="CornerRadius" Value="5" />
</MultiTrigger> </MultiTrigger>
<MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <MultiTrigger.Conditions>
@ -298,8 +186,6 @@
<Setter TargetName="Bd" Property="Background" Value="{DynamicResource Color00B}" /> <Setter TargetName="Bd" Property="Background" Value="{DynamicResource Color00B}" />
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Color03B}" /> <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Color03B}" />
<Setter TargetName="Bd" Property="Margin" Value="0 0 0 0" /> <Setter TargetName="Bd" Property="Margin" Value="0 0 0 0" />
</MultiTrigger> </MultiTrigger>
<MultiTrigger> <MultiTrigger>
<MultiTrigger.Conditions> <MultiTrigger.Conditions>
@ -310,8 +196,6 @@
<Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Color03B}" /> <Setter TargetName="Bd" Property="BorderBrush" Value="{DynamicResource Color03B}" />
<Setter TargetName="Bd" Property="CornerRadius" Value="5" /> <Setter TargetName="Bd" Property="CornerRadius" Value="5" />
<Setter TargetName="Bd" Property="Margin" Value="0 0 0 0" /> <Setter TargetName="Bd" Property="Margin" Value="0 0 0 0" />
</MultiTrigger> </MultiTrigger>
<Trigger Property="IsEnabled" Value="False"> <Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" /> <Setter TargetName="Bd" Property="TextElement.Foreground" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}" />
@ -323,12 +207,59 @@
<!--#endregion--> <!--#endregion-->
<Setter Property="Height" Value="Auto" /> <Setter Property="Height" Value="Auto" />
</Style> </Style>
<Style
x:Key="PluginListStyle"
BasedOn="{StaticResource DefaultListBoxStyle}"
TargetType="{x:Type ListBox}">
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="Background" Value="{DynamicResource Color01B}" />
<Setter Property="Padding" Value="0 0 0 0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBox">
<ui:ScrollViewerEx
x:Name="ScrollViewer"
AutoHideScrollBars="{TemplateBinding ui:ScrollViewerHelper.AutoHideScrollBars}"
Focusable="false"
HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
KeyboardNavigation.TabNavigation="{TemplateBinding KeyboardNavigation.TabNavigation}"
VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
<ItemsPresenter Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</ui:ScrollViewerEx>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Items.Count}" Value="0">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid Margin="20 0 0 0">
<StackPanel>
<TextBlock
Margin="0 20 0 4"
FontWeight="Bold"
Text="{DynamicResource searchplugin_Noresult_Title}" />
<TextBlock Text="{DynamicResource searchplugin_Noresult_Subtitle}" />
</StackPanel>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
<!--#region PluginStore Style--> <!--#region PluginStore Style-->
<Style x:Key="StoreList" TargetType="ListViewItem"> <Style
x:Key="StoreList"
BasedOn="{StaticResource DefaultListBoxItemStyle}"
TargetType="ListBoxItem">
<Setter Property="Padding" Value="0 0 0 0" /> <Setter Property="Padding" Value="0 0 0 0" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" /> <Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="HorizontalAlignment" Value="Stretch" /> <Setter Property="HorizontalAlignment" Value="Stretch" />
<Setter Property="UseLayoutRounding" Value="True" />
<Setter Property="Margin" Value="0 0 8 8" /> <Setter Property="Margin" Value="0 0 8 8" />
<Setter Property="VerticalContentAlignment" Value="Stretch" /> <Setter Property="VerticalContentAlignment" Value="Stretch" />
<!--#region Template for blue highlight win10--> <!--#region Template for blue highlight win10-->
@ -357,99 +288,49 @@
</Setter> </Setter>
<!--#endregion--> <!--#endregion-->
</Style> </Style>
<Style
x:Key="PluginListStyle"
BasedOn="{StaticResource {x:Type ListBox}}"
TargetType="ListBox">
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Items.Count}" Value="0">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid Margin="20 0 0 0">
<StackPanel>
<TextBlock
Margin="0 20 0 4"
FontWeight="Bold"
Text="{DynamicResource searchplugin_Noresult_Title}" />
<TextBlock Text="{DynamicResource searchplugin_Noresult_Subtitle}" />
</StackPanel>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
<Style <Style
x:Key="StoreListStyle" x:Key="StoreListStyle"
BasedOn="{StaticResource {x:Type ListBox}}" BasedOn="{StaticResource DefaultListBoxStyle}"
TargetType="ListBox"> TargetType="{x:Type ListBox}">
<Setter Property="Background" Value="{DynamicResource Color01B}" />
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Items.Count}" Value="0">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid Margin="20 0 0 0">
<StackPanel>
<TextBlock
Margin="0 20 0 4"
FontWeight="Bold"
Text="{DynamicResource searchplugin_Noresult_Title}" />
<TextBlock Text="{DynamicResource searchplugin_Noresult}" />
</StackPanel>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
<!-- For Tab Header responsive Width -->
<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="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="1" /> <Setter Property="Background" Value="{DynamicResource Color01B}" />
<Setter Property="FontSize" Value="14" /> <Setter Property="Padding" Value="0 0 0 0" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="{x:Type TabControl}"> <ControlTemplate TargetType="ListBox">
<Grid <ui:ScrollViewerEx
x:Name="templateRoot" x:Name="ScrollViewer"
ClipToBounds="true" AutoHideScrollBars="{TemplateBinding ui:ScrollViewerHelper.AutoHideScrollBars}"
SnapsToDevicePixels="true"> Focusable="false"
<Grid.ColumnDefinitions> HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}"
<ColumnDefinition IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}"
x:Name="ColumnDefinition0" KeyboardNavigation.TabNavigation="{TemplateBinding KeyboardNavigation.TabNavigation}"
Width="Auto" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}">
MinWidth="230" /> <ItemsPresenter Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
<ColumnDefinition x:Name="ColumnDefinition1" Width="7.5*" /> </ui:ScrollViewerEx>
</Grid.ColumnDefinitions>
<!-- here is the edit -->
<DockPanel
x:Name="headerPanel"
Grid.Row="0"
Grid.Column="0"
Margin="2 2 2 0"
Panel.ZIndex="1"
Background="Transparent"
IsItemsHost="true"
LastChildFill="False" />
<Border Grid.Column="1">
<ContentPresenter
x:Name="PART_SelectedContentHost"
Grid.Column="1"
ContentSource="SelectedContent" />
</Border>
</Grid>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
<Style.Triggers>
<DataTrigger Binding="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=Items.Count}" Value="0">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid Margin="20 0 0 0">
<StackPanel>
<TextBlock
Margin="0 20 0 4"
FontWeight="Bold"
Foreground="{DynamicResource Color05B}"
Text="{DynamicResource searchplugin_Noresult_Title}" />
<TextBlock Foreground="{DynamicResource Color05B}" Text="{DynamicResource searchplugin_Noresult}" />
</StackPanel>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style> </Style>
</ResourceDictionary> </ResourceDictionary>

View file

@ -25,6 +25,7 @@
SelectionChanged="OnSelectionChanged" SelectionChanged="OnSelectionChanged"
SelectionMode="Single" SelectionMode="Single"
Style="{DynamicResource BaseListboxStyle}" Style="{DynamicResource BaseListboxStyle}"
VirtualizingPanel.ScrollUnit="Item"
VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.VirtualizationMode="Standard" VirtualizingStackPanel.VirtualizationMode="Standard"
Visibility="{Binding Visibility}" Visibility="{Binding Visibility}"

View file

@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher" xmlns:local="clr-namespace:Flow.Launcher"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:vm="clr-namespace:Flow.Launcher.ViewModel" xmlns:vm="clr-namespace:Flow.Launcher.ViewModel"
Title="{DynamicResource defaultBrowserTitle}" Title="{DynamicResource defaultBrowserTitle}"
Width="550" Width="550"

View file

@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher" xmlns:local="clr-namespace:Flow.Launcher"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:vm="clr-namespace:Flow.Launcher.ViewModel" xmlns:vm="clr-namespace:Flow.Launcher.ViewModel"
Title="{DynamicResource fileManagerWindow}" Title="{DynamicResource fileManagerWindow}"
Width="600" Width="600"
@ -75,9 +75,9 @@
<TextBlock Text="{DynamicResource fileManager_tips2}" TextWrapping="WrapWithOverflow" /> <TextBlock Text="{DynamicResource fileManager_tips2}" TextWrapping="WrapWithOverflow" />
</TextBlock> </TextBlock>
<TextBlock Margin="0 14 0 0" VerticalAlignment="Center"> <TextBlock Margin="0 14 0 0" VerticalAlignment="Center">
<Hyperlink NavigateUri="https://www.flowlauncher.com/docs/#/filemanager" RequestNavigate="Hyperlink_RequestNavigate"> <ui:HyperlinkButton NavigateUri="https://www.flowlauncher.com/docs/#/filemanager">
<TextBlock FontSize="14" Text="{DynamicResource fileManager_learnMore}" /> <TextBlock FontSize="14" Text="{DynamicResource fileManager_learnMore}" />
</Hyperlink> </ui:HyperlinkButton>
</TextBlock> </TextBlock>
</StackPanel> </StackPanel>
<Rectangle <Rectangle

View file

@ -31,12 +31,6 @@ namespace Flow.Launcher
} }
} }
private void Hyperlink_RequestNavigate(object sender, RequestNavigateEventArgs e)
{
App.API.OpenUrl(e.Uri.AbsoluteUri);
e.Handled = true;
}
private void btnBrowseFile_Click(object sender, RoutedEventArgs e) private void btnBrowseFile_Click(object sender, RoutedEventArgs e)
{ {
var selectedFilePath = Win32Helper.SelectFile(); var selectedFilePath = Win32Helper.SelectFile();

View file

@ -324,4 +324,10 @@ public partial class SettingsPaneAboutViewModel : BaseModel
var releaseNotesWindow = new ReleaseNotesWindow(); var releaseNotesWindow = new ReleaseNotesWindow();
releaseNotesWindow.Show(); releaseNotesWindow.Show();
} }
[RelayCommand]
private void OpenSponsorPage()
{
App.API.OpenUrl(SponsorPage);
}
} }

View file

@ -8,7 +8,7 @@ using Flow.Launcher.Core.Plugin;
using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin; using Flow.Launcher.Plugin;
using Flow.Launcher.ViewModel; using Flow.Launcher.ViewModel;
using ModernWpf.Controls; using iNKORE.UI.WPF.Modern.Controls;
#nullable enable #nullable enable

View file

@ -14,8 +14,7 @@ using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin; using Flow.Launcher.Plugin;
using Flow.Launcher.Plugin.SharedModels; using Flow.Launcher.Plugin.SharedModels;
using Flow.Launcher.ViewModel; using Flow.Launcher.ViewModel;
using ModernWpf; using iNKORE.UI.WPF.Modern;
using ThemeManagerForColorSchemeSwitch = ModernWpf.ThemeManager;
namespace Flow.Launcher.SettingPages.ViewModels; namespace Flow.Launcher.SettingPages.ViewModels;
@ -41,7 +40,11 @@ public partial class SettingsPaneThemeViewModel : BaseModel
set set
{ {
_selectedTheme = value; _selectedTheme = value;
App.API.SetCurrentTheme(value); if (!App.API.SetCurrentTheme(value))
{
// Revert selection if failed to set theme
OnPropertyChanged();
}
// Update UI state // Update UI state
OnPropertyChanged(nameof(BackdropType)); OnPropertyChanged(nameof(BackdropType));
@ -127,12 +130,12 @@ public partial class SettingsPaneThemeViewModel : BaseModel
get => Settings.ColorScheme; get => Settings.ColorScheme;
set set
{ {
ThemeManagerForColorSchemeSwitch.Current.ApplicationTheme = value switch ThemeManager.Current.ApplicationTheme = value switch
{ {
Constant.Light => ApplicationTheme.Light, Constant.Light => ApplicationTheme.Light,
Constant.Dark => ApplicationTheme.Dark, Constant.Dark => ApplicationTheme.Dark,
Constant.System => null, Constant.System => null,
_ => ThemeManagerForColorSchemeSwitch.Current.ApplicationTheme _ => ThemeManager.Current.ApplicationTheme
}; };
Settings.ColorScheme = value; Settings.ColorScheme = value;
_ = _theme.RefreshFrameAsync(); _ = _theme.RefreshFrameAsync();

View file

@ -4,9 +4,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls" xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:settingsVm="clr-namespace:Flow.Launcher.SettingPages.ViewModels" xmlns:settingsVm="clr-namespace:Flow.Launcher.SettingPages.ViewModels"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
Title="About" Title="About"
d:DataContext="{d:DesignInstance Type=settingsVm:SettingsPaneAboutViewModel}" d:DataContext="{d:DesignInstance Type=settingsVm:SettingsPaneAboutViewModel}"
d:DesignHeight="450" d:DesignHeight="450"
@ -17,9 +18,7 @@
<CollectionViewSource x:Key="SortedFonts" Source="{Binding Source={x:Static Fonts.SystemFontFamilies}}" /> <CollectionViewSource x:Key="SortedFonts" Source="{Binding Source={x:Static Fonts.SystemFontFamilies}}" />
</ResourceDictionary> </ResourceDictionary>
</ui:Page.Resources> </ui:Page.Resources>
<ScrollViewer <ui:ScrollViewerEx
Margin="0"
CanContentScroll="True"
FontSize="14" FontSize="14"
VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.ScrollUnit="Pixel"> VirtualizingStackPanel.ScrollUnit="Pixel">
@ -31,80 +30,80 @@
Text="{DynamicResource about}" Text="{DynamicResource about}"
TextAlignment="left" /> TextAlignment="left" />
<cc:Card <ui:SettingsCard Description="{DynamicResource version}" Header="{Binding Version}">
Title="{Binding Version}" <ui:SettingsCard.HeaderIcon>
Icon="&#xe946;" <ui:FontIcon Glyph="&#xe946;" />
Sub="{DynamicResource version}"> </ui:SettingsCard.HeaderIcon>
<StackPanel Orientation="Horizontal">
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="12">
<Button <Button
Margin="0 0 10 0" x:Name="UpdateAppButton"
Command="{Binding UpdateAppCommand}" Command="{Binding UpdateAppCommand}"
Content="{DynamicResource checkUpdates}" /> Content="{DynamicResource checkUpdates}" />
<Button Padding="0" Style="{StaticResource AccentButtonStyle}">
<Hyperlink
NavigateUri="{Binding SponsorPage}"
RequestNavigate="OnRequestNavigate"
TextDecorations="None">
<TextBlock
Padding="10 5"
Foreground="{StaticResource SystemControlForegroundAltHighBrush}"
Text="{DynamicResource BecomeASponsor}" />
</Hyperlink>
</Button>
</StackPanel>
</cc:Card>
<cc:Card Title="{DynamicResource releaseNotes}" Icon="&#xe8fd;">
<Button Command="{Binding OpenReleaseNotesCommand}" Content="{DynamicResource releaseNotes}" />
</cc:Card>
<cc:Card
Title="{DynamicResource userdatapath}"
Margin="0 14 0 0"
Icon="&#xEC25;;"
Sub="{DynamicResource userdatapathToolTip}">
<StackPanel Orientation="Horizontal">
<Button Command="{Binding OpenParentOfSettingsFolderCommand}" Content="{DynamicResource userdatapathButton}" />
</StackPanel>
</cc:Card>
<cc:Card
Title="{DynamicResource website}"
Margin="0 14 0 0"
Icon="&#xeb41;">
<StackPanel Orientation="Horizontal">
<cc:HyperLink
Margin="0 0 12 0"
Text="{DynamicResource website}"
Uri="{Binding Website}" />
<cc:HyperLink
Margin="0 0 12 0"
Text="{DynamicResource documentation}"
Uri="{Binding Documentation}" />
<cc:HyperLink Text="{DynamicResource github}" Uri="{Binding Github}" />
</StackPanel>
</cc:Card>
<cc:Card Title="{DynamicResource icons}" Icon="&#xE8FE;">
<cc:HyperLink Text="icons8.com" Uri="https://icons8.com/" />
</cc:Card>
<cc:Card
Title="{DynamicResource devtool}"
Margin="0 12 0 0"
Icon="&#xf12b;">
<StackPanel Orientation="Horizontal">
<Button <Button
Margin="0 0 12 0" Height="{Binding ElementName=UpdateAppButton, Path=ActualHeight}"
Command="{Binding OpenSponsorPageCommand}"
Content="{DynamicResource BecomeASponsor}"
Cursor="Hand"
Style="{StaticResource AccentButtonStyle}" />
</ikw:SimpleStackPanel>
</ui:SettingsCard>
<ui:SettingsCard Margin="0 4 0 0" Header="{DynamicResource releaseNotes}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xe8fd;" />
</ui:SettingsCard.HeaderIcon>
<Button Command="{Binding OpenReleaseNotesCommand}" Content="{DynamicResource releaseNotes}" />
</ui:SettingsCard>
<ui:SettingsCard
Margin="0 14 0 0"
Description="{DynamicResource userdatapathToolTip}"
Header="{DynamicResource userdatapath}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xEC25;" />
</ui:SettingsCard.HeaderIcon>
<Button Command="{Binding OpenParentOfSettingsFolderCommand}" Content="{DynamicResource userdatapathButton}" />
</ui:SettingsCard>
<ui:SettingsCard Margin="0 14 0 0" Header="{DynamicResource website}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xeb41;" />
</ui:SettingsCard.HeaderIcon>
<StackPanel Orientation="Horizontal">
<ui:HyperlinkButton Content="{DynamicResource website}" NavigateUri="{Binding Website}" />
<ui:HyperlinkButton Content="{DynamicResource documentation}" NavigateUri="{Binding Documentation}" />
<ui:HyperlinkButton Content="{DynamicResource github}" NavigateUri="{Binding Github}" />
</StackPanel>
</ui:SettingsCard>
<ui:SettingsCard Margin="0 4 0 0" Header="{DynamicResource icons}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xE8FE;" />
</ui:SettingsCard.HeaderIcon>
<ui:HyperlinkButton Content="icons8.com" NavigateUri="https://icons8.com/" />
</ui:SettingsCard>
<ui:SettingsCard Margin="0 14 0 0" Header="{DynamicResource devtool}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xf12b;" />
</ui:SettingsCard.HeaderIcon>
<ikw:SimpleStackPanel Orientation="Horizontal" Spacing="12">
<Button
x:Name="AskClearCacheFolderConfirmationButton"
Command="{Binding AskClearCacheFolderConfirmationCommand}" Command="{Binding AskClearCacheFolderConfirmationCommand}"
Content="{Binding CacheFolderSize, Mode=OneWay}" /> Content="{Binding CacheFolderSize, Mode=OneWay}" />
<Button <Button
Margin="0 0 12 0" Height="{Binding ElementName=AskClearCacheFolderConfirmationButton, Path=ActualHeight}"
Command="{Binding AskClearLogFolderConfirmationCommand}" Command="{Binding AskClearLogFolderConfirmationCommand}"
Content="{Binding LogFolderSize, Mode=OneWay}" /> Content="{Binding LogFolderSize, Mode=OneWay}" />
<Button> <Button Height="{Binding ElementName=AskClearCacheFolderConfirmationButton, Path=ActualHeight}">
<ui:FontIcon FontSize="20" Glyph="&#xec7a;" /> <ui:FontIcon FontSize="16" Glyph="&#xec7a;" />
<ui:FlyoutService.Flyout> <ui:FlyoutService.Flyout>
<ui:MenuFlyout> <ui:MenuFlyout>
<MenuItem Command="{Binding OpenWelcomeWindowCommand}" Header="{DynamicResource welcomewindow}"> <MenuItem Command="{Binding OpenWelcomeWindowCommand}" Header="{DynamicResource welcomewindow}">
@ -133,28 +132,31 @@
</ui:MenuFlyout> </ui:MenuFlyout>
</ui:FlyoutService.Flyout> </ui:FlyoutService.Flyout>
</Button> </Button>
</StackPanel> </ikw:SimpleStackPanel>
</cc:Card> </ui:SettingsCard>
<ui:SettingsExpander Margin="0 4 0 0" Header="{DynamicResource advanced}">
<ui:SettingsExpander.HeaderIcon>
<ui:FontIcon Glyph="&#xE8B7;" />
</ui:SettingsExpander.HeaderIcon>
<ui:SettingsExpander.Items>
<ui:SettingsCard Header="{DynamicResource logLevel}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xE749;" />
</ui:SettingsCard.HeaderIcon>
<cc:ExCard
Title="{DynamicResource advanced}"
Margin="0 14 0 0"
Icon="&#xE8B7;">
<StackPanel>
<cc:Card
Title="{DynamicResource logLevel}"
Icon="&#xE749;"
Type="Inside">
<ComboBox <ComboBox
DisplayMemberPath="Display" DisplayMemberPath="Display"
ItemsSource="{Binding LogLevels}" ItemsSource="{Binding LogLevels}"
SelectedValue="{Binding LogLevel}" SelectedValue="{Binding LogLevel}"
SelectedValuePath="Value" /> SelectedValuePath="Value" />
</cc:Card> </ui:SettingsCard>
<cc:Card <ui:SettingsCard Header="{DynamicResource settingWindowFontTitle}">
Title="{DynamicResource settingWindowFontTitle}" <ui:SettingsCard.HeaderIcon>
Icon="&#xf259;" <ui:FontIcon Glyph="&#xf259;" />
Type="Inside"> </ui:SettingsCard.HeaderIcon>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<Button Command="{Binding ResetSettingWindowFontCommand}" Content="{DynamicResource commonReset}" /> <Button Command="{Binding ResetSettingWindowFontCommand}" Content="{DynamicResource commonReset}" />
<ComboBox <ComboBox
@ -166,9 +168,9 @@
SelectedValue="{Binding SettingWindowFont, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" SelectedValue="{Binding SettingWindowFont, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
SelectedValuePath="Source" /> SelectedValuePath="Source" />
</StackPanel> </StackPanel>
</cc:Card> </ui:SettingsCard>
</StackPanel> </ui:SettingsExpander.Items>
</cc:ExCard> </ui:SettingsExpander>
<TextBlock <TextBlock
Margin="14 20 0 0" Margin="14 20 0 0"
@ -180,5 +182,5 @@
Text="{Binding ActivatedTimes}" Text="{Binding ActivatedTimes}"
TextWrapping="WrapWithOverflow" /> TextWrapping="WrapWithOverflow" />
</StackPanel> </StackPanel>
</ScrollViewer> </ui:ScrollViewerEx>
</ui:Page> </ui:Page>

View file

@ -28,10 +28,4 @@ public partial class SettingsPaneAbout
} }
base.OnNavigatedTo(e); base.OnNavigatedTo(e);
} }
private void OnRequestNavigate(object sender, RequestNavigateEventArgs e)
{
App.API.OpenUrl(e.Uri.AbsoluteUri);
e.Handled = true;
}
} }

View file

@ -6,9 +6,10 @@
xmlns:converters="clr-namespace:Flow.Launcher.Converters" xmlns:converters="clr-namespace:Flow.Launcher.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ext="clr-namespace:Flow.Launcher.Resources.MarkupExtensions" xmlns:ext="clr-namespace:Flow.Launcher.Resources.MarkupExtensions"
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:settingsViewModels="clr-namespace:Flow.Launcher.SettingPages.ViewModels" xmlns:settingsViewModels="clr-namespace:Flow.Launcher.SettingPages.ViewModels"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure" xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure"
Title="General" Title="General"
d:DataContext="{d:DesignInstance settingsViewModels:SettingsPaneGeneralViewModel}" d:DataContext="{d:DesignInstance settingsViewModels:SettingsPaneGeneralViewModel}"
@ -18,9 +19,7 @@
<ui:Page.Resources> <ui:Page.Resources>
<converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" /> <converters:BoolToVisibilityConverter x:Key="BoolToVisibilityConverter" />
</ui:Page.Resources> </ui:Page.Resources>
<ScrollViewer <ui:ScrollViewerEx
Margin="0"
CanContentScroll="False"
FontSize="14" FontSize="14"
VirtualizingPanel.ScrollUnit="Pixel" VirtualizingPanel.ScrollUnit="Pixel"
VirtualizingStackPanel.IsVirtualizing="True"> VirtualizingStackPanel.IsVirtualizing="True">
@ -33,272 +32,293 @@
Text="{DynamicResource general}" Text="{DynamicResource general}"
TextAlignment="left" /> TextAlignment="left" />
<cc:ExCard <ui:SettingsExpander Margin="0 8 0 0" Header="{DynamicResource startFlowLauncherOnSystemStartup}">
Title="{DynamicResource startFlowLauncherOnSystemStartup}" <ui:SettingsExpander.HeaderIcon>
Margin="0 8 0 0" <ui:FontIcon Glyph="&#xe8fc;" />
Icon="&#xe8fc;"> </ui:SettingsExpander.HeaderIcon>
<cc:ExCard.SideContent> <ui:ToggleSwitch
<ui:ToggleSwitch IsOn="{Binding StartFlowLauncherOnSystemStartup}"
IsOn="{Binding StartFlowLauncherOnSystemStartup}" OffContent="{DynamicResource disable}"
OffContent="{DynamicResource disable}" OnContent="{DynamicResource enable}" />
OnContent="{DynamicResource enable}" />
</cc:ExCard.SideContent> <ui:SettingsExpander.Items>
<cc:Card <ui:SettingsCard Description="{DynamicResource useLogonTaskForStartupTooltip}" Header="{DynamicResource useLogonTaskForStartup}">
Title="{DynamicResource useLogonTaskForStartup}" <ui:ToggleSwitch
Sub="{DynamicResource useLogonTaskForStartupTooltip}" IsOn="{Binding UseLogonTaskForStartup}"
Type="InsideFit"> OffContent="{DynamicResource disable}"
<ui:ToggleSwitch OnContent="{DynamicResource enable}" />
IsOn="{Binding UseLogonTaskForStartup}" </ui:SettingsCard>
OffContent="{DynamicResource disable}" </ui:SettingsExpander.Items>
OnContent="{DynamicResource enable}" />
</cc:Card> </ui:SettingsExpander>
</cc:ExCard> <ui:SettingsCard
<cc:Card Margin="0 4 0 0"
Title="{DynamicResource hideOnStartup}" Description="{DynamicResource hideOnStartupToolTip}"
Icon="&#xed1a;" Header="{DynamicResource hideOnStartup}">
Sub="{DynamicResource hideOnStartupToolTip}"> <ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xed1a;" />
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch <ui:ToggleSwitch
IsOn="{Binding Settings.HideOnStartup}" IsOn="{Binding Settings.HideOnStartup}"
OffContent="{DynamicResource disable}" OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" /> OnContent="{DynamicResource enable}" />
</cc:Card> </ui:SettingsCard>
<cc:Card Title="{DynamicResource hideFlowLauncherWhenLoseFocus}" Margin="0 14 0 0"> <ui:SettingsCard Margin="0 12 0 0" Header="{DynamicResource hideFlowLauncherWhenLoseFocus}">
<ui:ToggleSwitch <ui:ToggleSwitch
IsOn="{Binding Settings.HideWhenDeactivated}" IsOn="{Binding Settings.HideWhenDeactivated}"
OffContent="{DynamicResource disable}" OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" /> OnContent="{DynamicResource enable}" />
</cc:Card> </ui:SettingsCard>
<ui:SettingsCard
<cc:Card Title="{DynamicResource hideNotifyIcon}" Sub="{DynamicResource hideNotifyIconToolTip}"> Margin="0 4 0 0"
Description="{DynamicResource hideNotifyIconToolTip}"
Header="{DynamicResource hideNotifyIcon}">
<ui:ToggleSwitch <ui:ToggleSwitch
IsOn="{Binding Settings.HideNotifyIcon}" IsOn="{Binding Settings.HideNotifyIcon}"
OffContent="{DynamicResource disable}" OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" /> OnContent="{DynamicResource enable}" />
</cc:Card> </ui:SettingsCard>
<ui:SettingsCard
<cc:Card
Title="{DynamicResource showAtTopmost}"
Margin="0 14 0 0" Margin="0 14 0 0"
Icon="&#xf5ed;" Description="{DynamicResource showAtTopmostToolTip}"
Sub="{DynamicResource showAtTopmostToolTip}"> Header="{DynamicResource showAtTopmost}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xf5ed;" />
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch <ui:ToggleSwitch
IsOn="{Binding Settings.ShowAtTopmost}" IsOn="{Binding Settings.ShowAtTopmost}"
OffContent="{DynamicResource disable}" OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" /> OnContent="{DynamicResource enable}" />
</cc:Card> </ui:SettingsCard>
<cc:CardGroup Margin="0 4 0 0"> <ui:SettingsCard Margin="0 4 0 0" Header="{DynamicResource SearchWindowPosition}">
<cc:Card <ui:SettingsCard.HeaderIcon>
Title="{DynamicResource SearchWindowPosition}" <ui:FontIcon Glyph="&#xe7f4;" />
Icon="&#xe7f4;" </ui:SettingsCard.HeaderIcon>
Type="First"> <StackPanel Orientation="Horizontal">
<StackPanel Orientation="Horizontal"> <ComboBox
<ComboBox MinWidth="220"
MinWidth="220" VerticalAlignment="Center"
DisplayMemberPath="Display"
FontSize="14"
ItemsSource="{Binding SearchWindowScreens}"
SelectedValue="{Binding Settings.SearchWindowScreen}"
SelectedValuePath="Value" />
<ComboBox
MinWidth="160"
Margin="18 0 0 0"
VerticalAlignment="Center"
FontSize="14"
ItemsSource="{Binding ScreenNumbers}"
SelectedValue="{Binding Settings.CustomScreenNumber}"
Visibility="{ext:VisibleWhen {Binding Settings.SearchWindowScreen},
IsEqualTo={x:Static userSettings:SearchWindowScreens.Custom}}" />
</StackPanel>
</ui:SettingsCard>
<ui:SettingsCard
Margin="0 4 0 0"
Header="{DynamicResource SearchWindowAlign}"
Visibility="{ext:CollapsedWhen {Binding Settings.SearchWindowScreen},
IsEqualTo={x:Static userSettings:SearchWindowScreens.RememberLastLaunchLocation}}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xe7f4;" />
</ui:SettingsCard.HeaderIcon>
<StackPanel Orientation="Horizontal">
<ComboBox
MinWidth="160"
VerticalAlignment="Center"
DisplayMemberPath="Display"
FontSize="14"
ItemsSource="{Binding SearchWindowAligns}"
SelectedValue="{Binding Settings.SearchWindowAlign}"
SelectedValuePath="Value" />
<StackPanel
Margin="18 0 0 0"
VerticalAlignment="Center"
Orientation="Horizontal"
Visibility="{ext:VisibleWhen {Binding Settings.SearchWindowAlign},
IsEqualTo={x:Static userSettings:SearchWindowAligns.Custom}}">
<TextBox
MinWidth="80"
VerticalAlignment="Center" VerticalAlignment="Center"
DisplayMemberPath="Display" Text="{Binding Settings.CustomWindowLeft}" />
FontSize="14" <TextBlock
ItemsSource="{Binding SearchWindowScreens}" Margin="10"
SelectedValue="{Binding Settings.SearchWindowScreen}"
SelectedValuePath="Value" />
<ComboBox
MinWidth="160"
Margin="18 0 0 0"
VerticalAlignment="Center" VerticalAlignment="Center"
FontSize="14" Text="x" />
ItemsSource="{Binding ScreenNumbers}" <TextBox
SelectedValue="{Binding Settings.CustomScreenNumber}" MinWidth="80"
Visibility="{ext:VisibleWhen {Binding Settings.SearchWindowScreen}, VerticalAlignment="Center"
IsEqualTo={x:Static userSettings:SearchWindowScreens.Custom}}" /> Text="{Binding Settings.CustomWindowTop}"
TextWrapping="NoWrap" />
</StackPanel> </StackPanel>
</cc:Card> </StackPanel>
</ui:SettingsCard>
<cc:Card <ui:SettingsCard
Title="{DynamicResource SearchWindowAlign}"
Icon="&#xe7f4;"
Type="Last"
Visibility="{ext:CollapsedWhen {Binding Settings.SearchWindowScreen},
IsEqualTo={x:Static userSettings:SearchWindowScreens.RememberLastLaunchLocation}}">
<StackPanel Orientation="Horizontal">
<ComboBox
MinWidth="160"
VerticalAlignment="Center"
DisplayMemberPath="Display"
FontSize="14"
ItemsSource="{Binding SearchWindowAligns}"
SelectedValue="{Binding Settings.SearchWindowAlign}"
SelectedValuePath="Value" />
<StackPanel
Margin="18 0 0 0"
VerticalAlignment="Center"
Orientation="Horizontal"
Visibility="{ext:VisibleWhen {Binding Settings.SearchWindowAlign},
IsEqualTo={x:Static userSettings:SearchWindowAligns.Custom}}">
<TextBox
MinWidth="80"
VerticalAlignment="Center"
Text="{Binding Settings.CustomWindowLeft}" />
<TextBlock
Margin="10"
VerticalAlignment="Center"
Text="x" />
<TextBox
MinWidth="80"
VerticalAlignment="Center"
Text="{Binding Settings.CustomWindowTop}"
TextWrapping="NoWrap" />
</StackPanel>
</StackPanel>
</cc:Card>
</cc:CardGroup>
<cc:Card
Title="{DynamicResource ignoreHotkeysOnFullscreen}"
Margin="0 14 0 0" Margin="0 14 0 0"
Icon="&#xe7fc;" Description="{DynamicResource ignoreHotkeysOnFullscreenToolTip}"
Sub="{DynamicResource ignoreHotkeysOnFullscreenToolTip}"> Header="{DynamicResource ignoreHotkeysOnFullscreen}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xe7fc;" />
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch <ui:ToggleSwitch
IsOn="{Binding Settings.IgnoreHotkeysOnFullscreen}" IsOn="{Binding Settings.IgnoreHotkeysOnFullscreen}"
OffContent="{DynamicResource disable}" OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" /> OnContent="{DynamicResource enable}" />
</cc:Card> </ui:SettingsCard>
<cc:Card <ui:SettingsCard
Title="{DynamicResource AlwaysPreview}"
Margin="0 14 0 0" Margin="0 14 0 0"
Icon="&#xe8a1;" Description="{Binding AlwaysPreviewToolTip}"
Sub="{Binding AlwaysPreviewToolTip}"> Header="{DynamicResource AlwaysPreview}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xe8a1;" />
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch <ui:ToggleSwitch
IsOn="{Binding Settings.AlwaysPreview}" IsOn="{Binding Settings.AlwaysPreview}"
OffContent="{DynamicResource disable}" OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" OnContent="{DynamicResource enable}"
ToolTip="{Binding AlwaysPreviewToolTip}" /> ToolTip="{Binding AlwaysPreviewToolTip}" />
</cc:Card> </ui:SettingsCard>
<cc:Card <ui:SettingsCard
Title="{DynamicResource autoUpdates}"
Margin="0 14 0 0" Margin="0 14 0 0"
Icon="&#xecc5;" Description="{DynamicResource autoUpdatesTooltip}"
Sub="{DynamicResource autoUpdatesTooltip}"> Header="{DynamicResource autoUpdates}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xecc5;" />
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch <ui:ToggleSwitch
IsOn="{Binding AutoUpdates}" IsOn="{Binding AutoUpdates}"
OffContent="{DynamicResource disable}" OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" /> OnContent="{DynamicResource enable}" />
</cc:Card> </ui:SettingsCard>
<ui:SettingsCard
Margin="0 4 0 0"
Description="{DynamicResource portableModeToolTIp}"
Header="{DynamicResource portableMode}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xe88e;" />
</ui:SettingsCard.HeaderIcon>
<cc:Card
Title="{DynamicResource portableMode}"
Icon="&#xe88e;"
Sub="{DynamicResource portableModeToolTIp}">
<ui:ToggleSwitch <ui:ToggleSwitch
IsOn="{Binding PortableMode}" IsOn="{Binding PortableMode}"
OffContent="{DynamicResource disable}" OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" /> OnContent="{DynamicResource enable}" />
</cc:Card> </ui:SettingsCard>
<cc:CardGroup Margin="0 14 0 0"> <ui:SettingsCard
<cc:Card
Title="{DynamicResource querySearchPrecision}"
Sub="{DynamicResource querySearchPrecisionToolTip}"
Type="First">
<ComboBox
MaxWidth="200"
DisplayMemberPath="Display"
ItemsSource="{Binding SearchPrecisionScores}"
SelectedValue="{Binding Settings.QuerySearchPrecision}"
SelectedValuePath="Value" />
</cc:Card>
<cc:Card
Title="{DynamicResource lastQueryMode}"
Sub="{DynamicResource lastQueryModeToolTip}"
Type="Last">
<ComboBox
MinWidth="210"
DisplayMemberPath="Display"
ItemsSource="{Binding LastQueryModes}"
SelectedValue="{Binding Settings.LastQueryMode}"
SelectedValuePath="Value" />
</cc:Card>
</cc:CardGroup>
<cc:CardGroup Margin="0 14 0 0">
<cc:Card
Title="{DynamicResource autoRestartAfterChanging}"
Icon="&#xF83E;"
Sub="{DynamicResource autoRestartAfterChangingToolTip}"
Type="First">
<ui:ToggleSwitch
IsOn="{Binding Settings.AutoRestartAfterChanging}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</cc:Card>
<cc:Card
Title="{DynamicResource showUnknownSourceWarning}"
Icon="&#xE7BA;"
Sub="{DynamicResource showUnknownSourceWarningToolTip}"
Type="Middle">
<ui:ToggleSwitch
IsOn="{Binding Settings.ShowUnknownSourceWarning}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</cc:Card>
<cc:Card
Title="{DynamicResource autoUpdatePlugins}"
Icon="&#xecc5;"
Sub="{DynamicResource autoUpdatePluginsToolTip}"
Type="Last">
<ui:ToggleSwitch
IsOn="{Binding Settings.AutoUpdatePlugins}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</cc:Card>
</cc:CardGroup>
<cc:ExCard
Title="{DynamicResource dialogJump}"
Margin="0 14 0 0" Margin="0 14 0 0"
Icon="&#xE8AB;" Description="{DynamicResource querySearchPrecisionToolTip}"
Sub="{DynamicResource dialogJumpToolTip}"> Header="{DynamicResource querySearchPrecision}">
<cc:ExCard.SideContent>
<ui:ToggleSwitch
IsOn="{Binding EnableDialogJump}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</cc:ExCard.SideContent>
<StackPanel> <ComboBox
<cc:Card MaxWidth="200"
Title="{DynamicResource autoDialogJump}" DisplayMemberPath="Display"
Sub="{DynamicResource autoDialogJumpToolTip}" ItemsSource="{Binding SearchPrecisionScores}"
Type="InsideFit" SelectedValue="{Binding Settings.QuerySearchPrecision}"
SelectedValuePath="Value" />
</ui:SettingsCard>
<ui:SettingsCard
Margin="0 4 0 0"
Description="{DynamicResource lastQueryModeToolTip}"
Header="{DynamicResource lastQueryMode}">
<ComboBox
MinWidth="210"
DisplayMemberPath="Display"
ItemsSource="{Binding LastQueryModes}"
SelectedValue="{Binding Settings.LastQueryMode}"
SelectedValuePath="Value" />
</ui:SettingsCard>
<ui:SettingsCard
Margin="0 14 0 0"
Description="{DynamicResource autoRestartAfterChangingToolTip}"
Header="{DynamicResource autoRestartAfterChanging}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xF83E;" />
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch
IsOn="{Binding Settings.AutoRestartAfterChanging}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</ui:SettingsCard>
<ui:SettingsCard
Margin="0 4 0 0"
Description="{DynamicResource showUnknownSourceWarningToolTip}"
Header="{DynamicResource showUnknownSourceWarning}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xE7BA;" />
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch
IsOn="{Binding Settings.ShowUnknownSourceWarning}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</ui:SettingsCard>
<ui:SettingsCard
Margin="0 4 0 0"
Description="{DynamicResource autoUpdatePluginsToolTip}"
Header="{DynamicResource autoUpdatePlugins}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xecc5;" />
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch
IsOn="{Binding Settings.AutoUpdatePlugins}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</ui:SettingsCard>
<ui:SettingsExpander
Margin="0 14 0 0"
Description="{DynamicResource dialogJumpToolTip}"
Header="{DynamicResource dialogJump}">
<ui:SettingsExpander.HeaderIcon>
<ui:FontIcon Glyph="&#xE8AB;" />
</ui:SettingsExpander.HeaderIcon>
<ui:ToggleSwitch
IsOn="{Binding EnableDialogJump}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
<ui:SettingsExpander.Items>
<ui:SettingsCard
Description="{DynamicResource autoDialogJumpToolTip}"
Header="{DynamicResource autoDialogJump}"
Visibility="Collapsed"> Visibility="Collapsed">
<ui:ToggleSwitch <ui:ToggleSwitch
IsOn="{Binding Settings.AutoDialogJump}" IsOn="{Binding Settings.AutoDialogJump}"
OffContent="{DynamicResource disable}" OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" /> OnContent="{DynamicResource enable}" />
</cc:Card> </ui:SettingsCard>
<cc:Card <ui:SettingsCard Description="{DynamicResource showDialogJumpWindowToolTip}" Header="{DynamicResource showDialogJumpWindow}">
Title="{DynamicResource showDialogJumpWindow}"
Sub="{DynamicResource showDialogJumpWindowToolTip}"
Type="InsideFit">
<ui:ToggleSwitch <ui:ToggleSwitch
IsOn="{Binding Settings.ShowDialogJumpWindow}" IsOn="{Binding Settings.ShowDialogJumpWindow}"
OffContent="{DynamicResource disable}" OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" /> OnContent="{DynamicResource enable}" />
</cc:Card> </ui:SettingsCard>
<cc:Card <ui:SettingsCard Description="{DynamicResource dialogJumpWindowPositionToolTip}" Header="{DynamicResource dialogJumpWindowPosition}">
Title="{DynamicResource dialogJumpWindowPosition}"
Sub="{DynamicResource dialogJumpWindowPositionToolTip}"
Type="InsideFit">
<ComboBox <ComboBox
MinWidth="120" MinWidth="120"
MaxWidth="210" MaxWidth="210"
@ -306,24 +326,18 @@
ItemsSource="{Binding DialogJumpWindowPositions}" ItemsSource="{Binding DialogJumpWindowPositions}"
SelectedValue="{Binding Settings.DialogJumpWindowPosition}" SelectedValue="{Binding Settings.DialogJumpWindowPosition}"
SelectedValuePath="Value" /> SelectedValuePath="Value" />
</cc:Card> </ui:SettingsCard>
<cc:Card <ui:SettingsCard Description="{DynamicResource dialogJumpResultBehaviourToolTip}" Header="{DynamicResource dialogJumpResultBehaviour}">
Title="{DynamicResource dialogJumpResultBehaviour}"
Sub="{DynamicResource dialogJumpResultBehaviourToolTip}"
Type="InsideFit">
<ComboBox <ComboBox
MinWidth="120" MinWidth="120"
DisplayMemberPath="Display" DisplayMemberPath="Display"
ItemsSource="{Binding DialogJumpResultBehaviours}" ItemsSource="{Binding DialogJumpResultBehaviours}"
SelectedValue="{Binding Settings.DialogJumpResultBehaviour}" SelectedValue="{Binding Settings.DialogJumpResultBehaviour}"
SelectedValuePath="Value" /> SelectedValuePath="Value" />
</cc:Card> </ui:SettingsCard>
<cc:Card <ui:SettingsCard Description="{DynamicResource dialogJumpFileResultBehaviourToolTip}" Header="{DynamicResource dialogJumpFileResultBehaviour}">
Title="{DynamicResource dialogJumpFileResultBehaviour}"
Sub="{DynamicResource dialogJumpFileResultBehaviourToolTip}"
Type="InsideFit">
<ComboBox <ComboBox
MinWidth="120" MinWidth="120"
MaxWidth="240" MaxWidth="240"
@ -331,94 +345,112 @@
ItemsSource="{Binding DialogJumpFileResultBehaviours}" ItemsSource="{Binding DialogJumpFileResultBehaviours}"
SelectedValue="{Binding Settings.DialogJumpFileResultBehaviour}" SelectedValue="{Binding Settings.DialogJumpFileResultBehaviour}"
SelectedValuePath="Value" /> SelectedValuePath="Value" />
</cc:Card> </ui:SettingsCard>
</StackPanel> </ui:SettingsExpander.Items>
</cc:ExCard> </ui:SettingsExpander>
<cc:ExCard <ui:SettingsExpander
Title="{DynamicResource searchDelay}"
Margin="0 14 0 0" Margin="0 14 0 0"
Icon="&#xE961;" Description="{DynamicResource searchDelayToolTip}"
Sub="{DynamicResource searchDelayToolTip}"> Header="{DynamicResource searchDelay}">
<cc:ExCard.SideContent> <ui:SettingsExpander.HeaderIcon>
<ui:ToggleSwitch <ui:FontIcon Glyph="&#xE961;" />
IsOn="{Binding Settings.SearchQueryResultsWithDelay}" </ui:SettingsExpander.HeaderIcon>
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</cc:ExCard.SideContent>
<cc:Card
Title="{DynamicResource searchDelayTime}"
Sub="{DynamicResource searchDelayTimeToolTip}"
Type="InsideFit">
<ui:NumberBox
Width="120"
Margin="0 0 0 0"
Maximum="1000"
Minimum="0"
SmallChange="10"
SpinButtonPlacementMode="Compact"
ValidationMode="InvalidInputOverwritten"
Value="{Binding SearchDelayTimeValue}" />
</cc:Card>
</cc:ExCard>
<cc:Card <ui:ToggleSwitch
Title="{DynamicResource homePage}" IsOn="{Binding Settings.SearchQueryResultsWithDelay}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
<ui:SettingsExpander.Items>
<ui:SettingsCard Description="{DynamicResource searchDelayTimeToolTip}" Header="{DynamicResource searchDelayTime}">
<ui:NumberBox
Width="120"
MinWidth="120"
Margin="0 0 0 0"
Maximum="1000"
Minimum="0"
SmallChange="10"
SpinButtonPlacementMode="Compact"
ValidationMode="InvalidInputOverwritten"
Value="{Binding SearchDelayTimeValue}" />
</ui:SettingsCard>
</ui:SettingsExpander.Items>
</ui:SettingsExpander>
<ui:SettingsCard
Margin="0 14 0 0" Margin="0 14 0 0"
Icon="&#xE80F;" Description="{DynamicResource homePageToolTip}"
Sub="{DynamicResource homePageToolTip}"> Header="{DynamicResource homePage}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xE80F;" />
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch <ui:ToggleSwitch
IsOn="{Binding Settings.ShowHomePage}" IsOn="{Binding Settings.ShowHomePage}"
OffContent="{DynamicResource disable}" OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" /> OnContent="{DynamicResource enable}" />
</cc:Card> </ui:SettingsCard>
<cc:ExCard Title="{DynamicResource historyResultsForHomePage}" Icon="&#xE81C;"> <ui:SettingsExpander Margin="0 4 0 0" Header="{DynamicResource historyResultsForHomePage}">
<cc:ExCard.SideContent> <ui:SettingsExpander.HeaderIcon>
<ui:ToggleSwitch <ui:FontIcon Glyph="&#xE81C;" />
IsOn="{Binding Settings.ShowHistoryResultsForHomePage}" </ui:SettingsExpander.HeaderIcon>
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</cc:ExCard.SideContent>
<cc:Card Title="{DynamicResource historyResultsCountForHomePage}" Type="InsideFit">
<ui:NumberBox
Width="120"
Margin="0 0 0 0"
Maximum="100"
Minimum="0"
SmallChange="5"
SpinButtonPlacementMode="Compact"
ValidationMode="InvalidInputOverwritten"
Value="{Binding MaxHistoryResultsToShowValue}" />
</cc:Card>
</cc:ExCard>
<cc:Card <ui:ToggleSwitch
Title="{DynamicResource defaultFileManager}" IsOn="{Binding Settings.ShowHistoryResultsForHomePage}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
<ui:SettingsExpander.Items>
<ui:SettingsCard Header="{DynamicResource historyResultsCountForHomePage}">
<ui:NumberBox
Width="120"
MinWidth="120"
Margin="0 0 0 0"
Maximum="100"
Minimum="0"
SmallChange="5"
SpinButtonPlacementMode="Compact"
ValidationMode="InvalidInputOverwritten"
Value="{Binding MaxHistoryResultsToShowValue}" />
</ui:SettingsCard>
</ui:SettingsExpander.Items>
</ui:SettingsExpander>
<ui:SettingsCard
Margin="0 14 0 0" Margin="0 14 0 0"
Icon="&#xe838;" Description="{DynamicResource defaultFileManagerToolTip}"
Sub="{DynamicResource defaultFileManagerToolTip}"> Header="{DynamicResource defaultFileManager}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xe838;" />
</ui:SettingsCard.HeaderIcon>
<Button <Button
Width="160" Width="160"
MaxWidth="250" MaxWidth="250"
Margin="10 0 0 0" Margin="10 0 0 0"
Command="{Binding SelectFileManagerCommand}" Command="{Binding SelectFileManagerCommand}"
Content="{Binding Settings.CustomExplorer.DisplayName}" /> Content="{Binding Settings.CustomExplorer.DisplayName}" />
</cc:Card> </ui:SettingsCard>
<ui:SettingsCard
Margin="0 4 0 0"
Description="{DynamicResource defaultBrowserToolTip}"
Header="{DynamicResource defaultBrowser}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xf6fa;" />
</ui:SettingsCard.HeaderIcon>
<cc:Card
Title="{DynamicResource defaultBrowser}"
Icon="&#xf6fa;"
Sub="{DynamicResource defaultBrowserToolTip}">
<Button <Button
Width="160" Width="160"
MaxWidth="250" MaxWidth="250"
Margin="10 0 0 0" Margin="10 0 0 0"
Command="{Binding SelectBrowserCommand}" Command="{Binding SelectBrowserCommand}"
Content="{Binding Settings.CustomBrowser.DisplayName}" /> Content="{Binding Settings.CustomBrowser.DisplayName}" />
</cc:Card> </ui:SettingsCard>
<cc:Card Title="{DynamicResource pythonFilePath}" Margin="0 14 0 0"> <ui:SettingsCard Margin="0 14 0 0" Header="{DynamicResource pythonFilePath}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBox <TextBox
Width="300" Width="300"
@ -430,9 +462,9 @@
Command="{Binding SelectPythonCommand}" Command="{Binding SelectPythonCommand}"
Content="{DynamicResource select}" /> Content="{DynamicResource select}" />
</StackPanel> </StackPanel>
</cc:Card> </ui:SettingsCard>
<cc:Card Title="{DynamicResource nodeFilePath}"> <ui:SettingsCard Margin="0 4 0 0" Header="{DynamicResource nodeFilePath}">
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<TextBox <TextBox
Width="300" Width="300"
@ -444,57 +476,69 @@
Command="{Binding SelectNodeCommand}" Command="{Binding SelectNodeCommand}"
Content="{DynamicResource select}" /> Content="{DynamicResource select}" />
</StackPanel> </StackPanel>
</cc:Card> </ui:SettingsCard>
<cc:Card <ui:SettingsCard
Title="{DynamicResource typingStartEn}"
Margin="0 14 0 0" Margin="0 14 0 0"
Icon="&#xe8d3;" Description="{DynamicResource typingStartEnTooltip}"
Sub="{DynamicResource typingStartEnTooltip}"> Header="{DynamicResource typingStartEn}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xe8d3;" />
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch <ui:ToggleSwitch
IsOn="{Binding Settings.AlwaysStartEn}" IsOn="{Binding Settings.AlwaysStartEn}"
OffContent="{DynamicResource disable}" OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" /> OnContent="{DynamicResource enable}" />
</cc:Card> </ui:SettingsCard>
<ui:SettingsCard
Margin="0 14 0 0"
Description="{DynamicResource ShouldUsePinyinToolTip}"
Header="{DynamicResource ShouldUsePinyin}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xe98a;" />
</ui:SettingsCard.HeaderIcon>
<cc:Card
Title="{DynamicResource ShouldUsePinyin}"
Margin="0 4 0 0"
Icon="&#xe98a;"
Sub="{DynamicResource ShouldUsePinyinToolTip}">
<ui:ToggleSwitch <ui:ToggleSwitch
IsOn="{Binding ShouldUsePinyin}" IsOn="{Binding ShouldUsePinyin}"
OffContent="{DynamicResource disable}" OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" OnContent="{DynamicResource enable}"
ToolTip="{DynamicResource ShouldUsePinyinToolTip}" /> ToolTip="{DynamicResource ShouldUsePinyinToolTip}" />
</cc:Card> </ui:SettingsCard>
<cc:ExCard <ui:SettingsExpander
Title="{DynamicResource ShouldUseDoublePinyin}" Margin="0 4 0 0"
Icon="&#xf085;" Description="{DynamicResource ShouldUseDoublePinyinToolTip}"
Header="{DynamicResource ShouldUseDoublePinyin}"
Visibility="{ext:VisibleWhen {Binding ShouldUsePinyin}, Visibility="{ext:VisibleWhen {Binding ShouldUsePinyin},
IsEqualToBool=True}" IsEqualToBool=True}">
Sub="{DynamicResource ShouldUseDoublePinyinToolTip}"> <ui:SettingsExpander.HeaderIcon>
<cc:ExCard.SideContent> <ui:FontIcon Glyph="&#xf085;" />
<ui:ToggleSwitch </ui:SettingsExpander.HeaderIcon>
IsOn="{Binding UseDoublePinyin}"
OffContent="{DynamicResource disable}" <ui:ToggleSwitch
OnContent="{DynamicResource enable}" IsOn="{Binding UseDoublePinyin}"
ToolTip="{DynamicResource ShouldUseDoublePinyinToolTip}" /> OffContent="{DynamicResource disable}"
</cc:ExCard.SideContent> OnContent="{DynamicResource enable}"
<cc:Card Title="{DynamicResource DoublePinyinSchema}" Type="InsideFit"> ToolTip="{DynamicResource ShouldUseDoublePinyinToolTip}" />
<ComboBox
DisplayMemberPath="Display" <ui:SettingsExpander.Items>
ItemsSource="{Binding DoublePinyinSchemas}" <ui:SettingsCard Header="{DynamicResource DoublePinyinSchema}">
SelectedValue="{Binding Settings.DoublePinyinSchema}" <ComboBox
SelectedValuePath="Value" /> DisplayMemberPath="Display"
</cc:Card> ItemsSource="{Binding DoublePinyinSchemas}"
</cc:ExCard> SelectedValue="{Binding Settings.DoublePinyinSchema}"
SelectedValuePath="Value" />
</ui:SettingsCard>
</ui:SettingsExpander.Items>
</ui:SettingsExpander>
<ui:SettingsCard Margin="0 14 0 0" Header="{DynamicResource language}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xf2b7;" />
</ui:SettingsCard.HeaderIcon>
<cc:Card
Title="{DynamicResource language}"
Margin="0 14 0 0"
Icon="&#xf2b7;">
<ComboBox <ComboBox
MaxWidth="200" MaxWidth="200"
Margin="10 0 0 0" Margin="10 0 0 0"
@ -502,37 +546,40 @@
ItemsSource="{Binding Languages}" ItemsSource="{Binding Languages}"
SelectedValue="{Binding Language}" SelectedValue="{Binding Language}"
SelectedValuePath="LanguageCode" /> SelectedValuePath="LanguageCode" />
</cc:Card> </ui:SettingsCard>
<Border Visibility="{Binding KoreanIMERegistryKeyExists, Converter={StaticResource BoolToVisibilityConverter}}"> <Border Visibility="{Binding KoreanIMERegistryKeyExists, Converter={StaticResource BoolToVisibilityConverter}}">
<cc:InfoBar <ui:InfoBar
Title="{DynamicResource KoreanImeTitle}" Title="{DynamicResource KoreanImeTitle}"
Margin="0 14 0 0" Margin="0 14 0 0"
Closable="False" IsClosable="False"
IsIconVisible="True" IsIconVisible="True"
Length="Long" IsOpen="True"
Message="{DynamicResource KoreanImeGuide}" Message="{DynamicResource KoreanImeGuide}"
Type="Warning" Severity="Warning"
Visibility="{Binding LegacyKoreanIMEEnabled, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter=Inverted, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" /> Visibility="{Binding LegacyKoreanIMEEnabled, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter=Inverted, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" />
</Border> </Border>
<cc:CardGroup Margin="0 14 0 0" Visibility="{Binding KoreanIMERegistryKeyExists, Converter={StaticResource BoolToVisibilityConverter}}"> <ikw:SimpleStackPanel Margin="0 14 0 0" Visibility="{Binding KoreanIMERegistryKeyExists, Converter={StaticResource BoolToVisibilityConverter}}">
<cc:Card <ui:SettingsCard Description="{DynamicResource KoreanImeRegistryTooltip}" Header="{DynamicResource KoreanImeRegistry}">
Title="{DynamicResource KoreanImeRegistry}" <ui:SettingsCard.HeaderIcon>
Icon="&#xe88b;" <ui:FontIcon Glyph="&#xe88b;" />
Sub="{DynamicResource KoreanImeRegistryTooltip}" </ui:SettingsCard.HeaderIcon>
Type="First">
<ui:ToggleSwitch <ui:ToggleSwitch
IsOn="{Binding LegacyKoreanIMEEnabled}" IsOn="{Binding LegacyKoreanIMEEnabled}"
OffContent="{DynamicResource disable}" OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" /> OnContent="{DynamicResource enable}" />
</cc:Card> </ui:SettingsCard>
<cc:Card <ui:SettingsCard
Title="{DynamicResource KoreanImeOpenLink}" Margin="0 4 0 0"
Icon="&#xF210;" Description="{DynamicResource KoreanImeOpenLinkToolTip}"
Sub="{DynamicResource KoreanImeOpenLinkToolTip}" Header="{DynamicResource KoreanImeOpenLink}">
Type="Last"> <ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xe8d3;" />
</ui:SettingsCard.HeaderIcon>
<Button Command="{Binding OpenImeSettingsCommand}" Content="{DynamicResource KoreanImeOpenLinkButton}" /> <Button Command="{Binding OpenImeSettingsCommand}" Content="{DynamicResource KoreanImeOpenLinkButton}" />
</cc:Card> </ui:SettingsCard>
</cc:CardGroup> </ikw:SimpleStackPanel>
</VirtualizingStackPanel> </VirtualizingStackPanel>
</ScrollViewer> </ui:ScrollViewerEx>
</ui:Page> </ui:Page>

View file

@ -5,8 +5,9 @@
xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls" xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:flowlauncher="clr-namespace:Flow.Launcher" xmlns:flowlauncher="clr-namespace:Flow.Launcher"
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure" xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure"
xmlns:viewModels="clr-namespace:Flow.Launcher.SettingPages.ViewModels" xmlns:viewModels="clr-namespace:Flow.Launcher.SettingPages.ViewModels"
Title="Hotkey" Title="Hotkey"
@ -14,7 +15,7 @@
d:DesignHeight="450" d:DesignHeight="450"
d:DesignWidth="800" d:DesignWidth="800"
mc:Ignorable="d"> mc:Ignorable="d">
<ScrollViewer <ui:ScrollViewerEx
Padding="0 0 6 0" Padding="0 0 6 0"
FontSize="14" FontSize="14"
VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.IsVirtualizing="True"
@ -27,66 +28,74 @@
Text="{DynamicResource hotkeys}" Text="{DynamicResource hotkeys}"
TextAlignment="left" /> TextAlignment="left" />
<cc:Card <ui:SettingsCard
Title="{DynamicResource flowlauncherHotkey}" Margin="0 8 0 0"
Icon="&#xeda7;" Description="{DynamicResource flowlauncherHotkeyToolTip}"
Sub="{DynamicResource flowlauncherHotkeyToolTip}"> Header="{DynamicResource flowlauncherHotkey}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xeda7;" />
</ui:SettingsCard.HeaderIcon>
<flowlauncher:HotkeyControl <flowlauncher:HotkeyControl
DefaultHotkey="Alt+Space" DefaultHotkey="Alt+Space"
Type="Hotkey" Type="Hotkey"
ValidateKeyGesture="True" ValidateKeyGesture="True"
WindowTitle="{DynamicResource flowlauncherHotkey}" /> WindowTitle="{DynamicResource flowlauncherHotkey}" />
</cc:Card> </ui:SettingsCard>
<ui:SettingsCard
Margin="0 4 0 0"
Description="{DynamicResource previewHotkeyToolTip}"
Header="{DynamicResource previewHotkey}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xe8a1;" />
</ui:SettingsCard.HeaderIcon>
<cc:Card
Title="{DynamicResource previewHotkey}"
Icon="&#xe8a1;"
Sub="{DynamicResource previewHotkeyToolTip}">
<flowlauncher:HotkeyControl <flowlauncher:HotkeyControl
DefaultHotkey="F1" DefaultHotkey="F1"
Type="PreviewHotkey" Type="PreviewHotkey"
ValidateKeyGesture="False" ValidateKeyGesture="False"
WindowTitle="{DynamicResource previewHotkey}" /> WindowTitle="{DynamicResource previewHotkey}" />
</cc:Card> </ui:SettingsCard>
<cc:CardGroup Margin="0 12 0 0"> <ui:SettingsCard
<cc:Card
Title="{DynamicResource openResultModifiers}"
Sub="{DynamicResource openResultModifiersToolTip}"
Type="First">
<ComboBox
Width="120"
FontSize="14"
ItemsSource="{Binding OpenResultModifiersList}"
SelectedValue="{Binding Settings.OpenResultModifiers}" />
</cc:Card>
<cc:Card
Title="{DynamicResource showOpenResultHotkey}"
Sub="{DynamicResource showOpenResultHotkeyToolTip}"
Type="Last">
<ui:ToggleSwitch
IsOn="{Binding Settings.ShowOpenResultHotkey}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</cc:Card>
</cc:CardGroup>
<cc:Card
Title="{DynamicResource dialogJumpHotkey}"
Margin="0 14 0 0" Margin="0 14 0 0"
Icon="&#xE8AB;" Description="{DynamicResource openResultModifiersToolTip}"
Sub="{DynamicResource dialogJumpHotkeyToolTip}"> Header="{DynamicResource openResultModifiers}">
<ComboBox
Width="120"
FontSize="14"
ItemsSource="{Binding OpenResultModifiersList}"
SelectedValue="{Binding Settings.OpenResultModifiers}" />
</ui:SettingsCard>
<ui:SettingsCard
Margin="0 4 0 0"
Description="{DynamicResource showOpenResultHotkeyToolTip}"
Header="{DynamicResource showOpenResultHotkey}">
<ui:ToggleSwitch
IsOn="{Binding Settings.ShowOpenResultHotkey}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</ui:SettingsCard>
<ui:SettingsCard
Margin="0 14 0 0"
Description="{DynamicResource dialogJumpHotkeyToolTip}"
Header="{DynamicResource dialogJumpHotkey}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xE8AB;" />
</ui:SettingsCard.HeaderIcon>
<flowlauncher:HotkeyControl <flowlauncher:HotkeyControl
ChangeHotkey="{Binding SetDialogJumpHotkeyCommand}" ChangeHotkey="{Binding SetDialogJumpHotkeyCommand}"
DefaultHotkey="Alt+G" DefaultHotkey="Alt+G"
Type="DialogJumpHotkey" Type="DialogJumpHotkey"
ValidateKeyGesture="False" ValidateKeyGesture="False"
WindowTitle="{DynamicResource dialogJumpHotkey}" /> WindowTitle="{DynamicResource dialogJumpHotkey}" />
</cc:Card> </ui:SettingsCard>
<cc:ExCard <ui:SettingsExpander
Title="{DynamicResource hotkeyPresets}"
Margin="0 14 0 0" Margin="0 14 0 0"
Icon="&#xf0e2;" Icon="&#xf0e2;"
Sub="{DynamicResource hotkeyPresetsToolTip}"> Sub="{DynamicResource hotkeyPresetsToolTip}">
@ -175,11 +184,12 @@
DefaultHotkey="Alt+Up" DefaultHotkey="Alt+Up"
Type="CycleHistoryUpHotkey" Type="CycleHistoryUpHotkey"
ValidateKeyGesture="False" /> ValidateKeyGesture="False" />
</cc:Card> </ui:SettingsCard>
<cc:Card <ui:SettingsCard Header="{DynamicResource CycleHistoryDownHotkey}">
Title="{DynamicResource CycleHistoryDownHotkey}" <ui:SettingsCard.HeaderIcon>
Icon="&#xe70d;" <ui:FontIcon Glyph="&#xe70d;" />
Type="Inside"> </ui:SettingsCard.HeaderIcon>
<flowlauncher:HotkeyControl <flowlauncher:HotkeyControl
DefaultHotkey="Alt+Down" DefaultHotkey="Alt+Down"
Type="CycleHistoryDownHotkey" Type="CycleHistoryDownHotkey"
@ -193,11 +203,12 @@
DefaultHotkey="" DefaultHotkey=""
Type="SelectPrevPageHotkey" Type="SelectPrevPageHotkey"
ValidateKeyGesture="False" /> ValidateKeyGesture="False" />
</cc:Card> </ui:SettingsCard>
<cc:Card <ui:SettingsCard Header="{DynamicResource SelectNextPageHotkey}">
Title="{DynamicResource SelectNextPageHotkey}" <ui:SettingsCard.HeaderIcon>
Icon="&#xf0ae;" <ui:FontIcon Glyph="&#xf0ae;" />
Type="Inside"> </ui:SettingsCard.HeaderIcon>
<flowlauncher:HotkeyControl <flowlauncher:HotkeyControl
DefaultHotkey="" DefaultHotkey=""
Type="SelectNextPageHotkey" Type="SelectNextPageHotkey"
@ -229,11 +240,12 @@
<cc:HotkeyDisplay Keys="Ctrl+[" /> <cc:HotkeyDisplay Keys="Ctrl+[" />
<cc:HotkeyDisplay Margin="4 0 0 0" Keys="Ctrl+]" /> <cc:HotkeyDisplay Margin="4 0 0 0" Keys="Ctrl+]" />
</StackPanel> </StackPanel>
</cc:Card> </ui:SettingsCard>
<cc:Card <ui:SettingsCard Header="{DynamicResource QuickHeightHotkey}">
Title="{DynamicResource QuickHeightHotkey}" <ui:SettingsCard.HeaderIcon>
Icon="&#xe7eb;" <ui:FontIcon Glyph="&#xe7eb;" />
Type="Inside"> </ui:SettingsCard.HeaderIcon>
<StackPanel Orientation="Horizontal"> <StackPanel Orientation="Horizontal">
<cc:HotkeyDisplay Keys="Ctrl+Minus" /> <cc:HotkeyDisplay Keys="Ctrl+Minus" />
<cc:HotkeyDisplay Margin="4 0 0 0" Keys="Ctrl+Plus" /> <cc:HotkeyDisplay Margin="4 0 0 0" Keys="Ctrl+Plus" />
@ -326,159 +338,170 @@
<ListView <ListView
MinHeight="160" MinHeight="160"
Margin="0" Margin="0"
Background="{DynamicResource Color02B}"
BorderBrush="DarkGray"
BorderThickness="1" BorderThickness="1"
ItemsSource="{Binding Settings.CustomPluginHotkeys}" Style="{StaticResource SettingSeparatorStyle}" />
SelectedItem="{Binding SelectedCustomPluginHotkey}" <StackPanel Margin="18 18 18 0">
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}"> <ListView
<ListView.View> MinHeight="160"
<GridView> Margin="0"
<GridViewColumn Width="180" Header="{DynamicResource hotkey}"> Background="{DynamicResource Color02B}"
<GridViewColumn.CellTemplate> BorderBrush="DarkGray"
<DataTemplate DataType="userSettings:CustomPluginHotkey"> BorderThickness="1"
<TextBlock Text="{Binding Hotkey}" /> ItemsSource="{Binding Settings.CustomPluginHotkeys}"
</DataTemplate> SelectedItem="{Binding SelectedCustomPluginHotkey}"
</GridViewColumn.CellTemplate> Style="{StaticResource {x:Static GridView.GridViewStyleKey}}">
</GridViewColumn> <ListView.View>
<GridViewColumn Width="430" Header="{DynamicResource customQuery}"> <GridView>
<GridViewColumn.CellTemplate> <GridViewColumn Width="180" Header="{DynamicResource hotkey}">
<DataTemplate DataType="userSettings:CustomPluginHotkey"> <GridViewColumn.CellTemplate>
<TextBlock Text="{Binding ActionKeyword}" /> <DataTemplate DataType="userSettings:CustomPluginHotkey">
</DataTemplate> <TextBlock Text="{Binding Hotkey}" />
</GridViewColumn.CellTemplate> </DataTemplate>
</GridViewColumn> </GridViewColumn.CellTemplate>
</GridView> </GridViewColumn>
</ListView.View> <GridViewColumn Width="430" Header="{DynamicResource customQuery}">
</ListView> <GridViewColumn.CellTemplate>
<StackPanel HorizontalAlignment="Right" Orientation="Horizontal"> <DataTemplate DataType="userSettings:CustomPluginHotkey">
<Button <TextBlock Text="{Binding ActionKeyword}" />
MinWidth="100" </DataTemplate>
Margin="10" </GridViewColumn.CellTemplate>
Command="{Binding CustomHotkeyDeleteCommand}" </GridViewColumn>
Content="{DynamicResource delete}" /> </GridView>
<Button </ListView.View>
MinWidth="100" </ListView>
Margin="10" <StackPanel HorizontalAlignment="Right" Orientation="Horizontal">
Command="{Binding CustomHotkeyEditCommand}" <Button
Content="{DynamicResource edit}" /> MinWidth="100"
<Button Margin="10"
MinWidth="100" Command="{Binding CustomHotkeyDeleteCommand}"
Margin="10 10 0 10" Content="{DynamicResource delete}" />
Command="{Binding CustomHotkeyAddCommand}" <Button
Content="{DynamicResource add}" /> MinWidth="100"
Margin="10"
Command="{Binding CustomHotkeyEditCommand}"
Content="{DynamicResource edit}" />
<Button
MinWidth="100"
Margin="10 10 0 10"
Command="{Binding CustomHotkeyAddCommand}"
Content="{DynamicResource add}" />
</StackPanel>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</StackPanel> </ui:SettingsExpander.ItemsHeader>
</cc:ExCard> </ui:SettingsExpander>
<cc:ExCard <ui:SettingsExpander Margin="0 4 0 0" Header="{DynamicResource customQueryShortcut}">
Title="{DynamicResource customQueryShortcut}" <ui:SettingsExpander.HeaderIcon>
Margin="0 4 0 0" <ui:FontIcon Glyph="&#xf26b;" />
Icon="&#xf26b;"> </ui:SettingsExpander.HeaderIcon>
<StackPanel>
<Separator <ui:SettingsExpander.ItemsHeader>
Width="Auto" <StackPanel Background="{DynamicResource SettingsCardBackground}">
Margin="0" <Separator
BorderThickness="1" Width="Auto"
Style="{StaticResource SettingSeparatorStyle}" />
<StackPanel Margin="18 12 18 0">
<ListView
MinHeight="160"
Margin="0 6 0 0"
Background="{DynamicResource Color02B}"
BorderBrush="DarkGray"
BorderThickness="1"
ItemsSource="{Binding Settings.CustomShortcuts}"
SelectedItem="{Binding SelectedCustomShortcut}"
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}">
<ListView.View>
<GridView>
<GridViewColumn Width="180" Header="{DynamicResource customShortcut}">
<GridViewColumn.CellTemplate>
<DataTemplate DataType="{x:Type userSettings:CustomShortcutModel}">
<TextBlock Text="{Binding Key}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Width="430" Header="{DynamicResource customShortcutExpansion}">
<GridViewColumn.CellTemplate>
<DataTemplate DataType="{x:Type userSettings:CustomShortcutModel}">
<TextBlock Text="{Binding Value}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
<StackPanel
Margin="0" Margin="0"
HorizontalAlignment="Right" BorderThickness="1"
VerticalAlignment="Top" Style="{StaticResource SettingSeparatorStyle}" />
Orientation="Horizontal"> <StackPanel Margin="18 12 18 0">
<Button <ListView
MinWidth="100" MinHeight="160"
Margin="10" Margin="0 6 0 0"
Command="{Binding CustomShortcutDeleteCommand}" Background="{DynamicResource Color02B}"
Content="{DynamicResource delete}" /> BorderBrush="DarkGray"
<Button BorderThickness="1"
MinWidth="100" ItemsSource="{Binding Settings.CustomShortcuts}"
Margin="10" SelectedItem="{Binding SelectedCustomShortcut}"
Command="{Binding CustomShortcutEditCommand}" Style="{StaticResource {x:Static GridView.GridViewStyleKey}}">
Content="{DynamicResource edit}" /> <ListView.View>
<Button <GridView>
MinWidth="100" <GridViewColumn Width="180" Header="{DynamicResource customShortcut}">
Margin="10 10 0 10" <GridViewColumn.CellTemplate>
Command="{Binding CustomShortcutAddCommand}" <DataTemplate DataType="{x:Type userSettings:CustomShortcutModel}">
Content="{DynamicResource add}" /> <TextBlock Text="{Binding Key}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Width="430" Header="{DynamicResource customShortcutExpansion}">
<GridViewColumn.CellTemplate>
<DataTemplate DataType="{x:Type userSettings:CustomShortcutModel}">
<TextBlock Text="{Binding Value}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
<StackPanel
Margin="0"
HorizontalAlignment="Right"
VerticalAlignment="Top"
Orientation="Horizontal">
<Button
MinWidth="100"
Margin="10"
Command="{Binding CustomShortcutDeleteCommand}"
Content="{DynamicResource delete}" />
<Button
MinWidth="100"
Margin="10"
Command="{Binding CustomShortcutEditCommand}"
Content="{DynamicResource edit}" />
<Button
MinWidth="100"
Margin="10 10 0 10"
Command="{Binding CustomShortcutAddCommand}"
Content="{DynamicResource add}" />
</StackPanel>
</StackPanel> </StackPanel>
</StackPanel> </StackPanel>
</StackPanel> </ui:SettingsExpander.ItemsHeader>
</cc:ExCard> </ui:SettingsExpander>
<cc:ExCard <ui:SettingsExpander Margin="0 4 0 14" Header="{DynamicResource builtinShortcuts}">
Title="{DynamicResource builtinShortcuts}" <ui:SettingsExpander.HeaderIcon>
Margin="0 4 0 14" <ui:FontIcon Glyph="&#xf158;" />
Icon="&#xf158;"> </ui:SettingsExpander.HeaderIcon>
<StackPanel>
<Separator <ui:SettingsExpander.ItemsHeader>
Width="Auto" <StackPanel Background="{DynamicResource SettingsCardBackground}">
Margin="0" <Separator
BorderThickness="1" Width="Auto"
Style="{StaticResource SettingSeparatorStyle}" /> Margin="0"
<StackPanel Margin="16 8 16 0">
<ListView
MinHeight="160"
Margin="0 6 0 16"
Background="{DynamicResource Color02B}"
BorderBrush="DarkGray"
BorderThickness="1" BorderThickness="1"
ItemsSource="{Binding Settings.BuiltinShortcuts}" Style="{StaticResource SettingSeparatorStyle}" />
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}"> <StackPanel Margin="16 8 16 0">
<ListView.View> <ListView
<GridView> MinHeight="160"
<GridViewColumn Width="180" Header="{DynamicResource customShortcut}"> Margin="0 6 0 16"
<GridViewColumn.CellTemplate> Background="{DynamicResource Color02B}"
<DataTemplate DataType="{x:Type userSettings:BuiltinShortcutModel}"> BorderBrush="DarkGray"
<TextBlock Text="{Binding Key}" /> BorderThickness="1"
</DataTemplate> ItemsSource="{Binding Settings.BuiltinShortcuts}"
</GridViewColumn.CellTemplate> Style="{StaticResource {x:Static GridView.GridViewStyleKey}}">
</GridViewColumn> <ListView.View>
<GridViewColumn Width="430" Header="{DynamicResource builtinShortcutDescription}"> <GridView>
<GridViewColumn.CellTemplate> <GridViewColumn Width="180" Header="{DynamicResource customShortcut}">
<DataTemplate DataType="{x:Type userSettings:BuiltinShortcutModel}"> <GridViewColumn.CellTemplate>
<TextBlock Text="{Binding LocalizedDescription}" /> <DataTemplate DataType="{x:Type userSettings:BuiltinShortcutModel}">
</DataTemplate> <TextBlock Text="{Binding Key}" />
</GridViewColumn.CellTemplate> </DataTemplate>
</GridViewColumn> </GridViewColumn.CellTemplate>
</GridView> </GridViewColumn>
</ListView.View> <GridViewColumn Width="430" Header="{DynamicResource builtinShortcutDescription}">
</ListView> <GridViewColumn.CellTemplate>
<DataTemplate DataType="{x:Type userSettings:BuiltinShortcutModel}">
<TextBlock Text="{Binding LocalizedDescription}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
</GridView>
</ListView.View>
</ListView>
</StackPanel>
</StackPanel> </StackPanel>
</StackPanel> </ui:SettingsExpander.ItemsHeader>
</cc:ExCard> </ui:SettingsExpander>
</StackPanel> </StackPanel>
</ScrollViewer> </ui:ScrollViewerEx>
</ui:Page> </ui:Page>

View file

@ -3,9 +3,10 @@
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:viewModels="clr-namespace:Flow.Launcher.SettingPages.ViewModels" xmlns:viewModels="clr-namespace:Flow.Launcher.SettingPages.ViewModels"
xmlns:wpftk="clr-namespace:WpfToolkit.Controls;assembly=VirtualizingWrapPanel" xmlns:wpftk="clr-namespace:WpfToolkit.Controls;assembly=VirtualizingWrapPanel"
Title="PluginStore" Title="PluginStore"
@ -51,21 +52,22 @@
Grid.Column="1" Grid.Column="1"
Margin="5 24 0 0"> Margin="5 24 0 0">
<StackPanel <ikw:SimpleStackPanel
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Center" VerticalAlignment="Center"
DockPanel.Dock="Right" DockPanel.Dock="Right"
Orientation="Horizontal"> Orientation="Horizontal"
Spacing="8">
<Button <Button
Height="34" Height="34"
Margin="0 5 10 5" Margin="0 5 0 5"
Padding="12 4" Padding="12 4"
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Center" VerticalAlignment="Center"
Command="{Binding RefreshExternalPluginsCommand}" Command="{Binding RefreshExternalPluginsCommand}"
Content="{DynamicResource refresh}" Content="{DynamicResource refresh}"
FontSize="13" /> FontSize="13" />
<Button Height="34" Margin="0 0 10 0"> <Button Height="34">
<ui:FontIcon FontSize="14" Glyph="&#xe71c;" /> <ui:FontIcon FontSize="14" Glyph="&#xe71c;" />
<ui:FlyoutService.Flyout> <ui:FlyoutService.Flyout>
<ui:MenuFlyout x:Name="FilterFlyout" Placement="Bottom"> <ui:MenuFlyout x:Name="FilterFlyout" Placement="Bottom">
@ -94,14 +96,12 @@
</Button> </Button>
<Button <Button
Height="34" Height="34"
Margin="0 0 10 0"
Command="{Binding InstallPluginCommand}" Command="{Binding InstallPluginCommand}"
ToolTip="{DynamicResource installLocalPluginTooltip}"> ToolTip="{DynamicResource installLocalPluginTooltip}">
<ui:FontIcon FontSize="14" Glyph="&#xE8DA;" /> <ui:FontIcon FontSize="14" Glyph="&#xE8DA;" />
</Button> </Button>
<Button <Button
Height="34" Height="34"
Margin="0 0 10 0"
Command="{Binding CheckPluginUpdatesCommand}" Command="{Binding CheckPluginUpdatesCommand}"
ToolTip="{DynamicResource checkPluginUpdatesTooltip}"> ToolTip="{DynamicResource checkPluginUpdatesTooltip}">
<ui:FontIcon FontSize="14" Glyph="&#xecc5;" /> <ui:FontIcon FontSize="14" Glyph="&#xecc5;" />
@ -112,48 +112,19 @@
Height="34" Height="34"
Margin="0 0 26 0" Margin="0 0 26 0"
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalContentAlignment="Center"
ui:ControlHelper.PlaceholderText="{DynamicResource searchplugin}"
ContextMenu="{StaticResource TextBoxContextMenu}" ContextMenu="{StaticResource TextBoxContextMenu}"
DockPanel.Dock="Right" DockPanel.Dock="Right"
FontSize="14" FontSize="14"
Text="{Binding FilterText, UpdateSourceTrigger=PropertyChanged}" Text="{Binding FilterText, UpdateSourceTrigger=PropertyChanged}"
TextAlignment="Left"
ToolTip="{DynamicResource searchpluginToolTip}" ToolTip="{DynamicResource searchpluginToolTip}"
ToolTipService.InitialShowDelay="200" ToolTipService.InitialShowDelay="200"
ToolTipService.Placement="Top"> ToolTipService.Placement="Top" />
<TextBox.Style> </ikw:SimpleStackPanel>
<Style BasedOn="{StaticResource DefaultTextBoxStyle}" TargetType="TextBox">
<Style.Resources>
<VisualBrush
x:Key="CueBannerBrush"
AlignmentX="Left"
AlignmentY="Center"
Stretch="None">
<VisualBrush.Visual>
<Label
Padding="10 0 0 0"
Content="{DynamicResource searchplugin}"
Foreground="{DynamicResource CustomContextDisabled}" />
</VisualBrush.Visual>
</VisualBrush>
</Style.Resources>
<Style.Triggers>
<Trigger Property="Text" Value="{x:Static sys:String.Empty}">
<Setter Property="Background" Value="{StaticResource CueBannerBrush}" />
</Trigger>
<Trigger Property="Text" Value="{x:Null}">
<Setter Property="Background" Value="{StaticResource CueBannerBrush}" />
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="True">
<Setter Property="Background" Value="{DynamicResource Color02B}" />
</Trigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>
</StackPanel>
</DockPanel> </DockPanel>
<ListView
<ListBox
x:Name="StoreListBox" x:Name="StoreListBox"
Grid.Row="1" Grid.Row="1"
Grid.Column="0" Grid.Column="0"
@ -161,14 +132,17 @@
Margin="4 0 0 0" Margin="4 0 0 0"
Padding="0 0 18 0" Padding="0 0 18 0"
FontSize="14" FontSize="14"
ItemContainerStyle="{StaticResource StoreList}" ItemContainerStyle="{DynamicResource StoreList}"
ItemsSource="{Binding Source={StaticResource PluginStoreCollectionView}}" ItemsSource="{Binding Source={StaticResource PluginStoreCollectionView}}"
ScrollViewer.CanContentScroll="True"
ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
SelectionMode="Single" SelectionMode="Single"
Style="{DynamicResource StoreListStyle}" Style="{DynamicResource StoreListStyle}"
VirtualizingPanel.IsVirtualizing="True"
VirtualizingPanel.IsVirtualizingWhenGrouping="True" VirtualizingPanel.IsVirtualizingWhenGrouping="True"
VirtualizingPanel.ScrollUnit="Pixel"> VirtualizingPanel.ScrollUnit="Pixel"
<ListView.ItemsPanel> VirtualizingPanel.VirtualizationMode="Recycling">
<ListBox.ItemsPanel>
<ItemsPanelTemplate> <ItemsPanelTemplate>
<wpftk:VirtualizingWrapPanel <wpftk:VirtualizingWrapPanel
x:Name="ItemWrapPanel" x:Name="ItemWrapPanel"
@ -179,26 +153,25 @@
SpacingMode="None" SpacingMode="None"
StretchItems="True" /> StretchItems="True" />
</ItemsPanelTemplate> </ItemsPanelTemplate>
</ListView.ItemsPanel> </ListBox.ItemsPanel>
<ListView.GroupStyle>
<ListBox.GroupStyle>
<GroupStyle HidesIfEmpty="True"> <GroupStyle HidesIfEmpty="True">
<GroupStyle.ContainerStyle> <GroupStyle.ContainerStyle>
<Style TargetType="{x:Type GroupItem}"> <Style TargetType="{x:Type GroupItem}">
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate> <ControlTemplate TargetType="{x:Type GroupItem}">
<Grid> <StackPanel Orientation="Vertical">
<StackPanel Orientation="Vertical"> <TextBlock
<TextBlock Margin="2 0 0 10"
Margin="2 0 0 10" VerticalAlignment="Top"
VerticalAlignment="Top" FontSize="16"
FontSize="16" FontWeight="Bold"
FontWeight="Bold" Foreground="{DynamicResource Color05B}"
Foreground="{DynamicResource Color05B}" Text="{Binding Name, Converter={StaticResource TextConverter}}" />
Text="{Binding Name, Converter={StaticResource TextConverter}}" /> <ItemsPresenter />
<ItemsPresenter /> </StackPanel>
</StackPanel>
</Grid>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
@ -210,9 +183,9 @@
</ItemsPanelTemplate> </ItemsPanelTemplate>
</GroupStyle.Panel> </GroupStyle.Panel>
</GroupStyle> </GroupStyle>
</ListView.GroupStyle> </ListBox.GroupStyle>
<ListView.ItemTemplate> <ListBox.ItemTemplate>
<DataTemplate> <DataTemplate>
<DataTemplate.Resources> <DataTemplate.Resources>
<Style x:Key="StoreListItemBtnStyle" TargetType="Button"> <Style x:Key="StoreListItemBtnStyle" TargetType="Button">
@ -262,7 +235,6 @@
HorizontalContentAlignment="Stretch" HorizontalContentAlignment="Stretch"
VerticalContentAlignment="Stretch" VerticalContentAlignment="Stretch"
BorderThickness="0" BorderThickness="0"
FocusVisualStyle="{StaticResource StoreItemFocusVisualStyleKey}"
Style="{DynamicResource StoreListItemBtnStyle}"> Style="{DynamicResource StoreListItemBtnStyle}">
<ui:FlyoutService.Flyout> <ui:FlyoutService.Flyout>
<ui:Flyout x:Name="InstallFlyout" Placement="Bottom"> <ui:Flyout x:Name="InstallFlyout" Placement="Bottom">
@ -394,7 +366,7 @@
</Grid> </Grid>
</Button> </Button>
</DataTemplate> </DataTemplate>
</ListView.ItemTemplate> </ListBox.ItemTemplate>
</ListView> </ListBox>
</Grid> </Grid>
</ui:Page> </ui:Page>

View file

@ -4,9 +4,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls" xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:viewModels="clr-namespace:Flow.Launcher.SettingPages.ViewModels" xmlns:viewModels="clr-namespace:Flow.Launcher.SettingPages.ViewModels"
Title="Plugins" Title="Plugins"
d:DataContext="{d:DesignInstance viewModels:SettingsPanePluginsViewModel}" d:DataContext="{d:DesignInstance viewModels:SettingsPanePluginsViewModel}"
@ -34,13 +35,13 @@
Style="{StaticResource PageTitle}" Style="{StaticResource PageTitle}"
Text="{DynamicResource plugins}" Text="{DynamicResource plugins}"
TextAlignment="Left" /> TextAlignment="Left" />
<StackPanel <ikw:SimpleStackPanel
HorizontalAlignment="Right" HorizontalAlignment="Right"
VerticalAlignment="Center" VerticalAlignment="Center"
DockPanel.Dock="Right" DockPanel.Dock="Right"
Orientation="Horizontal"> Orientation="Horizontal"
Spacing="8">
<TextBlock <TextBlock
Margin="0 0 6 0"
VerticalAlignment="Center" VerticalAlignment="Center"
FontSize="14" FontSize="14"
Foreground="{DynamicResource Color15B}" Foreground="{DynamicResource Color15B}"
@ -51,7 +52,6 @@
Height="34" Height="34"
MinWidth="150" MinWidth="150"
MaxWidth="150" MaxWidth="150"
Margin="0 0 4 0"
HorizontalContentAlignment="Left" HorizontalContentAlignment="Left"
Background="{DynamicResource Color00B}" Background="{DynamicResource Color00B}"
DisplayMemberPath="Display" DisplayMemberPath="Display"
@ -61,7 +61,7 @@
<Button <Button
Width="34" Width="34"
Height="34" Height="34"
Margin="0 0 20 0" Padding="0"
Command="{Binding OpenHelperCommand}" Command="{Binding OpenHelperCommand}"
CommandParameter="{Binding RelativeSource={RelativeSource Self}}" CommandParameter="{Binding RelativeSource={RelativeSource Self}}"
FontSize="14"> FontSize="14">
@ -72,44 +72,15 @@
Width="150" Width="150"
Height="34" Height="34"
Margin="0 0 26 0" Margin="0 0 26 0"
VerticalContentAlignment="Center"
ui:ControlHelper.PlaceholderText="{DynamicResource searchplugin}"
ContextMenu="{StaticResource TextBoxContextMenu}" ContextMenu="{StaticResource TextBoxContextMenu}"
FontSize="14" FontSize="14"
Text="{Binding FilterText, UpdateSourceTrigger=PropertyChanged}" Text="{Binding FilterText, UpdateSourceTrigger=PropertyChanged}"
TextAlignment="Left"
ToolTip="{DynamicResource searchpluginToolTip}" ToolTip="{DynamicResource searchpluginToolTip}"
ToolTipService.InitialShowDelay="200" ToolTipService.InitialShowDelay="200"
ToolTipService.Placement="Top"> ToolTipService.Placement="Top" />
<TextBox.Style> </ikw:SimpleStackPanel>
<Style BasedOn="{StaticResource DefaultTextBoxStyle}" TargetType="TextBox">
<Style.Resources>
<VisualBrush
x:Key="CueBannerBrush"
AlignmentX="Left"
AlignmentY="Center"
Stretch="None">
<VisualBrush.Visual>
<Label
Padding="10 0 0 0"
Content="{DynamicResource searchplugin}"
Foreground="{DynamicResource CustomContextDisabled}" />
</VisualBrush.Visual>
</VisualBrush>
</Style.Resources>
<Style.Triggers>
<Trigger Property="Text" Value="{x:Static sys:String.Empty}">
<Setter Property="Background" Value="{StaticResource CueBannerBrush}" />
</Trigger>
<Trigger Property="Text" Value="{x:Null}">
<Setter Property="Background" Value="{StaticResource CueBannerBrush}" />
</Trigger>
<Trigger Property="IsKeyboardFocused" Value="True">
<Setter Property="Background" Value="{DynamicResource Color02B}" />
</Trigger>
</Style.Triggers>
</Style>
</TextBox.Style>
</TextBox>
</StackPanel>
</DockPanel> </DockPanel>
<Border <Border
@ -117,13 +88,13 @@
Grid.Column="0" Grid.Column="0"
Background="{DynamicResource Color01B}"> Background="{DynamicResource Color01B}">
<ListBox <ListBox
Margin="5 0 7 10" Margin="5 0 0 10"
Padding="0 0 7 0"
Background="{DynamicResource Color01B}" Background="{DynamicResource Color01B}"
FontSize="14" FontSize="14"
ItemContainerStyle="{StaticResource PluginList}" ItemContainerStyle="{DynamicResource PluginList}"
ItemsSource="{Binding Source={StaticResource PluginCollectionView}}" ItemsSource="{Binding Source={StaticResource PluginCollectionView}}"
Loaded="PluginListBox_Loaded" Loaded="PluginListBox_Loaded"
ScrollViewer.CanContentScroll="False"
ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
SnapsToDevicePixels="True" SnapsToDevicePixels="True"
Style="{DynamicResource PluginListStyle}" Style="{DynamicResource PluginListStyle}"

View file

@ -4,9 +4,10 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls" xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:sys="clr-namespace:System;assembly=mscorlib"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:viewModels="clr-namespace:Flow.Launcher.SettingPages.ViewModels" xmlns:viewModels="clr-namespace:Flow.Launcher.SettingPages.ViewModels"
Title="Proxy" Title="Proxy"
d:DataContext="{d:DesignInstance viewModels:SettingsPaneProxyViewModel}" d:DataContext="{d:DesignInstance viewModels:SettingsPaneProxyViewModel}"
@ -16,14 +17,12 @@
<Page.Resources> <Page.Resources>
<ResourceDictionary Source="pack://application:,,,/Resources/SettingWindowStyle.xaml" /> <ResourceDictionary Source="pack://application:,,,/Resources/SettingWindowStyle.xaml" />
</Page.Resources> </Page.Resources>
<ScrollViewer <ui:ScrollViewerEx
Padding="5 0 24 0"
CanContentScroll="True"
FontSize="14" FontSize="14"
VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.ScrollUnit="Pixel"> VirtualizingStackPanel.ScrollUnit="Pixel">
<StackPanel> <StackPanel Margin="5 0 24 0">
<TextBlock <TextBlock
Margin="0 23 0 10" Margin="0 23 0 10"
FontSize="30" FontSize="30"
@ -31,50 +30,48 @@
Text="{DynamicResource proxy}" Text="{DynamicResource proxy}"
TextAlignment="left" /> TextAlignment="left" />
<cc:CardGroup> <ui:SettingsCard Header="{DynamicResource enableProxy}">
<cc:Card Title="{DynamicResource enableProxy}" Type="First"> <ui:ToggleSwitch
<ui:ToggleSwitch IsOn="{Binding Settings.Proxy.Enabled}"
IsOn="{Binding Settings.Proxy.Enabled}" OffContent="{DynamicResource disable}"
OffContent="{DynamicResource disable}" OnContent="{DynamicResource enable}" />
OnContent="{DynamicResource enable}" /> </ui:SettingsCard>
</cc:Card>
<cc:Card Title="{DynamicResource server}" Type="Middle"> <ui:SettingsCard Margin="0 4 0 0" Header="{DynamicResource server}">
<TextBox <TextBox
Width="300" Width="300"
IsEnabled="{Binding Settings.Proxy.Enabled}" IsEnabled="{Binding Settings.Proxy.Enabled}"
Text="{Binding Settings.Proxy.Server}" /> Text="{Binding Settings.Proxy.Server}" />
</cc:Card> </ui:SettingsCard>
<cc:Card Title="{DynamicResource port}" Type="Middle"> <ui:SettingsCard Margin="0 4 0 0" Header="{DynamicResource port}">
<TextBox <TextBox
Width="100" Width="100"
IsEnabled="{Binding Settings.Proxy.Enabled}" IsEnabled="{Binding Settings.Proxy.Enabled}"
Text="{Binding Settings.Proxy.Port, TargetNullValue={x:Static sys:String.Empty}}" /> Text="{Binding Settings.Proxy.Port, TargetNullValue={x:Static sys:String.Empty}}" />
</cc:Card> </ui:SettingsCard>
<cc:Card Title="{DynamicResource userName}" Type="Middle"> <ui:SettingsCard Margin="0 4 0 0" Header="{DynamicResource userName}">
<TextBox <TextBox
Width="200" Width="200"
IsEnabled="{Binding Settings.Proxy.Enabled}" IsEnabled="{Binding Settings.Proxy.Enabled}"
Text="{Binding Settings.Proxy.UserName}" /> Text="{Binding Settings.Proxy.UserName}" />
</cc:Card> </ui:SettingsCard>
<cc:Card Title="{DynamicResource password}" Type="Last"> <ui:SettingsCard Margin="0 4 0 0" Header="{DynamicResource password}">
<TextBox <TextBox
Width="200" Width="200"
IsEnabled="{Binding Settings.Proxy.Enabled}" IsEnabled="{Binding Settings.Proxy.Enabled}"
Text="{Binding Settings.Proxy.Password}" /> Text="{Binding Settings.Proxy.Password}" />
</cc:Card> </ui:SettingsCard>
</cc:CardGroup>
<cc:Card Title="{DynamicResource testProxy}" Margin="0 8 0 0"> <ui:SettingsCard Margin="0 14 0 0" Header="{DynamicResource testProxy}">
<Button <Button
Width="150" Width="150"
Command="{Binding TestProxyClickedCommand}" Command="{Binding TestProxyClickedCommand}"
Content="{DynamicResource testProxy}" Content="{DynamicResource testProxy}"
IsEnabled="{Binding Settings.Proxy.Enabled}" /> IsEnabled="{Binding Settings.Proxy.Enabled}" />
</cc:Card> </ui:SettingsCard>
</StackPanel> </StackPanel>
</ScrollViewer> </ui:ScrollViewerEx>
</ui:Page> </ui:Page>

View file

@ -6,8 +6,9 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:ext="clr-namespace:Flow.Launcher.Resources.MarkupExtensions" xmlns:ext="clr-namespace:Flow.Launcher.Resources.MarkupExtensions"
xmlns:flowlauncher="clr-namespace:Flow.Launcher" xmlns:flowlauncher="clr-namespace:Flow.Launcher"
xmlns:ikw="http://schemas.inkore.net/lib/ui/wpf"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure" xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure"
xmlns:viewModels="clr-namespace:Flow.Launcher.SettingPages.ViewModels" xmlns:viewModels="clr-namespace:Flow.Launcher.SettingPages.ViewModels"
Title="Theme" Title="Theme"
@ -23,9 +24,8 @@
<CollectionViewSource x:Key="SortedFonts" Source="{Binding Source={x:Static Fonts.SystemFontFamilies}}" /> <CollectionViewSource x:Key="SortedFonts" Source="{Binding Source={x:Static Fonts.SystemFontFamilies}}" />
</ResourceDictionary> </ResourceDictionary>
</ui:Page.Resources> </ui:Page.Resources>
<ScrollViewer <ui:ScrollViewerEx
Padding="6 0 24 0" Padding="6 0 24 0"
CanContentScroll="False"
FontSize="14" FontSize="14"
VirtualizingStackPanel.IsVirtualizing="True" VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.ScrollUnit="Pixel"> VirtualizingStackPanel.ScrollUnit="Pixel">
@ -89,10 +89,8 @@
</Style.Triggers> </Style.Triggers>
</Style> </Style>
</Border.Style> </Border.Style>
<ScrollViewer <!-- We need to keep this ScrollViewerEx because its height cannot be expanded to the whole page -->
ScrollViewer.CanContentScroll="False" <ui:ScrollViewerEx>
VirtualizingStackPanel.IsVirtualizing="True"
VirtualizingStackPanel.ScrollUnit="Pixel">
<StackPanel> <StackPanel>
<Slider <Slider
Name="WindowHeightValue" Name="WindowHeightValue"
@ -268,7 +266,7 @@
Content="{DynamicResource resetCustomize}" Content="{DynamicResource resetCustomize}"
ToolTip="{DynamicResource resetCustomizeToolTip}" /> ToolTip="{DynamicResource resetCustomizeToolTip}" />
</StackPanel> </StackPanel>
</ScrollViewer> </ui:ScrollViewerEx>
</Border> </Border>
<!-- Theme preview --> <!-- Theme preview -->
@ -396,310 +394,323 @@
</Grid> </Grid>
<!-- Theme --> <!-- Theme -->
<cc:ExCard <ui:SettingsExpander
x:Name="ThemeCard" x:Name="ThemeCard"
Title="{DynamicResource theme}"
Margin="0 8 0 0" Margin="0 8 0 0"
Icon="&#xe790;"> Header="{DynamicResource theme}">
<cc:ExCard.SideContent> <ui:SettingsExpander.HeaderIcon>
<StackPanel VerticalAlignment="Center" Orientation="Horizontal"> <ui:FontIcon Glyph="&#xe790;" />
<ui:PathIcon </ui:SettingsExpander.HeaderIcon>
Width="12"
Margin="0 1 8 0"
VerticalAlignment="Center"
Data="{DynamicResource circle_half_stroke_solid}"
ToolTip="{DynamicResource TypeIsDarkToolTip}"
ToolTipService.InitialShowDelay="0"
Visibility="{Binding SelectedTheme.IsDark, Converter={StaticResource BoolToVisibilityConverter}}" />
<ui:FontIcon
Margin="0 2 8 0"
VerticalAlignment="Center"
FontSize="12"
Glyph="&#xEB42;"
ToolTip="{DynamicResource TypeHasBlurToolTip}"
ToolTipService.InitialShowDelay="0"
Visibility="{Binding SelectedTheme.HasBlur, Converter={StaticResource BoolToVisibilityConverter}}" />
<TextBlock Text="{Binding SelectedTheme.Name}" />
</StackPanel>
</cc:ExCard.SideContent>
<ListBox
HorizontalAlignment="Stretch"
HorizontalContentAlignment="Stretch"
Background="Transparent"
ItemContainerStyle="{DynamicResource ThemeList}"
ItemsSource="{Binding Themes}"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
ScrollViewer.VerticalScrollBarVisibility="Disabled"
SelectedValue="{Binding SelectedTheme}">
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid
Width="Auto"
Height="34"
Margin="0"
Focusable="True">
<StackPanel Margin="14 2 14 0" Orientation="Horizontal">
<TextBlock
Margin="0 0 0 0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{Binding Name}"
TextWrapping="Wrap" />
<ui:PathIcon
Width="12"
Margin="8 1 0 0"
VerticalAlignment="Center"
Data="{DynamicResource circle_half_stroke_solid}"
ToolTip="{DynamicResource TypeIsDarkToolTip}"
ToolTipService.InitialShowDelay="0"
Visibility="{Binding IsDark, Converter={StaticResource BoolToVisibilityConverter}}" />
<ui:FontIcon
Margin="8 1 0 0"
VerticalAlignment="Center"
FontSize="12"
Glyph="&#xEB42;"
ToolTip="{DynamicResource TypeHasBlurToolTip}"
ToolTipService.InitialShowDelay="0"
Visibility="{Binding HasBlur, Converter={StaticResource BoolToVisibilityConverter}}" />
</StackPanel>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.Template>
<ControlTemplate>
<Border
Padding="18 12 18 12"
BorderBrush="{DynamicResource Color03B}"
BorderThickness="0 1 0 0">
<ItemsPresenter />
</Border>
</ControlTemplate>
</ListBox.Template>
</ListBox>
</cc:ExCard>
<cc:CardGroup Margin="0 10 0 0"> <StackPanel VerticalAlignment="Center" Orientation="Horizontal">
<!-- Backdrop effect --> <ui:PathIcon
<cc:Card Width="12"
Title="{DynamicResource BackdropType}" Margin="0 1 8 0"
Margin="0 0 0 0"
Icon="&#xeb42;"
Sub="{Binding BackdropSubText}"
Type="First">
<ComboBox
MinWidth="160"
VerticalAlignment="Center" VerticalAlignment="Center"
DisplayMemberPath="Display" Data="{DynamicResource circle_half_stroke_solid}"
FontSize="14" ToolTip="{DynamicResource TypeIsDarkToolTip}"
IsEnabled="{Binding IsBackdropEnabled}" ToolTipService.InitialShowDelay="0"
ItemsSource="{Binding BackdropTypesList}" Visibility="{Binding SelectedTheme.IsDark, Converter={StaticResource BoolToVisibilityConverter}}" />
SelectedValue="{Binding BackdropType, Mode=TwoWay}" <ui:FontIcon
SelectedValuePath="Value" /> Margin="0 2 8 0"
</cc:Card> VerticalAlignment="Center"
FontSize="12"
Glyph="&#xEB42;"
ToolTip="{DynamicResource TypeHasBlurToolTip}"
ToolTipService.InitialShowDelay="0"
Visibility="{Binding SelectedTheme.HasBlur, Converter={StaticResource BoolToVisibilityConverter}}" />
<TextBlock Text="{Binding SelectedTheme.Name}" />
</StackPanel>
<!-- Drop shadow effect --> <ui:SettingsExpander.ItemsHeader>
<cc:Card <StackPanel Background="{DynamicResource SettingsCardBackground}">
Title="{DynamicResource queryWindowShadowEffect}" <ListBox
Margin="0 0 0 0" HorizontalAlignment="Stretch"
Icon="&#xeb91;" HorizontalContentAlignment="Stretch"
Type="Last"> Background="Transparent"
<ui:ToggleSwitch ItemContainerStyle="{DynamicResource ThemeList}"
IsEnabled="{Binding IsDropShadowEnabled}" ItemsSource="{Binding Themes}"
IsOn="{Binding DropShadowEffect}" ScrollViewer.HorizontalScrollBarVisibility="Disabled"
OffContent="{DynamicResource disable}" ScrollViewer.VerticalScrollBarVisibility="Disabled"
OnContent="{DynamicResource enable}" /> SelectedValue="{Binding SelectedTheme, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
</cc:Card> Style="{DynamicResource ThemeListStyle}">
</cc:CardGroup> <ListBox.ItemsPanel>
<cc:HyperLink <ItemsPanelTemplate>
Margin="10" <WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBox.ItemTemplate>
<DataTemplate>
<Grid
Width="Auto"
Height="34"
Margin="0"
Focusable="True">
<StackPanel Margin="14 2 14 0" Orientation="Horizontal">
<TextBlock
Margin="0 0 0 0"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Text="{Binding Name}"
TextWrapping="Wrap" />
<ui:PathIcon
Width="12"
Margin="8 1 0 0"
VerticalAlignment="Center"
Data="{DynamicResource circle_half_stroke_solid}"
ToolTip="{DynamicResource TypeIsDarkToolTip}"
ToolTipService.InitialShowDelay="0"
Visibility="{Binding IsDark, Converter={StaticResource BoolToVisibilityConverter}}" />
<ui:FontIcon
Margin="8 1 0 0"
VerticalAlignment="Center"
FontSize="12"
Glyph="&#xEB42;"
ToolTip="{DynamicResource TypeHasBlurToolTip}"
ToolTipService.InitialShowDelay="0"
Visibility="{Binding HasBlur, Converter={StaticResource BoolToVisibilityConverter}}" />
</StackPanel>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.Template>
<ControlTemplate>
<Border
Padding="18 12 18 12"
BorderBrush="{DynamicResource Color03B}"
BorderThickness="0 1 0 0">
<ItemsPresenter />
</Border>
</ControlTemplate>
</ListBox.Template>
</ListBox>
</StackPanel>
</ui:SettingsExpander.ItemsHeader>
</ui:SettingsExpander>
<!-- Backdrop effect -->
<ui:SettingsCard
Margin="0 10 0 0"
Description="{Binding BackdropSubText}"
Header="{DynamicResource BackdropType}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xeb42;" />
</ui:SettingsCard.HeaderIcon>
<ComboBox
MinWidth="160"
VerticalAlignment="Center"
DisplayMemberPath="Display"
FontSize="14"
IsEnabled="{Binding IsBackdropEnabled}"
ItemsSource="{Binding BackdropTypesList}"
SelectedValue="{Binding BackdropType, Mode=TwoWay}"
SelectedValuePath="Value" />
</ui:SettingsCard>
<!-- Drop shadow effect -->
<ui:SettingsCard Margin="0 4 0 0" Header="{DynamicResource queryWindowShadowEffect}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xeb91;" />
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch
IsEnabled="{Binding IsDropShadowEnabled}"
IsOn="{Binding DropShadowEffect}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</ui:SettingsCard>
<ui:HyperlinkButton
Margin="0 10 0 10"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Text="{DynamicResource browserMoreThemes}" Content="{DynamicResource browserMoreThemes}"
Uri="{Binding LinkThemeGallery}" /> NavigateUri="{Binding LinkThemeGallery}" />
<!-- Fixed size --> <!-- Fixed size -->
<cc:ExCard <ui:SettingsExpander
Title="{DynamicResource KeepMaxResults}"
Margin="0 20 0 0" Margin="0 20 0 0"
Icon="&#xE744;" Description="{DynamicResource KeepMaxResultsToolTip}"
Sub="{DynamicResource KeepMaxResultsToolTip}"> Header="{DynamicResource KeepMaxResults}">
<cc:ExCard.SideContent> <ui:SettingsExpander.HeaderIcon>
<StackPanel VerticalAlignment="Center" Orientation="Horizontal"> <ui:FontIcon Glyph="&#xE744;" />
<ui:ToggleSwitch </ui:SettingsExpander.HeaderIcon>
IsOn="{Binding KeepMaxResults}"
OffContent="{DynamicResource disable}" <StackPanel VerticalAlignment="Center" Orientation="Horizontal">
OnContent="{DynamicResource enable}" /> <ui:ToggleSwitch
</StackPanel> IsOn="{Binding KeepMaxResults}"
</cc:ExCard.SideContent> OffContent="{DynamicResource disable}"
<cc:Card OnContent="{DynamicResource enable}" />
Title="{DynamicResource maxShowResults}" </StackPanel>
Sub="{DynamicResource maxShowResultsToolTip}"
Type="InsideFit"> <ui:SettingsExpander.Items>
<ComboBox <ui:SettingsCard Description="{DynamicResource maxShowResultsToolTip}" Header="{DynamicResource maxShowResults}">
Width="100" <ComboBox
ItemsSource="{Binding MaxResultsRange}" Width="100"
SelectedItem="{Binding Settings.MaxResultsToShow}" /> ItemsSource="{Binding MaxResultsRange}"
</cc:Card> SelectedItem="{Binding Settings.MaxResultsToShow}" />
</cc:ExCard> </ui:SettingsCard>
<cc:InfoBar </ui:SettingsExpander.Items>
</ui:SettingsExpander>
<ui:InfoBar
Title="" Title=""
Margin="0 4 0 0" Margin="0 4 0 0"
Closable="False" IsClosable="True"
IsIconVisible="True" IsIconVisible="True"
Length="Long" IsOpen="{Binding Settings.AlwaysPreview, Mode=OneWay}"
Message="{DynamicResource MaxShowResultsCannotWorkWithAlwaysPreview}" Message="{DynamicResource MaxShowResultsCannotWorkWithAlwaysPreview}"
Type="Warning" Severity="Warning" />
Visibility="{Binding Settings.AlwaysPreview, Converter={StaticResource BoolToVisibilityConverter}, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}" />
<!-- Time and date --> <!-- Time and date -->
<cc:CardGroup Margin="0 14 0 0"> <ui:SettingsCard Margin="0 14 0 0" Header="{DynamicResource Clock}">
<cc:Card <ui:SettingsCard.HeaderIcon>
Title="{DynamicResource Clock}" <ui:FontIcon Glyph="&#xec92;" />
Icon="&#xec92;" </ui:SettingsCard.HeaderIcon>
Type="First">
<StackPanel Orientation="Horizontal">
<TextBlock
VerticalAlignment="Center"
FontSize="14"
Foreground="{DynamicResource Color04B}"
Text="{Binding ClockText}" />
<ComboBox
MinWidth="180"
Margin="10 0 18 0"
VerticalAlignment="Center"
FontSize="14"
ItemsSource="{Binding TimeFormatList}"
SelectedItem="{Binding TimeFormat}" />
<ui:ToggleSwitch
IsOn="{Binding UseClock}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</StackPanel>
</cc:Card>
<cc:Card <StackPanel Orientation="Horizontal">
Title="{DynamicResource Date}" <TextBlock
Icon="&#xe787;" VerticalAlignment="Center"
Type="Last"> FontSize="14"
<StackPanel Orientation="Horizontal"> Foreground="{DynamicResource Color04B}"
<TextBlock Text="{Binding ClockText}" />
VerticalAlignment="Center" <ComboBox
FontSize="14" MinWidth="180"
Foreground="{DynamicResource Color04B}" Margin="10 0 18 0"
Text="{Binding DateText}" /> VerticalAlignment="Center"
<ComboBox FontSize="14"
MinWidth="180" ItemsSource="{Binding TimeFormatList}"
Margin="10 0 18 0" SelectedItem="{Binding TimeFormat}" />
VerticalAlignment="Center" <ui:ToggleSwitch
FontSize="14" IsOn="{Binding UseClock}"
ItemsSource="{Binding DateFormatList}" OffContent="{DynamicResource disable}"
SelectedItem="{Binding DateFormat}" /> OnContent="{DynamicResource enable}" />
<ui:ToggleSwitch </StackPanel>
IsOn="{Binding UseDate}" </ui:SettingsCard>
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" /> <ui:SettingsCard Margin="0 4 0 0" Header="{DynamicResource Date}">
</StackPanel> <ui:SettingsCard.HeaderIcon>
</cc:Card> <ui:FontIcon Glyph="&#xe787;" />
</cc:CardGroup> </ui:SettingsCard.HeaderIcon>
<StackPanel Orientation="Horizontal">
<TextBlock
VerticalAlignment="Center"
FontSize="14"
Foreground="{DynamicResource Color04B}"
Text="{Binding DateText}" />
<ComboBox
MinWidth="180"
Margin="10 0 18 0"
VerticalAlignment="Center"
FontSize="14"
ItemsSource="{Binding DateFormatList}"
SelectedItem="{Binding DateFormat}" />
<ui:ToggleSwitch
IsOn="{Binding UseDate}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</StackPanel>
</ui:SettingsCard>
<!-- Placeholder text --> <!-- Placeholder text -->
<cc:ExCard <ui:SettingsExpander
Title="{DynamicResource ShowPlaceholder}"
Margin="0 4 0 0" Margin="0 4 0 0"
Icon="&#xea80;" Description="{DynamicResource ShowPlaceholderTip}"
Sub="{DynamicResource ShowPlaceholderTip}"> Header="{DynamicResource ShowPlaceholder}">
<cc:ExCard.SideContent> <ui:SettingsExpander.HeaderIcon>
<ui:ToggleSwitch <ui:FontIcon Glyph="&#xea80;" />
IsOn="{Binding ShowPlaceholder}" </ui:SettingsExpander.HeaderIcon>
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" /> <ui:ToggleSwitch
</cc:ExCard.SideContent> IsOn="{Binding ShowPlaceholder}"
<cc:Card OffContent="{DynamicResource disable}"
Title="{DynamicResource PlaceholderText}" OnContent="{DynamicResource enable}" />
Sub="{Binding PlaceholderTextTip}"
Type="InsideFit"> <ui:SettingsExpander.Items>
<TextBox <ui:SettingsCard Description="{Binding PlaceholderTextTip}" Header="{DynamicResource PlaceholderText}">
MinWidth="150" <TextBox
Text="{Binding PlaceholderText}" MinWidth="150"
TextWrapping="NoWrap" /> Text="{Binding PlaceholderText}"
</cc:Card> TextWrapping="NoWrap" />
</cc:ExCard> </ui:SettingsCard>
</ui:SettingsExpander.Items>
</ui:SettingsExpander>
<!-- Animation --> <!-- Animation -->
<cc:ExCard <ui:SettingsExpander
Title="{DynamicResource Animation}"
Margin="0 18 0 0" Margin="0 18 0 0"
Icon="&#xedb5;" Description="{DynamicResource AnimationTip}"
Sub="{DynamicResource AnimationTip}"> Header="{DynamicResource Animation}">
<cc:ExCard.SideContent> <ui:SettingsExpander.HeaderIcon>
<ui:ToggleSwitch <ui:FontIcon Glyph="&#xedb5;" />
IsOn="{Binding UseAnimation}" </ui:SettingsExpander.HeaderIcon>
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</cc:ExCard.SideContent>
<cc:Card
Title="{DynamicResource AnimationSpeed}"
Sub="{DynamicResource AnimationSpeedTip}"
Type="InsideFit">
<StackPanel Orientation="Horizontal">
<ComboBox
MinWidth="160"
VerticalAlignment="Center"
DisplayMemberPath="Display"
FontSize="14"
ItemsSource="{Binding AnimationSpeeds}"
SelectedValue="{Binding Settings.AnimationSpeed}"
SelectedValuePath="Value" />
<TextBox <ui:ToggleSwitch
MinWidth="80" IsOn="{Binding UseAnimation}"
Margin="18 0 0 0" OffContent="{DynamicResource disable}"
Text="{Binding Settings.CustomAnimationLength}" OnContent="{DynamicResource enable}" />
TextWrapping="NoWrap"
Visibility="{ext:VisibleWhen {Binding Settings.AnimationSpeed}, <ui:SettingsExpander.Items>
IsEqualTo={x:Static userSettings:AnimationSpeeds.Custom}}" /> <ui:SettingsCard Description="{DynamicResource AnimationSpeedTip}" Header="{DynamicResource AnimationSpeed}">
</StackPanel> <StackPanel Orientation="Horizontal">
</cc:Card> <ComboBox
</cc:ExCard> MinWidth="160"
VerticalAlignment="Center"
DisplayMemberPath="Display"
FontSize="14"
ItemsSource="{Binding AnimationSpeeds}"
SelectedValue="{Binding Settings.AnimationSpeed}"
SelectedValuePath="Value" />
<TextBox
MinWidth="80"
Margin="18 0 0 0"
Text="{Binding Settings.CustomAnimationLength}"
TextWrapping="NoWrap"
Visibility="{ext:VisibleWhen {Binding Settings.AnimationSpeed},
IsEqualTo={x:Static userSettings:AnimationSpeeds.Custom}}" />
</StackPanel>
</ui:SettingsCard>
</ui:SettingsExpander.Items>
</ui:SettingsExpander>
<!-- SFX --> <!-- SFX -->
<cc:ExCard <ui:SettingsExpander
Title="{DynamicResource SoundEffect}"
Margin="0 4 0 0" Margin="0 4 0 0"
Icon="&#xe7f5;" Description="{DynamicResource SoundEffectTip}"
Sub="{DynamicResource SoundEffectTip}"> Header="{DynamicResource SoundEffect}">
<cc:ExCard.SideContent> <ui:SettingsExpander.HeaderIcon>
<ui:ToggleSwitch <ui:FontIcon Glyph="&#xe7f5;" />
IsOn="{Binding UseSound}" </ui:SettingsExpander.HeaderIcon>
OffContent="{DynamicResource disable}" <ui:ToggleSwitch
OnContent="{DynamicResource enable}" /> IsOn="{Binding UseSound}"
</cc:ExCard.SideContent> OffContent="{DynamicResource disable}"
<cc:Card OnContent="{DynamicResource enable}" />
Title="{DynamicResource SoundEffectVolume}"
IsEnabled="{Binding EnableVolumeAdjustment}" <ui:SettingsExpander.Items>
Sub="{DynamicResource SoundEffectVolumeTip}" <ui:SettingsCard
Type="InsideFit"> Description="{DynamicResource SoundEffectVolumeTip}"
<StackPanel Orientation="Horizontal"> Header="{DynamicResource SoundEffectVolume}"
<TextBlock IsEnabled="{Binding EnableVolumeAdjustment}">
Margin="0 0 8 0" <StackPanel Orientation="Horizontal">
VerticalAlignment="Center" <TextBlock
Text="{Binding SoundEffectVolume}" /> Margin="0 0 8 0"
<Slider VerticalAlignment="Center"
Width="250" Text="{Binding SoundEffectVolume}" />
VerticalAlignment="Center" <Slider
IsMoveToPointEnabled="True" Width="250"
IsSnapToTickEnabled="True" VerticalAlignment="Center"
Maximum="100" IsMoveToPointEnabled="True"
Minimum="0" IsSnapToTickEnabled="True"
TickFrequency="1" Maximum="100"
Value="{Binding SoundEffectVolume}" /> Minimum="0"
</StackPanel> TickFrequency="1"
</cc:Card> Value="{Binding SoundEffectVolume}" />
</cc:ExCard> </StackPanel>
</ui:SettingsCard>
</ui:SettingsExpander.Items>
</ui:SettingsExpander>
<!-- WMP warning -->
<Border <Border
Name="WMPWarning" Name="WMPWarning"
Padding="0 10" Padding="0 10"
@ -736,42 +747,50 @@
</Border> </Border>
<!-- Fonts and icons --> <!-- Fonts and icons -->
<cc:Card <ui:SettingsCard
Title="{DynamicResource useGlyphUI}"
Margin="0 18 0 0" Margin="0 18 0 0"
Icon="&#xf6b8;" Description="{DynamicResource useGlyphUIEffect}"
Sub="{DynamicResource useGlyphUIEffect}"> Header="{DynamicResource useGlyphUI}">
<ui:SettingsCard.HeaderIcon>
<ui:FontIcon Glyph="&#xf6b8;" />
</ui:SettingsCard.HeaderIcon>
<ui:ToggleSwitch <ui:ToggleSwitch
IsOn="{Binding UseGlyphIcons}" IsOn="{Binding UseGlyphIcons}"
OffContent="{DynamicResource disable}" OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" /> OnContent="{DynamicResource enable}" />
</cc:Card> </ui:SettingsCard>
<!-- Badges --> <!-- Badges -->
<cc:ExCard <ui:SettingsExpander
Title="{DynamicResource showBadges}"
Margin="0 4 0 0" Margin="0 4 0 0"
Icon="&#xEC1B;" Description="{DynamicResource showBadgesToolTip}"
Sub="{DynamicResource showBadgesToolTip}"> Header="{DynamicResource showBadges}">
<cc:ExCard.SideContent> <ui:SettingsExpander.HeaderIcon>
<ui:ToggleSwitch <ui:FontIcon Glyph="&#xEC1B;" />
IsOn="{Binding Settings.ShowBadges}" </ui:SettingsExpander.HeaderIcon>
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" /> <ui:ToggleSwitch
</cc:ExCard.SideContent> IsOn="{Binding Settings.ShowBadges}"
<cc:Card Title="{DynamicResource showBadgesGlobalOnly}" Type="InsideFit"> OffContent="{DynamicResource disable}"
<ui:ToggleSwitch OnContent="{DynamicResource enable}" />
IsOn="{Binding Settings.ShowBadgesGlobalOnly}"
OffContent="{DynamicResource disable}" <ui:SettingsExpander.Items>
OnContent="{DynamicResource enable}" /> <ui:SettingsCard Header="{DynamicResource showBadgesGlobalOnly}">
</cc:Card> <ui:ToggleSwitch
</cc:ExCard> IsOn="{Binding Settings.ShowBadgesGlobalOnly}"
OffContent="{DynamicResource disable}"
OnContent="{DynamicResource enable}" />
</ui:SettingsCard>
</ui:SettingsExpander.Items>
</ui:SettingsExpander>
<!-- Settings color scheme --> <!-- Settings color scheme -->
<cc:Card <ui:SettingsCard Margin="0 14 0 0" Header="{DynamicResource ColorScheme}">
Title="{DynamicResource ColorScheme}" <ui:SettingsCard.HeaderIcon>
Margin="0 14 0 0" <ui:FontIcon Glyph="&#xe793;" />
Icon="&#xe793;"> </ui:SettingsCard.HeaderIcon>
<ComboBox <ComboBox
MinWidth="180" MinWidth="180"
DisplayMemberPath="Display" DisplayMemberPath="Display"
@ -779,25 +798,26 @@
ItemsSource="{Binding ColorSchemes}" ItemsSource="{Binding ColorSchemes}"
SelectedValue="{Binding ColorScheme, Mode=TwoWay}" SelectedValue="{Binding ColorScheme, Mode=TwoWay}"
SelectedValuePath="Value" /> SelectedValuePath="Value" />
</cc:Card> </ui:SettingsCard>
<!-- Theme folder --> <!-- Theme folder -->
<cc:Card <ui:SettingsCard Margin="0 14 0 0" Header="{DynamicResource ThemeFolder}">
Title="{DynamicResource ThemeFolder}" <ui:SettingsCard.HeaderIcon>
Margin="0 14 0 0" <ui:FontIcon Glyph="&#xe838;" />
Icon="&#xe838;"> </ui:SettingsCard.HeaderIcon>
<Button <Button
MinWidth="180" MinWidth="180"
Command="{Binding OpenThemesFolderCommand}" Command="{Binding OpenThemesFolderCommand}"
Content="{DynamicResource OpenThemeFolder}" /> Content="{DynamicResource OpenThemeFolder}" />
</cc:Card> </ui:SettingsCard>
<!-- How to create theme link --> <!-- How to create theme link -->
<cc:HyperLink <ui:HyperlinkButton
Margin="10 10 10 28" Margin="10 10 0 28"
HorizontalAlignment="Right" HorizontalAlignment="Right"
Text="{DynamicResource howToCreateTheme}" Content="{DynamicResource howToCreateTheme}"
Uri="{Binding LinkHowToCreateTheme}" /> NavigateUri="{Binding LinkHowToCreateTheme}" />
</StackPanel> </StackPanel>
</ScrollViewer> </ui:ScrollViewerEx>
</ui:Page> </ui:Page>

View file

@ -4,7 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:vm="clr-namespace:Flow.Launcher.ViewModel" xmlns:vm="clr-namespace:Flow.Launcher.ViewModel"
Title="{DynamicResource flowlauncher_settings}" Title="{DynamicResource flowlauncher_settings}"
Width="{Binding SettingWindowWidth, Mode=TwoWay}" Width="{Binding SettingWindowWidth, Mode=TwoWay}"
@ -266,8 +266,5 @@
</ui:NavigationView> </ui:NavigationView>
</Grid> </Grid>
</Border> </Border>
</Grid> </Grid>
</Window> </Window>

View file

@ -3,14 +3,13 @@ using System.ComponentModel;
using System.Windows; using System.Windows;
using System.Windows.Controls; using System.Windows.Controls;
using System.Windows.Input; using System.Windows.Input;
using System.Windows.Interop;
using CommunityToolkit.Mvvm.DependencyInjection; using CommunityToolkit.Mvvm.DependencyInjection;
using Flow.Launcher.Infrastructure; using Flow.Launcher.Infrastructure;
using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin.SharedModels; using Flow.Launcher.Plugin.SharedModels;
using Flow.Launcher.SettingPages.Views; using Flow.Launcher.SettingPages.Views;
using Flow.Launcher.ViewModel; using Flow.Launcher.ViewModel;
using ModernWpf.Controls; using iNKORE.UI.WPF.Modern.Controls;
namespace Flow.Launcher; namespace Flow.Launcher;
@ -43,12 +42,6 @@ public partial class SettingWindow
{ {
RefreshMaximizeRestoreButton(); RefreshMaximizeRestoreButton();
// Fix (workaround) for the window freezes after lock screen (Win+L) or sleep
// https://stackoverflow.com/questions/4951058/software-rendering-mode-wpf
HwndSource hwndSource = PresentationSource.FromVisual(this) as HwndSource;
HwndTarget hwndTarget = hwndSource.CompositionTarget;
hwndTarget.RenderMode = RenderMode.SoftwareOnly; // Must use software only render mode here
UpdatePositionAndState(); UpdatePositionAndState();
_viewModel.PropertyChanged += ViewModel_PropertyChanged; _viewModel.PropertyChanged += ViewModel_PropertyChanged;

View file

@ -1,7 +1,9 @@
<ResourceDictionary <ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:cc="clr-namespace:Flow.Launcher.Resources.Controls;assembly=Flow.Launcher"
xmlns:system="clr-namespace:System;assembly=mscorlib" xmlns:system="clr-namespace:System;assembly=mscorlib"
xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure"> xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure">
<CornerRadius x:Key="ItemRadius">0</CornerRadius> <CornerRadius x:Key="ItemRadius">0</CornerRadius>
<Thickness x:Key="ItemMargin">0</Thickness> <Thickness x:Key="ItemMargin">0</Thickness>
@ -46,20 +48,20 @@
BorderBrush="{TemplateBinding BorderBrush}" BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}" BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="True"> SnapsToDevicePixels="True">
<ScrollViewer <ui:ScrollViewerEx
x:Name="PART_ContentHost" x:Name="PART_ContentHost"
Background="{TemplateBinding Background}" Background="{TemplateBinding Background}"
Focusable="false" Focusable="false"
HorizontalScrollBarVisibility="Hidden" HorizontalScrollBarVisibility="Hidden"
VerticalScrollBarVisibility="Hidden"> VerticalScrollBarVisibility="Hidden">
<ScrollViewer.ContentTemplate> <ui:ScrollViewerEx.ContentTemplate>
<DataTemplate> <DataTemplate>
<Grid Background="{Binding Background, ElementName=PART_ContentHost}"> <Grid Background="{Binding Background, ElementName=PART_ContentHost}">
<ContentPresenter Content="{Binding Path=Content, ElementName=PART_ContentHost}" /> <ContentPresenter Content="{Binding Path=Content, ElementName=PART_ContentHost}" />
</Grid> </Grid>
</DataTemplate> </DataTemplate>
</ScrollViewer.ContentTemplate> </ui:ScrollViewerEx.ContentTemplate>
</ScrollViewer> </ui:ScrollViewerEx>
</Border> </Border>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
@ -250,9 +252,12 @@
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="ListBox"> <ControlTemplate TargetType="ListBox">
<ScrollViewer Focusable="false" Template="{DynamicResource ScrollViewerControlTemplate}"> <cc:CustomScrollViewerEx
<ScrollViewer.Style> x:Name="ListBoxScrollViewer"
<Style TargetType="ScrollViewer"> Focusable="False"
Template="{DynamicResource ScrollViewerControlTemplate}">
<cc:CustomScrollViewerEx.Style>
<Style TargetType="cc:CustomScrollViewerEx">
<Style.Triggers> <Style.Triggers>
<Trigger Property="ComputedVerticalScrollBarVisibility" Value="Visible"> <Trigger Property="ComputedVerticalScrollBarVisibility" Value="Visible">
<Setter Property="Margin" Value="0 0 0 0" /> <Setter Property="Margin" Value="0 0 0 0" />
@ -264,9 +269,9 @@
</Trigger> </Trigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
</ScrollViewer.Style> </cc:CustomScrollViewerEx.Style>
<VirtualizingStackPanel IsItemsHost="True" /> <VirtualizingStackPanel IsItemsHost="True" />
</ScrollViewer> </cc:CustomScrollViewerEx>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>

View file

@ -6,7 +6,7 @@
<ResourceDictionary <ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:m="http://schemas.modernwpf.com/2019" xmlns:m="clr-namespace:iNKORE.UI.WPF.Modern.Markup;assembly=iNKORE.UI.WPF.Modern"
xmlns:system="clr-namespace:System;assembly=mscorlib"> xmlns:system="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>

View file

@ -33,7 +33,7 @@
x:Key="QueryBoxStyle" x:Key="QueryBoxStyle"
BasedOn="{StaticResource BaseQueryBoxStyle}" BasedOn="{StaticResource BaseQueryBoxStyle}"
TargetType="{x:Type TextBox}"> TargetType="{x:Type TextBox}">
<Setter Property="Padding" Value="0,0,50,0" /> <Setter Property="Padding" Value="0 0 50 0" />
<Setter Property="CaretBrush" Value="#336766" /> <Setter Property="CaretBrush" Value="#336766" />
<Setter Property="Foreground" Value="#e7e9eb" /> <Setter Property="Foreground" Value="#e7e9eb" />
<Setter Property="FontSize" Value="18" /> <Setter Property="FontSize" Value="18" />
@ -44,7 +44,7 @@
x:Key="QuerySuggestionBoxStyle" x:Key="QuerySuggestionBoxStyle"
BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}" BasedOn="{StaticResource BaseQuerySuggestionBoxStyle}"
TargetType="{x:Type TextBox}"> TargetType="{x:Type TextBox}">
<Setter Property="Padding" Value="0,0,50,0" /> <Setter Property="Padding" Value="0 0 50 0" />
<Setter Property="Background" Value="Transparent" /> <Setter Property="Background" Value="Transparent" />
<Setter Property="Height" Value="38" /> <Setter Property="Height" Value="38" />
<Setter Property="FontSize" Value="18" /> <Setter Property="FontSize" Value="18" />
@ -90,7 +90,7 @@
TargetType="{x:Type Rectangle}"> TargetType="{x:Type Rectangle}">
<Setter Property="Fill" Value="#1e292f" /> <Setter Property="Fill" Value="#1e292f" />
<Setter Property="Height" Value="1" /> <Setter Property="Height" Value="1" />
<Setter Property="Margin" Value="0,0,0,4" /> <Setter Property="Margin" Value="0 0 0 4" />
</Style> </Style>
<Style x:Key="HighlightStyle" /> <Style x:Key="HighlightStyle" />
<Style <Style
@ -142,7 +142,7 @@
<Setter Property="Background" Value="Transparent" /> <Setter Property="Background" Value="Transparent" />
<Setter Property="Width" Value="32" /> <Setter Property="Width" Value="32" />
<Setter Property="Height" Value="32" /> <Setter Property="Height" Value="32" />
<Setter Property="Margin" Value="0,8,8,0" /> <Setter Property="Margin" Value="0 8 8 0" />
<Setter Property="HorizontalAlignment" Value="Right" /> <Setter Property="HorizontalAlignment" Value="Right" />
</Style> </Style>
@ -169,7 +169,7 @@
x:Key="ClockPanel" x:Key="ClockPanel"
BasedOn="{StaticResource ClockPanel}" BasedOn="{StaticResource ClockPanel}"
TargetType="{x:Type StackPanel}"> TargetType="{x:Type StackPanel}">
<Setter Property="Margin" Value="0,0,54,0" /> <Setter Property="Margin" Value="0 0 54 0" />
</Style> </Style>
<Style <Style
x:Key="ClockBox" x:Key="ClockBox"
@ -188,7 +188,7 @@
BasedOn="{StaticResource BasePreviewBorderStyle}" BasedOn="{StaticResource BasePreviewBorderStyle}"
TargetType="{x:Type Border}"> TargetType="{x:Type Border}">
<Setter Property="BorderBrush" Value="#1e292f" /> <Setter Property="BorderBrush" Value="#1e292f" />
<Setter Property="Margin" Value="0,0,10,4" /> <Setter Property="Margin" Value="0 0 10 4" />
</Style> </Style>
<Style <Style
x:Key="PreviewItemTitleStyle" x:Key="PreviewItemTitleStyle"

View file

@ -21,7 +21,7 @@
<Setter Property="Foreground" Value="#f8f8f2" /> <Setter Property="Foreground" Value="#f8f8f2" />
<Setter Property="CaretBrush" Value="#ffb86c" /> <Setter Property="CaretBrush" Value="#ffb86c" />
<Setter Property="FontSize" Value="26" /> <Setter Property="FontSize" Value="26" />
<Setter Property="Padding" Value="0,0,66,0" /> <Setter Property="Padding" Value="0 0 66 0" />
<Setter Property="Height" Value="42" /> <Setter Property="Height" Value="42" />
</Style> </Style>
<Style <Style
@ -30,7 +30,7 @@
TargetType="{x:Type TextBox}"> TargetType="{x:Type TextBox}">
<Setter Property="Foreground" Value="#6272a4" /> <Setter Property="Foreground" Value="#6272a4" />
<Setter Property="FontSize" Value="26" /> <Setter Property="FontSize" Value="26" />
<Setter Property="Padding" Value="0,0,66,0" /> <Setter Property="Padding" Value="0 0 66 0" />
<Setter Property="Height" Value="42" /> <Setter Property="Height" Value="42" />
</Style> </Style>
<Style <Style
@ -143,7 +143,7 @@
TargetType="{x:Type Rectangle}"> TargetType="{x:Type Rectangle}">
<Setter Property="Fill" Value="#44475a" /> <Setter Property="Fill" Value="#44475a" />
<Setter Property="Height" Value="1" /> <Setter Property="Height" Value="1" />
<Setter Property="Margin" Value="12,0,12,6" /> <Setter Property="Margin" Value="12 0 12 6" />
</Style> </Style>
<Style <Style
x:Key="SearchIconStyle" x:Key="SearchIconStyle"

View file

@ -69,7 +69,7 @@
TargetType="{x:Type Rectangle}"> TargetType="{x:Type Rectangle}">
<Setter Property="Fill" Value="#747881" /> <Setter Property="Fill" Value="#747881" />
<Setter Property="Height" Value="1" /> <Setter Property="Height" Value="1" />
<Setter Property="Margin" Value="0,0,0,0" /> <Setter Property="Margin" Value="0 0 0 0" />
</Style> </Style>
<Style x:Key="HighlightStyle"> <Style x:Key="HighlightStyle">
<Setter Property="Inline.FontWeight" Value="Bold" /> <Setter Property="Inline.FontWeight" Value="Bold" />
@ -122,7 +122,7 @@
<Setter Property="Background" Value="#686d77" /> <Setter Property="Background" Value="#686d77" />
<Setter Property="Width" Value="32" /> <Setter Property="Width" Value="32" />
<Setter Property="Height" Value="32" /> <Setter Property="Height" Value="32" />
<Setter Property="Margin" Value="0,8,8,0" /> <Setter Property="Margin" Value="0 8 8 0" />
<Setter Property="HorizontalAlignment" Value="Right" /> <Setter Property="HorizontalAlignment" Value="Right" />
</Style> </Style>
@ -149,7 +149,7 @@
x:Key="ClockPanel" x:Key="ClockPanel"
BasedOn="{StaticResource ClockPanel}" BasedOn="{StaticResource ClockPanel}"
TargetType="{x:Type StackPanel}"> TargetType="{x:Type StackPanel}">
<Setter Property="Margin" Value="0,0,54,0" /> <Setter Property="Margin" Value="0 0 54 0" />
</Style> </Style>
<Style <Style
x:Key="ClockBox" x:Key="ClockBox"
@ -168,7 +168,7 @@
BasedOn="{StaticResource BasePreviewBorderStyle}" BasedOn="{StaticResource BasePreviewBorderStyle}"
TargetType="{x:Type Border}"> TargetType="{x:Type Border}">
<Setter Property="BorderBrush" Value="#747881" /> <Setter Property="BorderBrush" Value="#747881" />
<Setter Property="Margin" Value="0,0,10,0" /> <Setter Property="Margin" Value="0 0 10 0" />
</Style> </Style>
<Style x:Key="WindowRadius" TargetType="{x:Type Border}"> <Style x:Key="WindowRadius" TargetType="{x:Type Border}">
<Setter Property="CornerRadius" Value="0" /> <Setter Property="CornerRadius" Value="0" />

View file

@ -21,7 +21,7 @@
<Setter Property="CaretBrush" Value="#FFAA47" /> <Setter Property="CaretBrush" Value="#FFAA47" />
<Setter Property="FontSize" Value="26" /> <Setter Property="FontSize" Value="26" />
<Setter Property="Height" Value="42" /> <Setter Property="Height" Value="42" />
<Setter Property="Padding" Value="0,0,66,0" /> <Setter Property="Padding" Value="0 0 66 0" />
</Style> </Style>
<Style <Style
x:Key="QuerySuggestionBoxStyle" x:Key="QuerySuggestionBoxStyle"
@ -30,7 +30,7 @@
<Setter Property="Foreground" Value="#798189" /> <Setter Property="Foreground" Value="#798189" />
<Setter Property="FontSize" Value="26" /> <Setter Property="FontSize" Value="26" />
<Setter Property="Height" Value="42" /> <Setter Property="Height" Value="42" />
<Setter Property="Padding" Value="0,0,66,0" /> <Setter Property="Padding" Value="0 0 66 0" />
</Style> </Style>
<Style <Style
x:Key="WindowBorderStyle" x:Key="WindowBorderStyle"
@ -141,7 +141,7 @@
TargetType="{x:Type Rectangle}"> TargetType="{x:Type Rectangle}">
<Setter Property="Fill" Value="#3c454e" /> <Setter Property="Fill" Value="#3c454e" />
<Setter Property="Height" Value="1" /> <Setter Property="Height" Value="1" />
<Setter Property="Margin" Value="0,0,0,8" /> <Setter Property="Margin" Value="0 0 0 8" />
</Style> </Style>
<Style <Style
x:Key="SearchIconStyle" x:Key="SearchIconStyle"

View file

@ -6,7 +6,7 @@
<ResourceDictionary <ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:m="http://schemas.modernwpf.com/2019" xmlns:m="clr-namespace:iNKORE.UI.WPF.Modern.Markup;assembly=iNKORE.UI.WPF.Modern"
xmlns:system="clr-namespace:System;assembly=mscorlib"> xmlns:system="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" /> <ResourceDictionary Source="pack://application:,,,/Themes/Base.xaml" />

View file

@ -6,7 +6,7 @@
<ResourceDictionary <ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:m="http://schemas.modernwpf.com/2019" xmlns:m="clr-namespace:iNKORE.UI.WPF.Modern.Markup;assembly=iNKORE.UI.WPF.Modern"
xmlns:system="clr-namespace:System;assembly=mscorlib"> xmlns:system="clr-namespace:System;assembly=mscorlib">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>

View file

@ -23,8 +23,8 @@ using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Plugin; using Flow.Launcher.Plugin;
using Flow.Launcher.Plugin.SharedCommands; using Flow.Launcher.Plugin.SharedCommands;
using Flow.Launcher.Storage; using Flow.Launcher.Storage;
using iNKORE.UI.WPF.Modern;
using Microsoft.VisualStudio.Threading; using Microsoft.VisualStudio.Threading;
using ModernWpf;
namespace Flow.Launcher.ViewModel namespace Flow.Launcher.ViewModel
{ {

View file

@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:Flow.Launcher" xmlns:local="clr-namespace:Flow.Launcher"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:vm="clr-namespace:Flow.Launcher.ViewModel" xmlns:vm="clr-namespace:Flow.Launcher.ViewModel"
Name="FlowWelcomeWindow" Name="FlowWelcomeWindow"
Title="{DynamicResource Welcome_Page1_Title}" Title="{DynamicResource Welcome_Page1_Title}"
@ -82,10 +82,7 @@
<ui:Frame <ui:Frame
x:Name="ContentFrame" x:Name="ContentFrame"
HorizontalAlignment="Stretch" HorizontalAlignment="Stretch"
Loaded="ContentFrame_Loaded" Loaded="ContentFrame_Loaded">
ScrollViewer.CanContentScroll="True"
ScrollViewer.HorizontalScrollBarVisibility="Visible"
ScrollViewer.VerticalScrollBarVisibility="Visible">
<ui:Frame.ContentTransitions> <ui:Frame.ContentTransitions>
<ui:TransitionCollection> <ui:TransitionCollection>
<ui:NavigationThemeTransition /> <ui:NavigationThemeTransition />

View file

@ -6,7 +6,7 @@ using CommunityToolkit.Mvvm.DependencyInjection;
using Flow.Launcher.Infrastructure.UserSettings; using Flow.Launcher.Infrastructure.UserSettings;
using Flow.Launcher.Resources.Pages; using Flow.Launcher.Resources.Pages;
using Flow.Launcher.ViewModel; using Flow.Launcher.ViewModel;
using ModernWpf.Media.Animation; using iNKORE.UI.WPF.Modern.Media.Animation;
namespace Flow.Launcher namespace Flow.Launcher
{ {

View file

@ -26,6 +26,15 @@
"resolved": "6.9.3", "resolved": "6.9.3",
"contentHash": "1CUGgFdyECDKgi5HaUBhdv6k+VG9Iy4OCforGfHyar3xQXAJypZkzymgKtWj/4SPd6nSG0Qi7NH71qHrDSZLaA==" "contentHash": "1CUGgFdyECDKgi5HaUBhdv6k+VG9Iy4OCforGfHyar3xQXAJypZkzymgKtWj/4SPd6nSG0Qi7NH71qHrDSZLaA=="
}, },
"iNKORE.UI.WPF.Modern": {
"type": "Direct",
"requested": "[0.10.1, )",
"resolved": "0.10.1",
"contentHash": "nRYmBosiL+42eUpLbHeqP7qJqtp5EpzuIMZTpvq4mFV33VB/JjkFg1y82gk50pjkXlAQWDvRyrfSAmPR5AM+3g==",
"dependencies": {
"iNKORE.UI.WPF": "1.2.8"
}
},
"MdXaml": { "MdXaml": {
"type": "Direct", "type": "Direct",
"requested": "[1.27.0, )", "requested": "[1.27.0, )",
@ -126,12 +135,6 @@
"System.ValueTuple": "4.5.0" "System.ValueTuple": "4.5.0"
} }
}, },
"ModernWpfUI": {
"type": "Direct",
"requested": "[0.9.4, )",
"resolved": "0.9.4",
"contentHash": "HJ07Be9KOiGKGcMLz/AwY+84h3yGHRPuYpYXCE6h1yPtaFwGMWfanZ70jX7W5XWx8+Qk1vGox+WGKgxxsy6EHw=="
},
"PropertyChanged.Fody": { "PropertyChanged.Fody": {
"type": "Direct", "type": "Direct",
"requested": "[4.1.0, )", "requested": "[4.1.0, )",
@ -215,6 +218,11 @@
"resolved": "2.5.2", "resolved": "2.5.2",
"contentHash": "hp3gKmC/14+6eKLgv7Jd1Z7OV86lO+tNfOXr/stQbwmRhdQuXVSvrRAuAe7G5+lwhkov0XkqZ8/bn1PYWMx6eg==" "contentHash": "hp3gKmC/14+6eKLgv7Jd1Z7OV86lO+tNfOXr/stQbwmRhdQuXVSvrRAuAe7G5+lwhkov0XkqZ8/bn1PYWMx6eg=="
}, },
"iNKORE.UI.WPF": {
"type": "Transitive",
"resolved": "1.2.8",
"contentHash": "7b+z25JFdhGAfyJqlVIF0vLbmgsRvqDZMvhGPTz20gzQigDPMqVUOoCCKB5824GtYsjFCYNilmaowb+4yWATkQ=="
},
"InputSimulator": { "InputSimulator": {
"type": "Transitive", "type": "Transitive",
"resolved": "1.0.4", "resolved": "1.0.4",

View file

@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:qa="clr-namespace:Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks" xmlns:qa="clr-namespace:Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
xmlns:viewModels="clr-namespace:Flow.Launcher.Plugin.Explorer.ViewModels" xmlns:viewModels="clr-namespace:Flow.Launcher.Plugin.Explorer.ViewModels"
d:DataContext="{d:DesignInstance viewModels:SettingsViewModel}" d:DataContext="{d:DesignInstance viewModels:SettingsViewModel}"
d:DesignHeight="450" d:DesignHeight="450"
@ -19,7 +19,7 @@
<DataTemplate x:Key="ListViewActionKeywords" DataType="{x:Type viewModels:ActionKeywordModel}"> <DataTemplate x:Key="ListViewActionKeywords" DataType="{x:Type viewModels:ActionKeywordModel}">
<Grid> <Grid>
<TextBlock <TextBlock
Margin="0 5 0 0" Margin="0 5 0 5"
IsEnabled="{Binding Enabled}" IsEnabled="{Binding Enabled}"
Text="{Binding LocalizedDescription, Mode=OneTime}"> Text="{Binding LocalizedDescription, Mode=OneTime}">
<TextBlock.Style> <TextBlock.Style>
@ -37,7 +37,7 @@
</TextBlock> </TextBlock>
<TextBlock <TextBlock
Margin="250 5 0 0" Margin="250 5 0 5"
IsEnabled="{Binding Enabled}" IsEnabled="{Binding Enabled}"
Text="{Binding Keyword}"> Text="{Binding Keyword}">
<TextBlock.Style> <TextBlock.Style>
@ -54,7 +54,7 @@
</TextBlock.Style> </TextBlock.Style>
</TextBlock> </TextBlock>
<TextBlock Margin="480 5 0 0"> <TextBlock Margin="480 5 0 5">
<TextBlock.Style> <TextBlock.Style>
<Style TargetType="{x:Type TextBlock}"> <Style TargetType="{x:Type TextBlock}">
<Style.Triggers> <Style.Triggers>
@ -103,7 +103,7 @@
ContentTemplate="{TemplateBinding HeaderTemplate}" ContentTemplate="{TemplateBinding HeaderTemplate}"
ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}" ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
DockPanel.Dock="Top" DockPanel.Dock="Top"
FocusVisualStyle="{StaticResource ExpanderHeaderFocusVisual}" FocusVisualStyle="{DynamicResource ExpanderHeaderFocusVisual}"
FontFamily="{TemplateBinding FontFamily}" FontFamily="{TemplateBinding FontFamily}"
FontSize="{TemplateBinding FontSize}" FontSize="{TemplateBinding FontSize}"
FontStretch="{TemplateBinding FontStretch}" FontStretch="{TemplateBinding FontStretch}"
@ -628,11 +628,10 @@
Grid.Column="1" Grid.Column="1"
Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}" Margin="{StaticResource SettingPanelItemLeftTopBottomMargin}"
VerticalAlignment="Center" VerticalAlignment="Center"
DisplayMemberPath="Display"
ItemsSource="{Binding AllEverythingSortOptions}" ItemsSource="{Binding AllEverythingSortOptions}"
SelectedValue="{Binding SelectedEverythingSortOption, Mode=TwoWay}" SelectedValue="{Binding SelectedEverythingSortOption, Mode=TwoWay}"
SelectedValuePath="Value" SelectedValuePath="Value" />
DisplayMemberPath="Display">
</ComboBox>
<TextBlock <TextBlock
Grid.Row="3" Grid.Row="3"

View file

@ -4,7 +4,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:ui="http://schemas.modernwpf.com/2019" xmlns:ui="http://schemas.inkore.net/lib/ui/wpf/modern"
Title="{DynamicResource flowlauncher_plugin_program_suffixes}" Title="{DynamicResource flowlauncher_plugin_program_suffixes}"
Width="600" Width="600"
Background="{DynamicResource PopuBGColor}" Background="{DynamicResource PopuBGColor}"

View file

@ -0,0 +1,25 @@
using System;
using System.Globalization;
using System.Windows.Data;
namespace Flow.Launcher.Plugin.Shell.Converters;
public class LeaveShellOpenOrCloseShellAfterPressEnabledConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
if (
values.Length != 2 ||
values[0] is not bool closeShellAfterPressOrLeaveShellOpen ||
values[1] is not Shell shell
)
return Binding.DoNothing;
return (!closeShellAfterPressOrLeaveShellOpen) && shell != Shell.RunCommand;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}

View file

@ -6,6 +6,7 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Threading.Tasks; using System.Threading.Tasks;
using Flow.Launcher.Plugin.SharedCommands; using Flow.Launcher.Plugin.SharedCommands;
using Flow.Launcher.Plugin.Shell.Views;
using WindowsInput; using WindowsInput;
using WindowsInput.Native; using WindowsInput.Native;
using Control = System.Windows.Controls.Control; using Control = System.Windows.Controls.Control;
@ -383,9 +384,16 @@ namespace Flow.Launcher.Plugin.Shell
Context = context; Context = context;
_settings = context.API.LoadSettingJsonStorage<Settings>(); _settings = context.API.LoadSettingJsonStorage<Settings>();
context.API.RegisterGlobalKeyboardCallback(API_GlobalKeyboardEvent); context.API.RegisterGlobalKeyboardCallback(API_GlobalKeyboardEvent);
// Since the old Settings class set default value of ShowOnlyMostUsedCMDsNumber to 0 which is a wrong value,
// we need to fix it here to make sure the default value is 5
// todo: remove this code block after release v2.2.0
if (_settings.ShowOnlyMostUsedCMDsNumber == 0)
{
_settings.ShowOnlyMostUsedCMDsNumber = 5;
}
} }
bool API_GlobalKeyboardEvent(int keyevent, int vkcode, SpecialKeyState state) private bool API_GlobalKeyboardEvent(int keyevent, int vkcode, SpecialKeyState state)
{ {
if (!Context.CurrentPluginMetadata.Disabled && _settings.ReplaceWinR) if (!Context.CurrentPluginMetadata.Disabled && _settings.ReplaceWinR)
{ {

View file

@ -1,24 +1,121 @@
using System.Collections.Generic; using System.Collections.Generic;
using Flow.Launcher.Localization.Attributes;
namespace Flow.Launcher.Plugin.Shell namespace Flow.Launcher.Plugin.Shell
{ {
public class Settings public class Settings : BaseModel
{ {
public Shell Shell { get; set; } = Shell.Cmd; private Shell _shell = Shell.Cmd;
public Shell Shell
{
get => _shell;
set
{
if (_shell != value)
{
_shell = value;
OnPropertyChanged();
}
}
}
public bool ReplaceWinR { get; set; } = false; private bool _replaceWinR = false;
public bool ReplaceWinR
{
get => _replaceWinR;
set
{
if (_replaceWinR != value)
{
_replaceWinR = value;
OnPropertyChanged();
}
}
}
public bool CloseShellAfterPress { get; set; } = false; private bool _closeShellAfterPress = false;
public bool CloseShellAfterPress
{
get => _closeShellAfterPress;
set
{
if (_closeShellAfterPress != value)
{
_closeShellAfterPress = value;
OnPropertyChanged();
}
}
}
public bool LeaveShellOpen { get; set; } private bool _leaveShellOpen;
public bool LeaveShellOpen
{
get => _leaveShellOpen;
set
{
if (_leaveShellOpen != value)
{
_leaveShellOpen = value;
OnPropertyChanged();
}
}
}
public bool RunAsAdministrator { get; set; } = true; private bool _runAsAdministrator = true;
public bool RunAsAdministrator
{
get => _runAsAdministrator;
set
{
if (_runAsAdministrator != value)
{
_runAsAdministrator = value;
OnPropertyChanged();
}
}
}
public bool UseWindowsTerminal { get; set; } = false; private bool _useWindowsTerminal = false;
public bool UseWindowsTerminal
{
get => _useWindowsTerminal;
set
{
if (_useWindowsTerminal != value)
{
_useWindowsTerminal = value;
OnPropertyChanged();
}
}
}
public bool ShowOnlyMostUsedCMDs { get; set; } private bool _showOnlyMostUsedCMDs;
public bool ShowOnlyMostUsedCMDs
{
get => _showOnlyMostUsedCMDs;
set
{
if (_showOnlyMostUsedCMDs != value)
{
_showOnlyMostUsedCMDs = value;
OnPropertyChanged();
}
}
}
public int ShowOnlyMostUsedCMDsNumber { get; set; } private int _showOnlyMostUsedCMDsNumber = 5;
public int ShowOnlyMostUsedCMDsNumber
{
get => _showOnlyMostUsedCMDsNumber;
set
{
if (_showOnlyMostUsedCMDsNumber != value)
{
_showOnlyMostUsedCMDsNumber = value;
OnPropertyChanged();
}
}
}
public Dictionary<string, int> CommandHistory { get; set; } = []; public Dictionary<string, int> CommandHistory { get; set; } = [];
@ -31,11 +128,19 @@ namespace Flow.Launcher.Plugin.Shell
} }
} }
[EnumLocalize]
public enum Shell public enum Shell
{ {
[EnumLocalizeValue("CMD")]
Cmd = 0, Cmd = 0,
[EnumLocalizeValue("PowerShell")]
Powershell = 1, Powershell = 1,
[EnumLocalizeValue("RunCommand")]
RunCommand = 2, RunCommand = 2,
[EnumLocalizeValue("Pwsh")]
Pwsh = 3, Pwsh = 3,
} }
} }

View file

@ -1,142 +0,0 @@
using System.Collections.Generic;
using System.Windows;
using System.Windows.Controls;
namespace Flow.Launcher.Plugin.Shell
{
public partial class CMDSetting : UserControl
{
private readonly Settings _settings;
public CMDSetting(Settings settings)
{
InitializeComponent();
_settings = settings;
}
private void CMDSetting_OnLoaded(object sender, RoutedEventArgs re)
{
ReplaceWinR.IsChecked = _settings.ReplaceWinR;
CloseShellAfterPress.IsChecked = _settings.CloseShellAfterPress;
LeaveShellOpen.IsChecked = _settings.LeaveShellOpen;
AlwaysRunAsAdministrator.IsChecked = _settings.RunAsAdministrator;
UseWindowsTerminal.IsChecked = _settings.UseWindowsTerminal;
LeaveShellOpen.IsEnabled = _settings.Shell != Shell.RunCommand;
ShowOnlyMostUsedCMDs.IsChecked = _settings.ShowOnlyMostUsedCMDs;
if (ShowOnlyMostUsedCMDs.IsChecked != true)
ShowOnlyMostUsedCMDsNumber.IsEnabled = false;
ShowOnlyMostUsedCMDsNumber.ItemsSource = new List<int>() { 5, 10, 20 };
if (_settings.ShowOnlyMostUsedCMDsNumber == 0)
{
ShowOnlyMostUsedCMDsNumber.SelectedIndex = 0;
_settings.ShowOnlyMostUsedCMDsNumber = (int)ShowOnlyMostUsedCMDsNumber.SelectedItem;
}
CloseShellAfterPress.Checked += (o, e) =>
{
_settings.CloseShellAfterPress = true;
LeaveShellOpen.IsChecked = false;
LeaveShellOpen.IsEnabled = false;
};
CloseShellAfterPress.Unchecked += (o, e) =>
{
_settings.CloseShellAfterPress = false;
LeaveShellOpen.IsEnabled = true;
};
LeaveShellOpen.Checked += (o, e) =>
{
_settings.LeaveShellOpen = true;
CloseShellAfterPress.IsChecked = false;
CloseShellAfterPress.IsEnabled = false;
};
LeaveShellOpen.Unchecked += (o, e) =>
{
_settings.LeaveShellOpen = false;
CloseShellAfterPress.IsEnabled = true;
};
AlwaysRunAsAdministrator.Checked += (o, e) =>
{
_settings.RunAsAdministrator = true;
};
AlwaysRunAsAdministrator.Unchecked += (o, e) =>
{
_settings.RunAsAdministrator = false;
};
UseWindowsTerminal.Checked += (o, e) =>
{
_settings.UseWindowsTerminal = true;
};
UseWindowsTerminal.Unchecked += (o, e) =>
{
_settings.UseWindowsTerminal = false;
};
ReplaceWinR.Checked += (o, e) =>
{
_settings.ReplaceWinR = true;
};
ReplaceWinR.Unchecked += (o, e) =>
{
_settings.ReplaceWinR = false;
};
ShellComboBox.SelectedIndex = _settings.Shell switch
{
Shell.Cmd => 0,
Shell.Powershell => 1,
Shell.Pwsh => 2,
_ => ShellComboBox.Items.Count - 1
};
ShellComboBox.SelectionChanged += (o, e) =>
{
_settings.Shell = ShellComboBox.SelectedIndex switch
{
0 => Shell.Cmd,
1 => Shell.Powershell,
2 => Shell.Pwsh,
_ => Shell.RunCommand
};
LeaveShellOpen.IsEnabled = _settings.Shell != Shell.RunCommand;
};
ShowOnlyMostUsedCMDs.Checked += (o, e) =>
{
_settings.ShowOnlyMostUsedCMDs = true;
ShowOnlyMostUsedCMDsNumber.IsEnabled = true;
};
ShowOnlyMostUsedCMDs.Unchecked += (o, e) =>
{
_settings.ShowOnlyMostUsedCMDs = false;
ShowOnlyMostUsedCMDsNumber.IsEnabled = false;
};
ShowOnlyMostUsedCMDsNumber.SelectedItem = _settings.ShowOnlyMostUsedCMDsNumber;
ShowOnlyMostUsedCMDsNumber.SelectionChanged += (o, e) =>
{
_settings.ShowOnlyMostUsedCMDsNumber = (int)ShowOnlyMostUsedCMDsNumber.SelectedItem;
};
}
}
}

View file

@ -0,0 +1,78 @@
using System.Collections.Generic;
namespace Flow.Launcher.Plugin.Shell.ViewModels;
public class ShellSettingViewModel : BaseModel
{
public Settings Settings { get; }
public List<ShellLocalized> AllShells { get; } = ShellLocalized.GetValues();
public Shell SelectedShell
{
get => Settings.Shell;
set
{
if (Settings.Shell != value)
{
Settings.Shell = value;
OnPropertyChanged();
}
}
}
public List<int> OnlyMostUsedCMDsNumbers { get; } = [5, 10, 20];
public int SelectedOnlyMostUsedCMDsNumber
{
get => Settings.ShowOnlyMostUsedCMDsNumber;
set
{
if (Settings.ShowOnlyMostUsedCMDsNumber != value)
{
Settings.ShowOnlyMostUsedCMDsNumber = value;
OnPropertyChanged();
}
}
}
public bool CloseShellAfterPress
{
get => Settings.CloseShellAfterPress;
set
{
if (Settings.CloseShellAfterPress != value)
{
Settings.CloseShellAfterPress = value;
OnPropertyChanged();
// Only allow CloseShellAfterPress to be true when LeaveShellOpen is false
if (value)
{
LeaveShellOpen = false;
}
}
}
}
public bool LeaveShellOpen
{
get => Settings.LeaveShellOpen;
set
{
if (Settings.LeaveShellOpen != value)
{
Settings.LeaveShellOpen = value;
OnPropertyChanged();
// Only allow LeaveShellOpen to be true when CloseShellAfterPress is false
if (value)
{
CloseShellAfterPress = false;
}
}
}
}
public ShellSettingViewModel(Settings settings)
{
Settings = settings;
}
}

View file

@ -1,13 +1,19 @@
<UserControl <UserControl
x:Class="Flow.Launcher.Plugin.Shell.CMDSetting" x:Class="Flow.Launcher.Plugin.Shell.Views.CMDSetting"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:converters="clr-namespace:Flow.Launcher.Plugin.Shell.Converters"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:vm="clr-namespace:Flow.Launcher.Plugin.Shell.ViewModels"
d:DataContext="{d:DesignInstance vm:ShellSettingViewModel}"
d:DesignHeight="300" d:DesignHeight="300"
d:DesignWidth="300" d:DesignWidth="300"
Loaded="CMDSetting_OnLoaded"
mc:Ignorable="d"> mc:Ignorable="d">
<UserControl.Resources>
<converters:LeaveShellOpenOrCloseShellAfterPressEnabledConverter x:Key="LeaveShellOpenOrCloseShellAfterPressEnabledConverter" />
</UserControl.Resources>
<Grid Margin="{StaticResource SettingPanelMargin}" VerticalAlignment="Top"> <Grid Margin="{StaticResource SettingPanelMargin}" VerticalAlignment="Top">
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition /> <RowDefinition />
@ -23,50 +29,72 @@
Grid.Row="0" Grid.Row="0"
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}" Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Content="{DynamicResource flowlauncher_plugin_cmd_relace_winr}" /> Content="{DynamicResource flowlauncher_plugin_cmd_relace_winr}"
IsChecked="{Binding Settings.ReplaceWinR, Mode=TwoWay}" />
<CheckBox <CheckBox
x:Name="CloseShellAfterPress" x:Name="CloseShellAfterPress"
Grid.Row="1" Grid.Row="1"
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}" Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Content="{DynamicResource flowlauncher_plugin_cmd_close_cmd_after_press}" /> Content="{DynamicResource flowlauncher_plugin_cmd_close_cmd_after_press}"
IsChecked="{Binding CloseShellAfterPress, Mode=TwoWay}">
<CheckBox.IsEnabled>
<MultiBinding Converter="{StaticResource LeaveShellOpenOrCloseShellAfterPressEnabledConverter}">
<Binding Mode="OneWay" Path="LeaveShellOpen" />
<Binding Mode="OneWay" Path="SelectedShell" />
</MultiBinding>
</CheckBox.IsEnabled>
</CheckBox>
<CheckBox <CheckBox
x:Name="LeaveShellOpen" x:Name="LeaveShellOpen"
Grid.Row="2" Grid.Row="2"
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}" Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Content="{DynamicResource flowlauncher_plugin_cmd_leave_cmd_open}" /> Content="{DynamicResource flowlauncher_plugin_cmd_leave_cmd_open}"
IsChecked="{Binding LeaveShellOpen, Mode=TwoWay}">
<CheckBox.IsEnabled>
<MultiBinding Converter="{StaticResource LeaveShellOpenOrCloseShellAfterPressEnabledConverter}">
<Binding Mode="OneWay" Path="CloseShellAfterPress" />
<Binding Mode="OneWay" Path="SelectedShell" />
</MultiBinding>
</CheckBox.IsEnabled>
</CheckBox>
<CheckBox <CheckBox
x:Name="AlwaysRunAsAdministrator" x:Name="AlwaysRunAsAdministrator"
Grid.Row="3" Grid.Row="3"
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}" Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Content="{DynamicResource flowlauncher_plugin_cmd_always_run_as_administrator}" /> Content="{DynamicResource flowlauncher_plugin_cmd_always_run_as_administrator}"
IsChecked="{Binding Settings.RunAsAdministrator, Mode=TwoWay}" />
<CheckBox <CheckBox
x:Name="UseWindowsTerminal" x:Name="UseWindowsTerminal"
Grid.Row="4" Grid.Row="4"
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}" Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
HorizontalAlignment="Left" HorizontalAlignment="Left"
Content="{DynamicResource flowlauncher_plugin_cmd_use_windows_terminal}" /> Content="{DynamicResource flowlauncher_plugin_cmd_use_windows_terminal}"
IsChecked="{Binding Settings.UseWindowsTerminal, Mode=TwoWay}" />
<ComboBox <ComboBox
x:Name="ShellComboBox" x:Name="ShellComboBox"
Grid.Row="5" Grid.Row="5"
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}" Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
HorizontalAlignment="Left"> HorizontalAlignment="Left"
<ComboBoxItem>CMD</ComboBoxItem> DisplayMemberPath="Display"
<ComboBoxItem>PowerShell</ComboBoxItem> ItemsSource="{Binding AllShells, Mode=OneTime}"
<ComboBoxItem>Pwsh</ComboBoxItem> SelectedValue="{Binding SelectedShell, Mode=TwoWay}"
<ComboBoxItem>RunCommand</ComboBoxItem> SelectedValuePath="Value" />
</ComboBox>
<StackPanel Grid.Row="6" Orientation="Horizontal"> <StackPanel Grid.Row="6" Orientation="Horizontal">
<CheckBox <CheckBox
x:Name="ShowOnlyMostUsedCMDs" x:Name="ShowOnlyMostUsedCMDs"
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}" Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
Content="{DynamicResource flowlauncher_plugin_cmd_history}" /> Content="{DynamicResource flowlauncher_plugin_cmd_history}"
IsChecked="{Binding Settings.ShowOnlyMostUsedCMDs, Mode=TwoWay}" />
<ComboBox <ComboBox
x:Name="ShowOnlyMostUsedCMDsNumber" x:Name="ShowOnlyMostUsedCMDsNumber"
Margin="{StaticResource SettingPanelItemRightTopBottomMargin}" Margin="{StaticResource SettingPanelItemRightTopBottomMargin}"
HorizontalAlignment="Left" /> HorizontalAlignment="Left"
IsEnabled="{Binding Settings.ShowOnlyMostUsedCMDs, Mode=OneWay}"
ItemsSource="{Binding OnlyMostUsedCMDsNumbers, Mode=OneTime}"
SelectedItem="{Binding SelectedOnlyMostUsedCMDsNumber, Mode=TwoWay}" />
</StackPanel> </StackPanel>
</Grid> </Grid>
</UserControl> </UserControl>

View file

@ -0,0 +1,15 @@
using System.Windows.Controls;
using Flow.Launcher.Plugin.Shell.ViewModels;
namespace Flow.Launcher.Plugin.Shell.Views
{
public partial class CMDSetting : UserControl
{
public CMDSetting(Settings settings)
{
var viewModel = new ShellSettingViewModel(settings);
DataContext = viewModel;
InitializeComponent();
}
}
}

View file

@ -210,13 +210,16 @@ namespace Flow.Launcher.Plugin.Sys
Localize.flowlauncher_plugin_sys_dlgtext_shutdown_computer(), Localize.flowlauncher_plugin_sys_dlgtext_shutdown_computer(),
Localize.flowlauncher_plugin_sys_shutdown_computer(), Localize.flowlauncher_plugin_sys_shutdown_computer(),
MessageBoxButton.YesNo, MessageBoxImage.Warning); MessageBoxButton.YesNo, MessageBoxImage.Warning);
if (result == MessageBoxResult.Yes) if (result == MessageBoxResult.Yes)
{
// Save settings before shutdown to avoid data loss
Context.API.SaveAppAllSettings();
if (EnableShutdownPrivilege()) if (EnableShutdownPrivilege())
PInvoke.ExitWindowsEx(EXIT_WINDOWS_FLAGS.EWX_SHUTDOWN | EXIT_WINDOWS_FLAGS.EWX_POWEROFF, REASON); PInvoke.ExitWindowsEx(EXIT_WINDOWS_FLAGS.EWX_SHUTDOWN | EXIT_WINDOWS_FLAGS.EWX_POWEROFF, REASON);
else else
Process.Start("shutdown", "/s /t 0"); Process.Start("shutdown", "/s /t 0");
}
return true; return true;
} }
}, },
@ -231,13 +234,16 @@ namespace Flow.Launcher.Plugin.Sys
Localize.flowlauncher_plugin_sys_dlgtext_restart_computer(), Localize.flowlauncher_plugin_sys_dlgtext_restart_computer(),
Localize.flowlauncher_plugin_sys_restart_computer(), Localize.flowlauncher_plugin_sys_restart_computer(),
MessageBoxButton.YesNo, MessageBoxImage.Warning); MessageBoxButton.YesNo, MessageBoxImage.Warning);
if (result == MessageBoxResult.Yes) if (result == MessageBoxResult.Yes)
{
// Save settings before restart to avoid data loss
Context.API.SaveAppAllSettings();
if (EnableShutdownPrivilege()) if (EnableShutdownPrivilege())
PInvoke.ExitWindowsEx(EXIT_WINDOWS_FLAGS.EWX_REBOOT, REASON); PInvoke.ExitWindowsEx(EXIT_WINDOWS_FLAGS.EWX_REBOOT, REASON);
else else
Process.Start("shutdown", "/r /t 0"); Process.Start("shutdown", "/r /t 0");
}
return true; return true;
} }
}, },
@ -252,13 +258,16 @@ namespace Flow.Launcher.Plugin.Sys
Localize.flowlauncher_plugin_sys_dlgtext_restart_computer_advanced(), Localize.flowlauncher_plugin_sys_dlgtext_restart_computer_advanced(),
Localize.flowlauncher_plugin_sys_restart_computer(), Localize.flowlauncher_plugin_sys_restart_computer(),
MessageBoxButton.YesNo, MessageBoxImage.Warning); MessageBoxButton.YesNo, MessageBoxImage.Warning);
if (result == MessageBoxResult.Yes) if (result == MessageBoxResult.Yes)
{
// Save settings before advanced restart to avoid data loss
Context.API.SaveAppAllSettings();
if (EnableShutdownPrivilege()) if (EnableShutdownPrivilege())
PInvoke.ExitWindowsEx(EXIT_WINDOWS_FLAGS.EWX_REBOOT | EXIT_WINDOWS_FLAGS.EWX_BOOTOPTIONS, REASON); PInvoke.ExitWindowsEx(EXIT_WINDOWS_FLAGS.EWX_REBOOT | EXIT_WINDOWS_FLAGS.EWX_BOOTOPTIONS, REASON);
else else
Process.Start("shutdown", "/r /o /t 0"); Process.Start("shutdown", "/r /o /t 0");
}
return true; return true;
} }
}, },
@ -273,10 +282,8 @@ namespace Flow.Launcher.Plugin.Sys
Localize.flowlauncher_plugin_sys_dlgtext_logoff_computer(), Localize.flowlauncher_plugin_sys_dlgtext_logoff_computer(),
Localize.flowlauncher_plugin_sys_log_off(), Localize.flowlauncher_plugin_sys_log_off(),
MessageBoxButton.YesNo, MessageBoxImage.Warning); MessageBoxButton.YesNo, MessageBoxImage.Warning);
if (result == MessageBoxResult.Yes) if (result == MessageBoxResult.Yes)
PInvoke.ExitWindowsEx(EXIT_WINDOWS_FLAGS.EWX_LOGOFF, REASON); PInvoke.ExitWindowsEx(EXIT_WINDOWS_FLAGS.EWX_LOGOFF, REASON);
return true; return true;
} }
}, },
@ -342,7 +349,6 @@ namespace Flow.Launcher.Plugin.Sys
Localize.flowlauncher_plugin_sys_dlgtitle_error(), Localize.flowlauncher_plugin_sys_dlgtitle_error(),
MessageBoxButton.OK, MessageBoxImage.Error); MessageBoxButton.OK, MessageBoxImage.Error);
} }
return true; return true;
} }
}, },
@ -416,13 +422,11 @@ namespace Flow.Launcher.Plugin.Sys
{ {
// Hide the window first then show msg after done because sometimes the reload could take a while, so not to make user think it's frozen. // Hide the window first then show msg after done because sometimes the reload could take a while, so not to make user think it's frozen.
Context.API.HideMainWindow(); Context.API.HideMainWindow();
_ = Context.API.ReloadAllPluginData().ContinueWith(_ => _ = Context.API.ReloadAllPluginData().ContinueWith(_ =>
Context.API.ShowMsg( Context.API.ShowMsg(
Localize.flowlauncher_plugin_sys_dlgtitle_success(), Localize.flowlauncher_plugin_sys_dlgtitle_success(),
Localize.flowlauncher_plugin_sys_dlgtext_all_applicableplugins_reloaded()), Localize.flowlauncher_plugin_sys_dlgtext_all_applicableplugins_reloaded()),
TaskScheduler.Current); TaskScheduler.Current);
return true; return true;
} }
}, },
@ -502,7 +506,6 @@ namespace Flow.Launcher.Plugin.Sys
else else
{ {
Context.API.ChangeQuery($"{query.ActionKeyword}{Plugin.Query.ActionKeywordSeparator}{ThemeSelector.Keyword}{Plugin.Query.ActionKeywordSeparator}"); Context.API.ChangeQuery($"{query.ActionKeyword}{Plugin.Query.ActionKeywordSeparator}{ThemeSelector.Keyword}{Plugin.Query.ActionKeywordSeparator}");
} }
return false; return false;
} }

View file

@ -51,33 +51,42 @@
ItemsSource="{Binding Settings.SearchSources}" ItemsSource="{Binding Settings.SearchSources}"
MouseDoubleClick="MouseDoubleClickItem" MouseDoubleClick="MouseDoubleClickItem"
SelectedItem="{Binding Settings.SelectedSearchSource}" SelectedItem="{Binding Settings.SelectedSearchSource}"
SizeChanged="ListView_SizeChanged"
Style="{StaticResource {x:Static GridView.GridViewStyleKey}}"> Style="{StaticResource {x:Static GridView.GridViewStyleKey}}">
<ListView.View> <ListView.View>
<GridView> <GridView>
<GridViewColumn Width="50"> <!-- Margin="0 4" is a workaround to set this TextBlock to vertially center -->
<GridViewColumn Width="45">
<GridViewColumn.CellTemplate> <GridViewColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<Image <Image
Width="20" Width="20"
Height="20" Height="20"
Margin="6 0 0 0" Margin="6 4 0 4"
Source="{Binding Path=IconPath}" /> Source="{Binding Path=IconPath}" />
</DataTemplate> </DataTemplate>
</GridViewColumn.CellTemplate> </GridViewColumn.CellTemplate>
</GridViewColumn> </GridViewColumn>
<GridViewColumn <!-- Margin="0 6" is a workaround to set this TextBlock to vertially center -->
Width="130" <GridViewColumn Width="135" Header="{DynamicResource flowlauncher_plugin_websearch_action_keyword}">
DisplayMemberBinding="{Binding ActionKeyword}"
Header="{DynamicResource flowlauncher_plugin_websearch_action_keyword}" />
<GridViewColumn
Width="239"
DisplayMemberBinding="{Binding Title}"
Header="{DynamicResource flowlauncher_plugin_websearch_title}" />
<GridViewColumn Width="140" Header="{DynamicResource flowlauncher_plugin_websearch_enable}">
<GridViewColumn.CellTemplate> <GridViewColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<TextBlock> <TextBlock Margin="0 6" Text="{Binding ActionKeyword}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Width="145" Header="{DynamicResource flowlauncher_plugin_websearch_title}">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0 6" Text="{Binding Title}" />
</DataTemplate>
</GridViewColumn.CellTemplate>
</GridViewColumn>
<GridViewColumn Width="112" Header="{DynamicResource flowlauncher_plugin_websearch_enable}">
<GridViewColumn.CellTemplate>
<DataTemplate>
<TextBlock Margin="0 6">
<TextBlock.Style> <TextBlock.Style>
<Style TargetType="TextBlock"> <Style TargetType="TextBlock">
<Setter Property="Text" Value="{DynamicResource flowlauncher_plugin_websearch_false}" /> <Setter Property="Text" Value="{DynamicResource flowlauncher_plugin_websearch_false}" />
@ -92,17 +101,16 @@
</DataTemplate> </DataTemplate>
</GridViewColumn.CellTemplate> </GridViewColumn.CellTemplate>
</GridViewColumn> </GridViewColumn>
<GridViewColumn
Width="120" <!-- CheckBox is vertially center by default -->
Header="{DynamicResource flowlauncher_plugin_websearch_private_mode_label}"> <GridViewColumn Width="123" Header="{DynamicResource flowlauncher_plugin_websearch_private_mode_label}">
<GridViewColumn.CellTemplate> <GridViewColumn.CellTemplate>
<DataTemplate> <DataTemplate>
<CheckBox <CheckBox
HorizontalAlignment="Center" HorizontalAlignment="Center"
VerticalAlignment="Center" VerticalAlignment="Center"
IsChecked="{Binding IsPrivateMode}" IsChecked="{Binding IsPrivateMode}"
IsEnabled="False" IsEnabled="False" />
/>
</DataTemplate> </DataTemplate>
</GridViewColumn.CellTemplate> </GridViewColumn.CellTemplate>
</GridViewColumn> </GridViewColumn>

View file

@ -140,5 +140,28 @@ namespace Flow.Launcher.Plugin.WebSearch
webSearch.ShowDialog(); webSearch.ShowDialog();
} }
} }
private void ListView_SizeChanged(object sender, SizeChangedEventArgs e)
{
var listView = sender as ListView;
var gView = listView.View as GridView;
var workingWidth =
listView.ActualWidth - SystemParameters.VerticalScrollBarWidth; // take into account vertical scrollbar
if (workingWidth <= 0) return;
var col1 = 0.08;
var col2 = 0.24;
var col3 = 0.26;
var col4 = 0.20;
var col5 = 0.22;
gView.Columns[0].Width = workingWidth * col1;
gView.Columns[1].Width = workingWidth * col2;
gView.Columns[2].Width = workingWidth * col3;
gView.Columns[3].Width = workingWidth * col4;
gView.Columns[4].Width = workingWidth * col5;
}
} }
} }

View file

@ -388,19 +388,27 @@ Yes please, let us know in the [Q&A](https://github.com/Flow-Launcher/Flow.Launc
Our project localization is based on [Crowdin](https://crowdin.com). If you would like to change them, please go to https://crowdin.com/project/flow-launcher. Our project localization is based on [Crowdin](https://crowdin.com). If you would like to change them, please go to https://crowdin.com/project/flow-launcher.
### WPF UI Library
Our UI library is using [iNKORE.UI.WPF.Modern](https://github.com/iNKORE-NET/UI.WPF.Modern).
<a href="https://docs.inkore.net/ui-wpf-modern/introduction">
<img src="https://github.com/iNKORE-NET/UI.WPF.Modern/blob/main/assets/images/banners/UI.WPF.Modern_Main_1280w.png?raw=true" alt="iNKORE.UI.WPF.Modern" width="400">
</a>
### New changes ### New changes
All changes to flow are captured via pull requests. Some new changes will have been merged but still pending release, this means whilst a change may not exist in the current release, it may very well have been accepted and merged into the dev branch and available as a pre-release download. It is therefore a good idea that before you start to make changes, search through the open and closed pull requests to make sure the change you intend to make is not already done. All changes to flow are captured via pull requests. Some new changes will have been merged but still pending release, this means while a change may not exist in the current release, it may very well have been accepted and merged into the dev branch and available as a pre-release download. It is therefore a good idea to search through the open and closed pull requests before you start to make changes to ensure the change you intend to make is not already done.
Each of the pull requests will be marked with a milestone indicating the planned release version for the change. Each of the pull requests will be marked with a milestone indicating the planned release version for the change.
### Contributing ### Contributing
Contributions are very welcome, in addition to the main project(C#) there are also [documentation](https://github.com/Flow-Launcher/docs)(md), [website](https://github.com/Flow-Launcher/flow-launcher.github.io)(html/css) and [others](https://github.com/Flow-Launcher) that can be contributed to. If you are unsure of a change you want to make, let us know in the [Discussions](https://github.com/Flow-Launcher/Flow.Launcher/discussions/categories/ideas), otherwise feel free to put in a pull request. Contributions are very welcome, in addition to the main project (C#) there are also [documentation](https://github.com/Flow-Launcher/docs) (md), [website](https://github.com/Flow-Launcher/flow-launcher.github.io) (html/css) and [others](https://github.com/Flow-Launcher) that can be contributed to. If you are unsure of a change you want to make, let us know in the [Discussions](https://github.com/Flow-Launcher/Flow.Launcher/discussions/categories/ideas), otherwise feel free to submit a pull request.
You will find the main goals of flow placed under the [Projects board](https://github.com/orgs/Flow-Launcher/projects/4), so feel free to contribute on that. If you would like to make small incremental changes, feel free to do so as well. You will find the main goals of flow placed under the [Projects board](https://github.com/orgs/Flow-Launcher/projects/4), so feel free to contribute on that. If you would like to make small incremental changes, feel free to do so as well.
Get in touch if you like to join the Flow-Launcher Team and help build this great tool. Get in touch if you would like to join the Flow-Launcher Team and help build this great tool.
### Developing/Debugging ### Developing/Debugging