diff options
author | Gerald Combs <gerald@zing.org> | 2015-09-06 10:37:15 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-09-06 19:08:01 +0000 |
commit | 84a3c85be4b7272b07b0da7cea741dd54e1a11b5 (patch) | |
tree | 76691beff4fc24c5cc2031403cc0f77f22ea9dbd /ui/qt/display_filter_edit.cpp | |
parent | 628f65a9846acd68cec035e6d7b206b68de88715 (diff) |
Disable display filter tooltips for now.
Comment out the setToolTip call in DisplayFilterCombo. The function
applies to the entire control, but the text only makes sense for the
drop-down arrow.
Remove the tooltip for the clear button in DisplayFilterEdit. If the
purpose of the "X" symbol isn't obvious then we aren't doing our job
properly.
Comment out the other setToolTip calls in DisplayFilterEdit for now
since they interfere with leaveEvents. Add a note about a possible
workaround.
Change-Id: I055a30b6a5b5e07cebf1fa36e217654d390d34d0
Reviewed-on: https://code.wireshark.org/review/10405
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Diffstat (limited to 'ui/qt/display_filter_edit.cpp')
-rw-r--r-- | ui/qt/display_filter_edit.cpp | 49 |
1 files changed, 25 insertions, 24 deletions
diff --git a/ui/qt/display_filter_edit.cpp b/ui/qt/display_filter_edit.cpp index ba2d08c1e3..69c2f8b965 100644 --- a/ui/qt/display_filter_edit.cpp +++ b/ui/qt/display_filter_edit.cpp @@ -91,25 +91,30 @@ public: } protected: - virtual void enterEvent(QEvent *evt) { - if (isEnabled()) { - setIconMode(QIcon::Active); - } - QToolButton::enterEvent(evt); - } - virtual void leaveEvent(QEvent *evt) { - setIconMode(); - QToolButton::leaveEvent(evt); - } - virtual void mousePressEvent(QMouseEvent *evt) { - if (isEnabled()) { - setIconMode(QIcon::Selected); + virtual bool event(QEvent *event) { + switch (event->type()) { + case QEvent::Enter: + // XXX We lose leave events if a tooltip appears, at least OS X. + // If we really want to enable the tooltips below we will likely + // have to add a timer to periodically check the mouse position. + if (isEnabled()) { + setIconMode(QIcon::Active); + } + break; + case QEvent::MouseButtonPress: + if (isEnabled()) { + setIconMode(QIcon::Selected); + } + break; + case QEvent::Leave: + case QEvent::MouseButtonRelease: + setIconMode(); + break; + default: + break; } - QToolButton::mousePressEvent(evt); - } - virtual void mouseReleaseEvent(QMouseEvent *evt) { - setIconMode(); - QToolButton::mouseReleaseEvent(evt); + + return QToolButton::event(event); } private: @@ -195,9 +200,8 @@ DisplayFilterEdit::DisplayFilterEdit(QWidget *parent, bool plain) : bookmark_button_->setCursor(Qt::ArrowCursor); bookmark_button_->setMenu(new QMenu()); bookmark_button_->setPopupMode(QToolButton::InstantPopup); - bookmark_button_->setToolTip(tr("Manage saved bookmarks.")); +// bookmark_button_->setToolTip(tr("Manage saved bookmarks.")); // Disabled for now. Interferes with leave events. bookmark_button_->setIconSize(QSize(14, 14)); - bookmark_button_->setAutoRaise(true); bookmark_button_->setStyleSheet( "QToolButton {" " border: none;" @@ -211,9 +215,7 @@ DisplayFilterEdit::DisplayFilterEdit(QWidget *parent, bool plain) : if (!plain_) { clear_button_ = new StockIconToolButton(this, "x-filter-clear"); clear_button_->setCursor(Qt::ArrowCursor); - clear_button_->setToolTip(tr("Clear the filter string and update the display.")); clear_button_->setIconSize(QSize(14, 14)); - clear_button_->setAutoRaise(true); clear_button_->setStyleSheet( "QToolButton {" " border: none;" @@ -231,9 +233,8 @@ DisplayFilterEdit::DisplayFilterEdit(QWidget *parent, bool plain) : apply_button_ = new StockIconToolButton(this, "x-filter-apply"); apply_button_->setCursor(Qt::ArrowCursor); apply_button_->setEnabled(false); - apply_button_->setToolTip(tr("Apply this filter string to the display.")); +// apply_button_->setToolTip(tr("Apply this filter string to the display.")); // Disabled for now. Interferes with leave events. apply_button_->setIconSize(QSize(24, 14)); - apply_button_->setAutoRaise(true); apply_button_->setStyleSheet( "QToolButton {" " border: none;" |