Rename utilityToolBar to displayFilterToolbar and move the display
filter widget there. Add a few more items to the main toolbar. Note that Qt 4.8 doesn't support a unified title+toolbar with multiple toolbar rows on OS X (at least not easily) but Qt 5 might. Disable icons-in-menus on OS X. svn path=/trunk/; revision=46371
This commit is contained in:
parent
cbd6062109
commit
b2239669e2
|
@ -100,9 +100,20 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
connect(df_edit, SIGNAL(popFilterSyntaxStatus()), main_ui_->statusBar, SLOT(popFilterStatus()));
|
||||
connect(df_edit, SIGNAL(pushFilterSyntaxWarning(QString&)), main_ui_->statusBar, SLOT(pushTemporaryStatus(QString&)));
|
||||
|
||||
main_ui_->mainToolBar->addWidget(df_combo_box_);
|
||||
// http://standards.freedesktop.org/icon-naming-spec/icon-naming-spec-latest.html
|
||||
// http://qt-project.org/doc/qt-4.8/qstyle.html#StandardPixmap-enum
|
||||
main_ui_->actionFileOpen->setIcon(
|
||||
QIcon().fromTheme("document-open", style()->standardIcon(QStyle::SP_DirIcon)));
|
||||
main_ui_->actionFileSave->setIcon(
|
||||
QIcon().fromTheme("document-save", style()->standardIcon(QStyle::SP_FileIcon)));
|
||||
main_ui_->actionFileClose->setIcon(
|
||||
QIcon().fromTheme("process-stop", style()->standardIcon(QStyle::SP_BrowserStop)));
|
||||
|
||||
main_ui_->utilityToolBar->hide();
|
||||
// In Qt4 multiple toolbars and "pretty" are mutually exculsive on OS X. If
|
||||
// unifiedTitleAndToolBarOnMac is enabled everything ends up in the same row.
|
||||
// https://bugreports.qt-project.org/browse/QTBUG-22433
|
||||
// This property is obsolete in Qt5 so this issue may be fixed in that version.
|
||||
main_ui_->displayFilterToolBar->addWidget(df_combo_box_);
|
||||
|
||||
main_ui_->goToFrame->hide();
|
||||
go_to_margins = main_ui_->goToHB->contentsMargins();
|
||||
|
@ -116,13 +127,20 @@ MainWindow::MainWindow(QWidget *parent) :
|
|||
" background: palette(window);"
|
||||
" padding-top: 0.1em;"
|
||||
" padding-bottom: 0.1em;"
|
||||
" border-bottom: 0.1em solid palette(shadow);"
|
||||
" border-bottom: 1px solid palette(shadow);"
|
||||
"}"
|
||||
"QLineEdit {"
|
||||
" max-width: 5em;"
|
||||
"}"
|
||||
);
|
||||
|
||||
#if defined(Q_WS_MAC)
|
||||
foreach (QMenu *menu, main_ui_->menuBar->findChildren<QMenu*>()) {
|
||||
foreach (QAction *act, menu->actions()) {
|
||||
qDebug() << "disabling" << act->objectName();
|
||||
act->setIconVisibleInMenu(false);
|
||||
}
|
||||
}
|
||||
main_ui_->goToLineEdit->setAttribute(Qt::WA_MacSmallSize, true);
|
||||
main_ui_->goToGo->setAttribute(Qt::WA_MacSmallSize, true);
|
||||
main_ui_->goToCancel->setAttribute(Qt::WA_MacSmallSize, true);
|
||||
|
|
|
@ -13,12 +13,6 @@
|
|||
<property name="windowTitle">
|
||||
<string>Wireshark</string>
|
||||
</property>
|
||||
<property name="iconSize">
|
||||
<size>
|
||||
<width>24</width>
|
||||
<height>24</height>
|
||||
</size>
|
||||
</property>
|
||||
<property name="unifiedTitleAndToolBarOnMac">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
|
@ -254,7 +248,7 @@
|
|||
</size>
|
||||
</property>
|
||||
<property name="toolButtonStyle">
|
||||
<enum>Qt::ToolButtonTextUnderIcon</enum>
|
||||
<enum>Qt::ToolButtonIconOnly</enum>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
|
@ -265,12 +259,18 @@
|
|||
<addaction name="actionStartCapture"/>
|
||||
<addaction name="actionStopCapture"/>
|
||||
<addaction name="separator"/>
|
||||
<addaction name="actionFileOpen"/>
|
||||
<addaction name="actionFileSave"/>
|
||||
<addaction name="actionFileClose"/>
|
||||
</widget>
|
||||
<widget class="MainStatusBar" name="statusBar"/>
|
||||
<widget class="QToolBar" name="utilityToolBar">
|
||||
<widget class="QToolBar" name="displayFilterToolBar">
|
||||
<property name="windowTitle">
|
||||
<string>toolBar</string>
|
||||
</property>
|
||||
<property name="movable">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<attribute name="toolBarArea">
|
||||
<enum>TopToolBarArea</enum>
|
||||
</attribute>
|
||||
|
|
|
@ -393,6 +393,8 @@ WiresharkApplication::WiresharkApplication(int &argc, char **argv) :
|
|||
}
|
||||
#endif // Q_WS_WIN
|
||||
|
||||
setAttribute(Qt::AA_DontShowIconsInMenus, true);
|
||||
|
||||
recent_timer_ = new QTimer(this);
|
||||
connect(recent_timer_, SIGNAL(timeout()), this, SLOT(refreshRecentFiles()));
|
||||
recent_timer_->start(2000);
|
||||
|
|
Loading…
Reference in New Issue