Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for #1671 saving window settings #1672

Merged
merged 7 commits into from
Nov 25, 2014

Conversation

punker76
Copy link
Member

  • we should not save settings from hidden windows.
  • also should we respect cancellation

Closes #1671 SaveWindowPosition saves to position 0,0 if window not shown

we should not save settings from hidden windows.
also should we respect cancellation
_window.SourceInitialized -= WindowSourceInitialized;
_window = null;
_settings = null;
if (!e.Cancel)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unreliable and Cancel will only be true if we're the last subscriber of the Closing event. We should detach this in the Closed event.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

agreed

- move deregistering events to closed event
- handle minimized state changed, because hidden windows gets no window
placements
@mike-ward
Copy link

Pulled this down and tried with Markdown Edit. Can confirm that it fixes my issue. Thanks.

An aside: I did notice that the Title Bar text brush is Black instead of White. Might be an issue or just my build.

@punker76
Copy link
Member Author

@mike-ward the TitleBar text brush is taken from the accent colors (changed after 0.14), e.g. for Steel

<Color x:Key="IdealForegroundColor">Black</Color>
<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="{StaticResource IdealForegroundColor}" options:Freeze="True" />

you can set the window TitleForeground property to x:Null and a converter calculates the ideal title Foreground or you override the IdealForegroundColorBrush in your App.xaml.

<SolidColorBrush x:Key="IdealForegroundColorBrush" Color="White" />

Another way is to create your own accent.

punker76 added a commit that referenced this pull request Nov 25, 2014
@punker76 punker76 merged commit a425ba0 into master Nov 25, 2014
@flagbug flagbug added this to the v1.0 milestone Nov 25, 2014
@flagbug flagbug deleted the 1671-punker76-WindowSettings-fixes branch November 25, 2014 22:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants