-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Support hiding menubar and add menubarbutton #3189
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for adopting this task! Just some technical comments, I haven't tested it yet.
Please enable all warnings for local development to avoid commits that are rejected by the CI builds.
src/widget/wmainmenubar.cpp
Outdated
@@ -60,6 +60,11 @@ WMainMenuBar::WMainMenuBar(QWidget* pParent, UserSettingsPointer pConfig, | |||
} | |||
|
|||
void WMainMenuBar::initialize() { | |||
WMainMenuBar* target = this; | |||
createMenu([target](QMenu* x) { target->addMenu(x); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer a one-line:
createMenu([this](QMenu* pMenu) { addMenu(pMenu); });
src/widget/wmainmenubarbutton.cpp
Outdated
void WMainMenuBarButton::initialize(WMainMenuBar* pMainMenu) { | ||
m_pMenu = new QMenu(this); | ||
setMenu(m_pMenu); | ||
pMainMenu->createMenu([=](QMenu* x) { this->m_pMenu->addMenu(x); }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In C++ I would prefer to explicitly capture the context:
pMainMenu->createMenu([this](QMenu* x) { m_pMenu->addMenu(x) });
@uklotzde Thanks for the technical feedback, but I was more interested if this approach is feasible for everyone, not about the code yet. I know it's unpolished, I just wanted to test if I can get it working as I thought. |
At first start, the visibility controls in the regular View menu didn't work. |
I prefer to continue the discussion in Zulip: Getting rid of the menu bar so we have it in one place. |
I added Deer and LateNight support so far, LateNight could use some more styling. Line 1312 in 284db1e
Does anyone anything about this ugly workaround ? |
I like the solution here, because calling the menu dies not resize the skin. |
Yes, this here is more complete but also more complex. The shortcut Ctrl+7 is a nice addition, as well.
@daschuer Both here and in #3184 the skin is resized when toggling the menu bar, or what do you mean? In #3184 the menus are accessible even when they're not visible, for example Ctrl+F for the File menu, and arrow keys can select other menus. Depending on how long the review and testing takes, we could also use #3184 until thi sis finished. @mixxxdj/developers |
At least on xUbunut 20.04 this hack is not required. |
@poelzi What do you mena by 'messing up the menus'? Works nicely here. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
(I just hid the pre-commit hook posts, please discuss this in #3195 only) |
All becomes messed up when you switch to full screen and back on Ubuntu Bionic |
It is not required for Gnome desktops, which have no global menu bar, but it is still required for Unity which features one. |
With https://extensions.gnome.org/extension/1250/gnome-global-application-menu/ installed on Ubuntu Gnome Mixxx has no menu at all without the hack and a looooong start delay.
|
I did some testing on unity and it turned out, hide() and show() on the menubar is enough, it does not have to be rebuild. |
I will test gnome soon |
@daschuer I tested the new workaround on 18.04 and 19.04 and the menubar now works in fullscreen and switching. |
Run in fullscreen, restart mixxxx. Now mixxx starts in fullscreen but the menu shows fullscreen not set. This happens because restore geomentry also restores the fullscreen flag. Emitting a proper signal in the boot phase fixes the desync.
Loading geometry is not a very safe operation, better skip this in safe-mode
WMainMenu is now only the holder of the QActions, Visibility connections and menu logic. It creates new QMenuBar instances on demand requested by the main window. Simplify workaround code.
Shade does not support vinyl, so we need a feature flag as well
restore styling from menubar.
The unity menu integration is now always broken the menu. Is always attached on top of the window. |
clazy is complaining old style connects. |
This feels like a regression. This is relevant on small scenes, especially because the burger menu is not available with Shade. The menu integration issue starts once one is trying to switch between menu bar and burger menu. Is there really a use case for this? I guess not so it should be OK to require Mixxx to restart, after the menu bar is hidden. |
This PR is marked as stale because it has been open 90 days with no activity. |
I'm closing this for now, many conflicts have emerged. |
Add a new widget MainMenuBarButton that will show the same menu
as the mainmenu bar. Show the button in the skin if the main
menubar is hidden.
DONE: Next step is to add a checkbox in view "[ ] show menubar". The MainMenuBar button is only shown if the main menu is off.
I think this allows the best of 2 worlds, visual impaired or old school friends can stay with the menubar.
Those who want to save the space can have access to the menu with a single button.