mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-01-21 13:10:04 -05:00
Merge pull request #27 from gh2k/osx-native-menus
Force creation of native menu bar when main window is shown
This commit is contained in:
commit
28a25644a2
@ -349,6 +349,19 @@ void Fractorium::resizeEvent(QResizeEvent* e)
|
||||
QMainWindow::resizeEvent(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Respond to a show event to ensure Qt updates the native menubar.
|
||||
/// On first create, Qt can fail to create the native menu bar properly,
|
||||
/// but telling it that this window has become the focus window forces
|
||||
/// it to refresh this.
|
||||
/// <param name="e">The event</param>
|
||||
void Fractorium::showEvent(QShowEvent *e)
|
||||
{
|
||||
// tell Qt to refresh the native menubar from this widget
|
||||
emit qGuiApp->focusWindowChanged(windowHandle());
|
||||
QMainWindow::showEvent(e);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Stop rendering and block before exiting.
|
||||
/// Called on program exit.
|
||||
|
@ -306,6 +306,7 @@ protected:
|
||||
virtual void dragEnterEvent(QDragEnterEvent* e) override;
|
||||
virtual void dragMoveEvent(QDragMoveEvent* e) override;
|
||||
virtual void dropEvent(QDropEvent* e) override;
|
||||
virtual void showEvent(QShowEvent *e) override;
|
||||
|
||||
private:
|
||||
void InitMenusUI();
|
||||
|
Loading…
Reference in New Issue
Block a user