Skip to content

Commit f62561f

Browse files
committed
Don't save new window width if the window is hidden
1 parent 52d142c commit f62561f

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

Flow.Launcher/MainWindow.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
xmlns:vm="clr-namespace:Flow.Launcher.ViewModel"
1313
Name="FlowMainWindow"
1414
Title="Flow Launcher"
15-
Width="{Binding MainWindowWidth, Mode=OneTime}"
15+
Width="{Binding MainWindowWidth, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
1616
MinWidth="400"
1717
MinHeight="30"
1818
d:DataContext="{d:DesignInstance Type=vm:MainViewModel}"

Flow.Launcher/ViewModel/MainViewModel.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -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)