diff --git a/Flow.Launcher.Core/Resource/Theme.cs b/Flow.Launcher.Core/Resource/Theme.cs index 4648aef637c..6561419a16b 100644 --- a/Flow.Launcher.Core/Resource/Theme.cs +++ b/Flow.Launcher.Core/Resource/Theme.cs @@ -189,22 +189,11 @@ public ResourceDictionary GetResourceDictionary() new[] { resultItemStyle, resultSubItemStyle, resultItemSelectedStyle, resultSubItemSelectedStyle, resultHotkeyItemStyle, resultHotkeyItemSelectedStyle }, o => Array.ForEach(setters, p => o.Setters.Add(p))); } - + /* Ignore Theme Window Width and use setting */ var windowStyle = dict["WindowStyle"] as Style; - - var width = windowStyle?.Setters.OfType().Where(x => x.Property.Name == "Width") - .Select(x => x.Value).FirstOrDefault(); - - if (width == null) - { - windowStyle = dict["BaseWindowStyle"] as Style; - - width = windowStyle?.Setters.OfType().Where(x => x.Property.Name == "Width") - .Select(x => x.Value).FirstOrDefault(); - } - + var width = Settings.WindowSize; + windowStyle.Setters.Add(new Setter(Window.WidthProperty, width)); mainWindowWidth = (double)width; - return dict; } @@ -375,8 +364,6 @@ private void SetWindowAccent(Window w, AccentState state) { var windowHelper = new WindowInteropHelper(w); - // this determines the width of the main query window - w.Width = mainWindowWidth; windowHelper.EnsureHandle(); var accent = new AccentPolicy { AccentState = state }; diff --git a/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj b/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj index ef76fd61724..e01bc1efd56 100644 --- a/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj +++ b/Flow.Launcher.Infrastructure/Flow.Launcher.Infrastructure.csproj @@ -50,10 +50,15 @@ + + all + runtime; build; native; contentfiles; analyzers; buildtransitive + + diff --git a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs index 10244615863..5f9082fe935 100644 --- a/Flow.Launcher.Infrastructure/UserSettings/Settings.cs +++ b/Flow.Launcher.Infrastructure/UserSettings/Settings.cs @@ -4,19 +4,22 @@ using System.Text.Json.Serialization; using Flow.Launcher.Plugin; using Flow.Launcher.Plugin.SharedModels; +using Flow.Launcher; namespace Flow.Launcher.Infrastructure.UserSettings { public class Settings : BaseModel { private string language = "en"; - public string Hotkey { get; set; } = $"{KeyConstant.Alt} + {KeyConstant.Space}"; public string OpenResultModifiers { get; set; } = KeyConstant.Alt; public bool ShowOpenResultHotkey { get; set; } = true; + public double WindowSize { get; set; } = 580; + public string Language { - get => language; set + get => language; + set { language = value; OnPropertyChanged(); @@ -52,7 +55,7 @@ public string QuerySearchPrecisionString try { var precisionScore = (SearchPrecisionScore)Enum - .Parse(typeof(SearchPrecisionScore), value); + .Parse(typeof(SearchPrecisionScore), value); QuerySearchPrecision = precisionScore; StringMatcher.Instance.UserSettingSearchPrecision = precisionScore; diff --git a/Flow.Launcher/Languages/en.xaml b/Flow.Launcher/Languages/en.xaml index d1dcf14d304..1cb203515a3 100644 --- a/Flow.Launcher/Languages/en.xaml +++ b/Flow.Launcher/Languages/en.xaml @@ -98,6 +98,7 @@ Are you sure you want to delete {0} plugin hotkey? Query window shadow effect Shadow effect has a substantial usage of GPU. Not recommended if your computer performance is limited. + Window Width Size Use Segoe Fluent Icons Use Segoe Fluent Icons for query results where supported diff --git a/Flow.Launcher/MainWindow.xaml b/Flow.Launcher/MainWindow.xaml index b517faf191a..daea406db05 100644 --- a/Flow.Launcher/MainWindow.xaml +++ b/Flow.Launcher/MainWindow.xaml @@ -26,6 +26,8 @@ LocationChanged="OnLocationChanged" Deactivated="OnDeactivated" PreviewKeyDown="OnKeyDown" + MinWidth="{Binding MainWindowWidth, Mode=OneWay}" + MaxWidth="{Binding MainWindowWidth, Mode=OneWay}" Visibility="{Binding MainWindowVisibility, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" d:DataContext="{d:DesignInstance vm:MainViewModel}"> @@ -102,7 +104,25 @@ - + + + + + + diff --git a/Flow.Launcher/MainWindow.xaml.cs b/Flow.Launcher/MainWindow.xaml.cs index 8cc6f6c4376..5fc3f2fc96e 100644 --- a/Flow.Launcher/MainWindow.xaml.cs +++ b/Flow.Launcher/MainWindow.xaml.cs @@ -20,6 +20,7 @@ using KeyEventArgs = System.Windows.Input.KeyEventArgs; using MessageBox = System.Windows.MessageBox; using NotifyIcon = System.Windows.Forms.NotifyIcon; +using System.Windows.Interop; namespace Flow.Launcher { diff --git a/Flow.Launcher/SettingWindow.xaml b/Flow.Launcher/SettingWindow.xaml index 88a9172b0fb..433feeb9fb2 100644 --- a/Flow.Launcher/SettingWindow.xaml +++ b/Flow.Launcher/SettingWindow.xaml @@ -1,28 +1,29 @@ - + Icon="Images\app.ico" + Loaded="OnLoaded" + MouseDown="window_MouseDown" + ResizeMode="CanResizeWithGrip" + WindowStartupLocation="CenterScreen" + mc:Ignorable="d"> @@ -32,7 +33,7 @@ - + @@ -46,9 +47,9 @@ - + - + @@ -60,25 +61,25 @@ - - + + - - + - - @@ -768,10 +829,13 @@ - - + + - + - + - - - + + + - - + + - + - - + + @@ -1175,51 +1395,56 @@ - - + + - - - - - + + - + - - + + - - + + - - + + - - - - + + + + @@ -1233,26 +1458,32 @@ - + - - + + - - - - + + + + @@ -1266,8 +1497,11 @@ - + @@ -1276,17 +1510,23 @@ - + - + - - + Click="OpenPluginFolder" + Content="{DynamicResource OpenThemeFolder}" + DockPanel.Dock="Top" /> + @@ -1306,17 +1546,21 @@ - + - + - + @@ -1325,83 +1569,99 @@ - + - + - - + + - - - + + + - + - + - - + + - + SelectedItem="{Binding Settings.OpenResultModifiers}" /> - - + + - - - + + + - + - - + + Style="{StaticResource {x:Static GridView.GridViewStyleKey}}"> - + - + @@ -1411,13 +1671,23 @@ - -