aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristian Kandeler <[email protected]>2024-11-06 16:03:06 +0100
committerChristian Kandeler <[email protected]>2024-11-12 17:21:25 +0000
commit48a4ca754b7e107be7c8ea8e94d8ad9671764f68 (patch)
tree07c38b3c0ce8695d073dd80f5308fb4b9a3934a0
parent0f979a1e5576c132a34a1668d99868a77f343a1f (diff)
ProjectExplorer: Fix minimum width of mini target selectorv15.0.0-rc1
The kit area widget with the mutable kit aspects (usually the device) was not properly taken into account. Change-Id: I0d9d6f3803b6f0f3553b2837e503e029d07d7066 Reviewed-by: Alessandro Portale <[email protected]>
-rw-r--r--src/plugins/projectexplorer/kitaspect.cpp2
-rw-r--r--src/plugins/projectexplorer/miniprojecttargetselector.cpp10
2 files changed, 6 insertions, 6 deletions
diff --git a/src/plugins/projectexplorer/kitaspect.cpp b/src/plugins/projectexplorer/kitaspect.cpp
index 5a2c4e41c7b..69ecadafa59 100644
--- a/src/plugins/projectexplorer/kitaspect.cpp
+++ b/src/plugins/projectexplorer/kitaspect.cpp
@@ -158,8 +158,6 @@ void KitAspect::setListAspectSpec(ListAspectSpec &&listAspectSpec)
m_listAspectSpec = std::move(listAspectSpec);
m_comboBox = createSubWidget<QComboBox>();
- m_comboBox->setSizePolicy(QSizePolicy::Ignored, m_comboBox->sizePolicy().verticalPolicy());
- m_comboBox->setEnabled(true);
const auto sortModel = new KitAspectSortModel(this);
sortModel->setSourceModel(m_listAspectSpec->model);
m_comboBox->setModel(sortModel);
diff --git a/src/plugins/projectexplorer/miniprojecttargetselector.cpp b/src/plugins/projectexplorer/miniprojecttargetselector.cpp
index 38ecee2e9ff..0d9b9e4abe9 100644
--- a/src/plugins/projectexplorer/miniprojecttargetselector.cpp
+++ b/src/plugins/projectexplorer/miniprojecttargetselector.cpp
@@ -865,7 +865,10 @@ void MiniProjectTargetSelector::doLayout()
m_kitAreaWidget->move(0, 0);
- int kitAreaHeight = m_kitAreaWidget->isVisibleTo(this) ? m_kitAreaWidget->sizeHint().height() : 0;
+ const int kitAreaHeight = m_kitAreaWidget->isVisibleTo(this)
+ ? m_kitAreaWidget->sizeHint().height() : 0;
+ const int kitAreaWidth = m_kitAreaWidget->isVisibleTo(this)
+ ? m_kitAreaWidget->sizeHint().width() : 0;
// 1. Calculate the summary label height
int summaryLabelY = 1 + kitAreaHeight;
@@ -900,6 +903,7 @@ void MiniProjectTargetSelector::doLayout()
QRect newGeometry;
+ const int minWidth = std::max({m_summaryLabel->sizeHint().width(), kitAreaWidth, 250});
if (!onlySummary) {
// list widget height
int maxItemCount = m_projectListWidget->maxCount();
@@ -920,8 +924,6 @@ void MiniProjectTargetSelector::doLayout()
int listHeight = heightWithoutKitArea + kitAreaHeight - bottomMargin - listY + 1;
// list widget widths
- int minWidth = qMax(m_summaryLabel->sizeHint().width(), 250);
- minWidth = qMax(minWidth, m_kitAreaWidget->sizeHint().width());
QVector<int> widths = listWidgetWidths(minWidth, Core::ICore::mainWindow()->width() * 0.9);
const int runColumnWidth = widths[RUN] == -1 ? 0 : RunColumnWidth;
@@ -952,7 +954,7 @@ void MiniProjectTargetSelector::doLayout()
heightWithoutKitArea = qMax(summaryLabelHeight + bottomMargin, alignedWithActionHeight);
m_summaryLabel->resize(m_summaryLabel->sizeHint().width(), heightWithoutKitArea - bottomMargin);
m_kitAreaWidget->resize(m_kitAreaWidget->sizeHint());
- newGeometry.setSize({m_summaryLabel->width() + 1, heightWithoutKitArea + kitAreaHeight});
+ newGeometry.setSize({minWidth + 1, heightWithoutKitArea + kitAreaHeight});
}
newGeometry.translate(statusBar->mapToGlobal(QPoint{0, 0}));