Qt: Avoid flicker in filter expressions toolbar

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>
This commit is contained in:
Stig Bjørlykke 2017-02-21 12:38:28 +01:00 committed by Anders Broman
parent e88d445981
commit a4d7793b4c
1 changed files with 7 additions and 1 deletions

View File

@ -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
@ -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();
}
//