aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2013-06-10 21:21:51 +0000
committerGerald Combs <gerald@wireshark.org>2013-06-10 21:21:51 +0000
commitf5e892cbac7fba546d80a1e10718420f1c89fee1 (patch)
tree8e38eda9e48b0dee59abf3b7f3feac4b4948db1b
parent3d59df0ed65a1a4c363745e2ab9c85279a70b89b (diff)
Check for QtMacExtras, and if we have it use it to switch to a native
title + toolbar on OS X. svn path=/trunk/; revision=49873
-rw-r--r--ui/qt/QtShark.pro7
-rw-r--r--ui/qt/main_window.cpp14
2 files changed, 19 insertions, 2 deletions
diff --git a/ui/qt/QtShark.pro b/ui/qt/QtShark.pro
index f06114bb1f..1e5cd28bc6 100644
--- a/ui/qt/QtShark.pro
+++ b/ui/qt/QtShark.pro
@@ -94,6 +94,13 @@ unix {
PKGCONFIG += zlib
}
}
+
+ macx {
+ packagesExist(Qt5MacExtras) {
+ message( "Found Qt5MacExtras" )
+ QT += macextras
+ }
+ }
}
win32 {
diff --git a/ui/qt/main_window.cpp b/ui/qt/main_window.cpp
index 0f72bab49b..a20dc21342 100644
--- a/ui/qt/main_window.cpp
+++ b/ui/qt/main_window.cpp
@@ -59,6 +59,12 @@
#include <QMetaObject>
#include <QMessageBox>
+#ifdef QT_MACEXTRAS_LIB
+#include <QtMacExtras/QMacNativeToolBar>
+#endif
+
+#include <QDebug>
+
//menu_recent_file_write_all
// If we ever add support for multiple windows this will need to be replaced.
@@ -136,6 +142,10 @@ MainWindow::MainWindow(QWidget *parent) :
main_ui_->statusBar, SLOT(pushTemporaryStatus(QString&)));
#if defined(Q_OS_MAC)
+#ifdef QT_MACEXTRAS_LIB
+ QtMacExtras::setNativeToolBar(main_ui_->mainToolBar);
+#endif // HAVE_QT5_MAC_EXTRAS
+
foreach (QMenu *menu, main_ui_->menuBar->findChildren<QMenu*>()) {
foreach (QAction *act, menu->actions()) {
act->setIconVisibleInMenu(false);
@@ -144,7 +154,8 @@ MainWindow::MainWindow(QWidget *parent) :
main_ui_->goToLineEdit->setAttribute(Qt::WA_MacSmallSize, true);
main_ui_->goToGo->setAttribute(Qt::WA_MacSmallSize, true);
main_ui_->goToCancel->setAttribute(Qt::WA_MacSmallSize, true);
-#endif
+
+#endif // Q_OS_MAC
#ifdef HAVE_SOFTWARE_UPDATE
QAction *update_sep = main_ui_->menuHelp->insertSeparator(main_ui_->actionHelpAbout);
@@ -272,7 +283,6 @@ MainWindow::~MainWindow()
delete main_ui_;
}
-#include <QDebug>
void MainWindow::setPipeInputHandler(gint source, gpointer user_data, int *child_process, pipe_input_cb_t input_cb)
{
pipe_source_ = source;