Target selector: Make sure the run icon is not hidden under scrollbar

Fixes: QTCREATORBUG-24148
Change-Id: Icae939d8f63a99b372f32d91d33acdfb2130a4f7
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
This commit is contained in:
Christian Kandeler
2020-06-23 12:35:42 +02:00
parent 66c3fe931f
commit 66d74ac566

View File

@@ -68,6 +68,8 @@ using namespace Utils;
namespace ProjectExplorer {
namespace Internal {
const int RunColumnWidth = 30;
static QIcon createCenteredIcon(const QIcon &icon, const QIcon &overlay)
{
QPixmap targetPixmap;
@@ -545,6 +547,8 @@ int SelectorView::optimalWidth() const
void SelectorView::setOptimalWidth(int width)
{
m_optimalWidth = width;
if (model()->columnCount() == 2)
m_optimalWidth += RunColumnWidth;
updateGeometry();
}
@@ -950,7 +954,7 @@ void MiniProjectTargetSelector::doLayout(bool keepSize)
QVector<int> widths = listWidgetWidths(minWidth, 1000);
const int runColumnWidth = widths[RUN] == -1 ? 0 : 30;
const int runColumnWidth = widths[RUN] == -1 ? 0 : RunColumnWidth;
int x = 0;
for (int i = PROJECT; i < LAST; ++i) {
int optimalWidth = widths[i];
@@ -968,7 +972,8 @@ void MiniProjectTargetSelector::doLayout(bool keepSize)
x += optimalWidth + 1; //1 extra pixel for the separators or the right border
}
m_listWidgets[RUN]->setColumnWidth(0, m_listWidgets[RUN]->size().width() - runColumnWidth);
m_listWidgets[RUN]->setColumnWidth(0, m_listWidgets[RUN]->size().width() - runColumnWidth
- m_listWidgets[RUN]->padding());
m_listWidgets[RUN]->setColumnWidth(1, runColumnWidth);
m_summaryLabel->resize(x - 1, summaryLabelHeight);
m_kitAreaWidget->resize(x - 1, kitAreaHeight);