qtoctave-0.10.1-no-native-menubars.patch 1.7 KB

123456789101112131415161718192021222324252627282930313233343536
  1. Description: Do not export docked window menubars to desktop panel
  2. Author: Aurélien Gâteau <aurelien.gateau@canonical.com>
  3. Forwarded: Sent to http://groups.google.com/group/qtoctave-english
  4. Bug-Ubuntu: https://bugs.launchpad.net/appmenu-qt/+bug/673210
  5. Index: qtoctave-0.10.1/qtoctave/src/basewidget.cpp
  6. ===================================================================
  7. --- qtoctave-0.10.1.orig/qtoctave/src/basewidget.cpp 2011-01-06 22:48:07.000000000 +0100
  8. +++ qtoctave-0.10.1/qtoctave/src/basewidget.cpp 2011-09-14 11:03:11.000000000 +0200
  9. @@ -30,6 +30,7 @@
  10. //setFocusPolicy(Qt::StrongFocus);
  11. session=NULL;
  12. QWidget *central=new QWidget(this);
  13. + menuBar()->setNativeMenuBar(false);
  14. setCentralWidget(central);
  15. QMenu *windows_menu=menuBar()->addMenu(tr("View"));
  16. Index: qtoctave-0.10.1/qtoctave/src/mainwindow.cpp
  17. ===================================================================
  18. --- qtoctave-0.10.1.orig/qtoctave/src/mainwindow.cpp 2011-01-06 22:48:07.000000000 +0100
  19. +++ qtoctave-0.10.1/qtoctave/src/mainwindow.cpp 2011-09-14 12:03:14.000000000 +0200
  20. @@ -39,7 +39,13 @@
  21. setSession(session);
  22. setWindowIcon(QIcon(QString(ICON_PATH) + "/qtoctave.png"));
  23. - menuBar()->clear();
  24. + //The menubar provided by BaseWidget is set as not-native to avoid showing up
  25. + //in top-panel menubars on desktops like Unity, but we want a native menubar
  26. + //here, and we also want to get rid of the generic "View" item BaseWidget
  27. + //added to the menubar. Setting a new menubar is the simplest way to do this
  28. + //(the old one gets deleted).
  29. + //[1] https://bugs.launchpad.net/appmenu-qt/+bug/673210
  30. + setMenuBar(new QMenuBar());
  31. setWindowTitle("QtOctave ["+session->getProjectName()+"]");
  32. //resize(QSize(800, 600).expandedTo(minimumSizeHint()));