Skip to content

Commit 3b540e0

Browse files
authored
Merge pull request #2733 from onesounds/240528_FixSize
Fix Saving Window Width
2 parents c9061a4 + 96f4153 commit 3b540e0

File tree

3 files changed

+9
-10
lines changed

3 files changed

+9
-10
lines changed

Flow.Launcher/MainWindow.xaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
Name="FlowMainWindow"
1414
Title="Flow Launcher"
1515
Width="{Binding MainWindowWidth, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
16-
MinWidth="430"
16+
MinWidth="400"
1717
MinHeight="30"
1818
d:DataContext="{d:DesignInstance Type=vm:MainViewModel}"
1919
AllowDrop="True"
@@ -23,6 +23,7 @@
2323
Deactivated="OnDeactivated"
2424
Icon="Images/app.png"
2525
Initialized="OnInitialized"
26+
Left="{Binding Settings.WindowLeft, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
2627
Loaded="OnLoaded"
2728
LocationChanged="OnLocationChanged"
2829
Opacity="{Binding MainWindowOpacity, Mode=OneWay, UpdateSourceTrigger=PropertyChanged}"

Flow.Launcher/SettingPages/ViewModels/SettingsPaneThemeViewModel.cs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -173,12 +173,6 @@ public bool KeepMaxResults
173173

174174
public string DateText => DateTime.Now.ToString(DateFormat, CultureInfo.CurrentCulture);
175175

176-
public double WindowWidthSize
177-
{
178-
get => Settings.WindowSize;
179-
set => Settings.WindowSize = value;
180-
}
181-
182176
public bool UseGlyphIcons
183177
{
184178
get => Settings.UseGlyphIcons;

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -538,7 +538,7 @@ private void IncreaseWidth()
538538
{
539539
Settings.WindowSize += 100;
540540
Settings.WindowLeft -= 50;
541-
OnPropertyChanged();
541+
OnPropertyChanged(nameof(MainWindowWidth));
542542
}
543543

544544
[RelayCommand]
@@ -554,7 +554,7 @@ private void DecreaseWidth()
554554
Settings.WindowSize -= 100;
555555
}
556556

557-
OnPropertyChanged();
557+
OnPropertyChanged(nameof(MainWindowWidth));
558558
}
559559

560560
[RelayCommand]
@@ -706,7 +706,11 @@ private ResultsViewModel SelectedResults
706706
public double MainWindowWidth
707707
{
708708
get => Settings.WindowSize;
709-
set => Settings.WindowSize = value;
709+
set
710+
{
711+
if (!MainWindowVisibilityStatus) return;
712+
Settings.WindowSize = value;
713+
}
710714
}
711715

712716
public double MainWindowHeight

0 commit comments

Comments
 (0)