Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@cameronwhite
Copy link
Member

@cameronwhite cameronwhite commented May 7, 2025

Bug #781

  • Move the menu initialization to the startup event to fix issues with menu bars randomly not appearing
  • Consolidate duplicate logic for selecting a non-headerbar layout on macOS
  • Fix issues on macOS with using a header bar layout
  • Add a setting and menu option to control this, with appropriate defaults
  • Notify the user to restart after changing the menu option
  • Test on all supported platforms

When testing the non-headerbar layout on Linux (KDE), doing this in the 'activate' event caused the menubar to not appear - it seems necessary to do this during the startup event. This also seems to have fixed intermittent issues on macOS where the global menu was left empty.

The header bar is still populated during the 'activate' event along with creating the rest of the window, so some refactoring was needed to enable this.
…bled.

Otherwise, the Quit action isn't connected to anything and the application doesn't close.
This seems to be necessary to get the menubar to appear if a global menu isn't being used
@cameronwhite cameronwhite linked an issue May 7, 2025 that may be closed by this pull request
To support this, the ToggleCommand.Toggled event now indicates whether it was interactively toggled, to avoid popping up a message when the action is "toggled" by loading the setting during startup
@cameronwhite cameronwhite marked this pull request as ready for review May 13, 2025 04:21
@cameronwhite cameronwhite merged commit 478ac3f into master May 15, 2025
11 checks passed
@pedropaulosuzuki
Copy link
Contributor

image

Is there an easy way to remove this gray line under the menu? As there is already the shadow of the window decoration, it becomes a bit heavy with all those lines.

@cameronwhite
Copy link
Member Author

I don't recall seeing an option for whether that shadow is displayed, but perhaps there is some CSS styling that can be modified

cameronwhite added a commit that referenced this pull request May 30, 2025
* Initialize the application menubar during the 'startup' event

  When testing the non-headerbar layout on Linux (KDE), doing this in the 'activate' event caused the menubar to not appear - it seems necessary to do this during the startup event. This also seems to have fixed intermittent issues on macOS where the global menu was left empty.

  The header bar is still populated during the 'activate' event along with creating the rest of the window, so some refactoring was needed to enable this.

* On macOS, populate the Application menu even if the header bar is enabled.

  Otherwise, the Quit action isn't connected to anything and the application doesn't close.

* Enable the 'ShowMenubar' property for the Gtk.Application

  This seems to be necessary to get the menubar to appear if a global menu isn't being used

* Add an option in the View menu to enable the menu bar

* Notify the user to restart after changing the menubar option

  To support this, the ToggleCommand.Toggled event now indicates whether it was interactively toggled, to avoid popping up a message when the action is "toggled" by loading the setting during startup

(cherry picked from commit 478ac3f)
cameronwhite added a commit that referenced this pull request Jun 8, 2025
* Initialize the application menubar during the 'startup' event

  When testing the non-headerbar layout on Linux (KDE), doing this in the 'activate' event caused the menubar to not appear - it seems necessary to do this during the startup event. This also seems to have fixed intermittent issues on macOS where the global menu was left empty.

  The header bar is still populated during the 'activate' event along with creating the rest of the window, so some refactoring was needed to enable this.

* On macOS, populate the Application menu even if the header bar is enabled.

  Otherwise, the Quit action isn't connected to anything and the application doesn't close.

* Enable the 'ShowMenubar' property for the Gtk.Application

  This seems to be necessary to get the menubar to appear if a global menu isn't being used

* Add an option in the View menu to enable the menu bar

* Notify the user to restart after changing the menubar option

  To support this, the ToggleCommand.Toggled event now indicates whether it was interactively toggled, to avoid popping up a message when the action is "toggled" by loading the setting during startup

(cherry picked from commit 478ac3f)
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.

Support a classic menubar layout (and global menus for KDE)

3 participants