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 preferences not opening when closed on macOS #515

Merged

Conversation

vespakoen
Copy link
Contributor

On macOS, when closing the preferences window, then clicking Preferences in the Menu, does not open the preferences window.

This PR fixes that.

@@ -1409,6 +1409,7 @@ - (NSApplicationTerminateReply)applicationShouldTerminate:(NSApplication *)sende

@implementation SSApplicationDelegate
- (IBAction)preferences:(id)sender {
SolveSpace::SS.GW.MenuView(SolveSpace::Command::SHOW_TEXT_WND);
Copy link
Contributor

Choose a reason for hiding this comment

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

This toggles the text window visibility.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Oops, good to know haha, I will add a check around it to see if it's actually off

Copy link
Contributor

Choose a reason for hiding this comment

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

Just do SS.GW.showTextWindow = true;

Copy link
Contributor Author

Choose a reason for hiding this comment

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

But that would not update the checkmark if it's open or not, correct? e.g.:

    if(SS.TW.window) SS.TW.window->SetVisible(SS.GW.showTextWindow);
    showTextWndMenuItem->SetActive(SS.GW.showTextWindow);

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh yes, the horrible EnsureValidActives function. Go ahead with your plan.

Fix preferences not always opening on macOS
@vespakoen
Copy link
Contributor Author

Went ahead with the plan, hope it's fine now =)

@whitequark whitequark merged commit 58f23aa into solvespace:master Nov 26, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants