Skip to content

Commit

Permalink
Qt: Avoid flicker in filter expressions toolbar
Browse files Browse the repository at this point in the history
Calling adjustSize() on the display filter toolbar causes flicker
in the filter expression toolbar when switching between profiles
without buttons and in some cases changing to a profile without buttons.

Only calling adjustSize() if adding buttons should be fine to avoid
this issues, even if they may be caused by something else.

Change-Id: I8cca84a51dbbc8244dc4342ac0466e35884c294d
Reviewed-on: https://code.wireshark.org/review/20222
Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
  • Loading branch information
stigbjorlykke authored and AndersBroman committed Feb 22, 2017
1 parent e88d445 commit a4d7793
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion ui/qt/main_window_slots.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -838,6 +838,8 @@ void MainWindow::captureFileSaveStarted(const QString &file_path)

void MainWindow::filterExpressionsChanged()
{
bool actions_added = false;

// Recreate filter buttons
foreach (QAction *act, filter_expression_toolbar_->actions()) {
// Permanent actions shouldn't have data
Expand All @@ -856,8 +858,12 @@ void MainWindow::filterExpressionsChanged()
dfb_action->setProperty(dfe_property_, true);
filter_expression_toolbar_->addAction(dfb_action);
connect(dfb_action, SIGNAL(triggered()), this, SLOT(displayFilterButtonClicked()));
actions_added = true;
}

if (actions_added) {
main_ui_->displayFilterToolBar->adjustSize();
}
main_ui_->displayFilterToolBar->adjustSize();
}

//
Expand Down

0 comments on commit a4d7793

Please sign in to comment.