Skip to content

Commit 6af1262

Browse files
committed
Adjust Width in Theme.cs
1 parent 616e98a commit 6af1262

File tree

5 files changed

+9
-7
lines changed

5 files changed

+9
-7
lines changed

Flow.Launcher.Core/Resource/Theme.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ public ResourceDictionary GetResourceDictionary()
191191
}
192192

193193
var windowStyle = dict["WindowStyle"] as Style;
194-
194+
/*
195195
var width = windowStyle?.Setters.OfType<Setter>().Where(x => x.Property.Name == "Width")
196196
.Select(x => x.Value).FirstOrDefault();
197197
@@ -202,9 +202,10 @@ public ResourceDictionary GetResourceDictionary()
202202
width = windowStyle?.Setters.OfType<Setter>().Where(x => x.Property.Name == "Width")
203203
.Select(x => x.Value).FirstOrDefault();
204204
}
205-
205+
*/
206+
var width = Settings.WindowSize;
207+
windowStyle.Setters.Add(new Setter(Window.WidthProperty, width));
206208
mainWindowWidth = (double)width;
207-
208209
return dict;
209210
}
210211

Flow.Launcher.Infrastructure/UserSettings/Settings.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ public double WindowSize
2121
windowsize = value;
2222
OnPropertyChanged();
2323
}
24+
2425
}
2526

2627
public string Language

Flow.Launcher/SettingWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -683,7 +683,7 @@
683683
Click="OpenPluginFolder" Grid.Column="2">Open Theme Folder</Button>-->
684684
<StackPanel Orientation="Horizontal" Grid.Column="2">
685685
<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="1000" Minimum="400" Margin="0,0,18,0" TickFrequency="10" IsSnapToTickEnabled="True" Width="400"/>
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"/>
687687
</StackPanel>
688688
<TextBlock FontFamily="/Resources/#Segoe Fluent Icons" FontSize="20" Grid.Column="0" VerticalAlignment="Center" Margin="24 0 16 0">
689689
&#xe740;

Flow.Launcher/Themes/Base.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:system="clr-namespace:System;assembly=mscorlib"
4-
xmlns:userSettings="clr-namespace:Flow.Launcher">
4+
xmlns:userSettings="clr-namespace:Flow.Launcher.Infrastructure.UserSettings;assembly=Flow.Launcher.Infrastructure">
55

66
<!-- Further font customisations are dynamically loaded in Theme.cs -->
77
<Style x:Key="BaseQueryBoxStyle" TargetType="{x:Type TextBox}">
@@ -55,7 +55,7 @@
5555
<Setter Property="CornerRadius" Value="5" />
5656
</Style>
5757
<Style x:Key="BaseWindowStyle" TargetType="{x:Type Window}">
58-
<Setter Property="Width" Value="{Binding WindowWidthSize.windowsize" />
58+
<Setter Property="Width" Value="600" />
5959
<Setter Property="RenderOptions.ClearTypeHint" Value="Enabled"/>
6060
</Style>
6161

Flow.Launcher/ViewModel/SettingWindowViewModel.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@ public bool DropShadowEffect
307307
public double WindowWidthSize
308308
{
309309
get { return Settings.WindowSize; }
310-
set { Settings.WindowSize = value; }
310+
set { Settings.WindowSize = value;}
311311
}
312312

313313
public bool UseGlyphIcons

0 commit comments

Comments
 (0)