diff options
author | Morten Johan Sørvig <morten.sorvig@digia.com> | 2014-05-19 09:16:34 +0200 |
---|---|---|
committer | Eike Ziller <eike.ziller@digia.com> | 2014-06-03 15:44:46 +0200 |
commit | bd197fbb77c5cfcf3b80951cb6f07f8579306084 (patch) | |
tree | ef12d5d0f63fd19a1e12d650ba38f8bef11b82b5 | |
parent | e1678640638f8e1ce0cd52ccc2f268468afa9751 (diff) |
Prevent flicker on MiniProjectTargetSelector show
Reproducible on Mac OS X.
Set position before changing the visible state.
Change-Id: I8a7e73dae94ceb865ea8a7ef4cec4112220888de
Reviewed-by: Daniel Teske <daniel.teske@digia.com>
Reviewed-by: Eike Ziller <eike.ziller@digia.com>
-rw-r--r-- | src/plugins/projectexplorer/miniprojecttargetselector.cpp | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp index 269290f11f..f8b9f9a12a 100644 --- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp +++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp @@ -852,7 +852,7 @@ void MiniProjectTargetSelector::doLayout(bool keepSize) int oldSummaryLabelY = m_summaryLabel->y(); - int kitAreaHeight = m_kitAreaWidget->isVisible() ? m_kitAreaWidget->sizeHint().height() : 0; + int kitAreaHeight = m_kitAreaWidget->isVisibleTo(this) ? m_kitAreaWidget->sizeHint().height() : 0; // 1. Calculate the summary label height int summaryLabelY = 1 + kitAreaHeight; @@ -959,11 +959,9 @@ void MiniProjectTargetSelector::doLayout(bool keepSize) setFixedSize(m_summaryLabel->width() + 1, heightWithoutKitArea + kitAreaHeight); //1 extra pixel for the border } - if (isVisibleTo(parentWidget())) { - QPoint moveTo = statusBar->mapToGlobal(QPoint(0,0)); - moveTo -= QPoint(0, height()); - move(moveTo); - } + QPoint moveTo = statusBar->mapToGlobal(QPoint(0,0)); + moveTo -= QPoint(0, height()); + move(moveTo); } void MiniProjectTargetSelector::setActiveTarget(ProjectExplorer::ProjectConfiguration *pc) @@ -1403,10 +1401,10 @@ void MiniProjectTargetSelector::activeRunConfigurationChanged(ProjectExplorer::R void MiniProjectTargetSelector::setVisible(bool visible) { + doLayout(false); QWidget::setVisible(visible); m_projectAction->setChecked(visible); if (visible) { - doLayout(false); if (!focusWidget() || !focusWidget()->isVisibleTo(this)) { // Does the second part actually work? if (m_projectListWidget->isVisibleTo(this)) m_projectListWidget->setFocus(); |