Don't save new window width if the window is hidden

This commit is contained in:
Yusyuriv 2024-05-28 14:44:28 +06:00
parent 52d142cb16
commit f62561fe53
No known key found for this signature in database
GPG key ID: A91C52E6F73148E0
2 changed files with 6 additions and 2 deletions

View file

@ -12,7 +12,7 @@
xmlns:vm="clr-namespace:Flow.Launcher.ViewModel"
Name="FlowMainWindow"
Title="Flow Launcher"
Width="{Binding MainWindowWidth, Mode=OneTime}"
Width="{Binding MainWindowWidth, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
MinWidth="400"
MinHeight="30"
d:DataContext="{d:DesignInstance Type=vm:MainViewModel}"

View file

@ -706,7 +706,11 @@ namespace Flow.Launcher.ViewModel
public double MainWindowWidth
{
get => Settings.WindowSize;
set => Settings.WindowSize = value;
set
{
if (!MainWindowVisibilityStatus) return;
Settings.WindowSize = value;
}
}
public double MainWindowHeight