Skip to content

Commit 6b37ada

Browse files
committed
- Remove Comment
- Add String "Window Width Size"
1 parent 6af1262 commit 6b37ada

File tree

5 files changed

+10
-19
lines changed

5 files changed

+10
-19
lines changed

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -189,20 +189,8 @@ public ResourceDictionary GetResourceDictionary()
189189
new[] { resultItemStyle, resultSubItemStyle, resultItemSelectedStyle, resultSubItemSelectedStyle, resultHotkeyItemStyle, resultHotkeyItemSelectedStyle }, o
190190
=> Array.ForEach(setters, p => o.Setters.Add(p)));
191191
}
192-
192+
/* Ignore Theme Window Width and use setting */
193193
var windowStyle = dict["WindowStyle"] as Style;
194-
/*
195-
var width = windowStyle?.Setters.OfType<Setter>().Where(x => x.Property.Name == "Width")
196-
.Select(x => x.Value).FirstOrDefault();
197-
198-
if (width == null)
199-
{
200-
windowStyle = dict["BaseWindowStyle"] as Style;
201-
202-
width = windowStyle?.Setters.OfType<Setter>().Where(x => x.Property.Name == "Width")
203-
.Select(x => x.Value).FirstOrDefault();
204-
}
205-
*/
206194
var width = Settings.WindowSize;
207195
windowStyle.Setters.Add(new Setter(Window.WidthProperty, width));
208196
mainWindowWidth = (double)width;

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
using System.Text.Json.Serialization;
55
using Flow.Launcher.Plugin;
66
using Flow.Launcher.Plugin.SharedModels;
7-
7+
using Flow.Launcher;
88
namespace Flow.Launcher.Infrastructure.UserSettings
99
{
1010
public class Settings : BaseModel

Flow.Launcher/Languages/en.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@
8282
<system:String x:Key="deleteCustomHotkeyWarning">Are you sure you want to delete {0} plugin hotkey?</system:String>
8383
<system:String x:Key="queryWindowShadowEffect">Query window shadow effect</system:String>
8484
<system:String x:Key="shadowEffectCPUUsage">Shadow effect has a substantial usage of GPU. Not recommended if your computer performance is limited.</system:String>
85+
<system:String x:Key="windowWidthSize">Window Width Size</system:String>
8586
<system:String x:Key="useGlyphUI">Use Segoe Fluent Icons</system:String>
8687
<system:String x:Key="useGlyphUIEffect">Use Segoe Fluent Icons for query results where supported</system:String>
8788

Flow.Launcher/SettingWindow.xaml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -677,13 +677,11 @@
677677
<Border Style="{DynamicResource SettingGroupBox}" Margin="0 12 0 18">
678678
<ItemsControl Style="{StaticResource SettingGrid}">
679679
<StackPanel Style="{StaticResource TextPanel}">
680-
<TextBlock Text="Window Width Size" Style="{DynamicResource SettingTitleLabel}"/>
680+
<TextBlock Text="{DynamicResource windowWidthSize}" Style="{DynamicResource SettingTitleLabel}"/>
681681
</StackPanel>
682-
<!--<Button DockPanel.Dock="Top" Margin="0,0,18,0" Width="180" HorizontalAlignment="Center"
683-
Click="OpenPluginFolder" Grid.Column="2">Open Theme Folder</Button>-->
684682
<StackPanel Orientation="Horizontal" Grid.Column="2">
685683
<TextBlock Text="{Binding ElementName=WindowWidthValue, Path=Value, UpdateSourceTrigger=PropertyChanged}" VerticalAlignment="Center" TextAlignment="Right" Width="100" Margin="0 0 8 2"/>
686-
<Slider Name="WindowWidthValue" Value="{Binding Settings.WindowSize, Mode=TwoWay}" Maximum="900" Minimum="400" Margin="0,0,18,0" TickFrequency="10" IsSnapToTickEnabled="True" Width="400"/>
684+
<Slider Name="WindowWidthValue" Value="{Binding WindowWidthSize, Mode=TwoWay}" Maximum="900" Minimum="400" Margin="0,0,18,0" TickFrequency="10" IsSnapToTickEnabled="True" Width="300"/>
687685
</StackPanel>
688686
<TextBlock FontFamily="/Resources/#Segoe Fluent Icons" FontSize="20" Grid.Column="0" VerticalAlignment="Center" Margin="24 0 16 0">
689687
&#xe740;

Flow.Launcher/ViewModel/SettingWindowViewModel.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,11 @@ public bool DropShadowEffect
307307
public double WindowWidthSize
308308
{
309309
get { return Settings.WindowSize; }
310-
set { Settings.WindowSize = value;}
310+
set
311+
{
312+
Settings.WindowSize = value;
313+
ThemeManager.Instance.ChangeTheme(Settings.Theme);
314+
}
311315
}
312316

313317
public bool UseGlyphIcons

0 commit comments

Comments
 (0)