ProjectExplorer: Fix widths distributions in project welcome page

The widths of the "Sessions" and "Projects" lists are not well
distributed on Full HD screen width. The sessions are squeezed and the
projects are extra wide.

Set a stretch factor also on the Settings widget, so that both stretch
proportionally. Use a 1 to 3 ratio.

This change also removes the setting of struts which does not appear to
have any effect and was (by mistake?) assigned to one sublayout, twice.

Fixes: QTCREATORBUG-26319
Change-Id: I365a6a6c5d9c2250e3f711cc139d3279f2f5e3b1
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
Alessandro Portale
2021-09-24 23:15:17 +02:00
parent 9b16a14ee4
commit a6702d5a2d

View File

@@ -614,14 +614,12 @@ public:
auto vbox1 = new QVBoxLayout;
vbox1->setContentsMargins(0, 0, 0, 0);
vbox1->addStrut(200);
vbox1->addItem(hbox11);
vbox1->addSpacing(16);
vbox1->addWidget(sessionsList);
auto vbox2 = new QVBoxLayout;
vbox2->setContentsMargins(0, 0, 0, 0);
vbox1->addStrut(200);
vbox2->addItem(hbox21);
vbox2->addSpacing(16);
vbox2->addWidget(projectsList);
@@ -629,9 +627,10 @@ public:
auto hbox = new QHBoxLayout(this);
hbox->setContentsMargins(30, 27, 0, 27);
hbox->addItem(vbox1);
hbox->setStretchFactor(vbox1, 1);
hbox->addSpacing(16);
hbox->addItem(vbox2);
hbox->setStretchFactor(vbox2, 2);
hbox->setStretchFactor(vbox2, 3);
}
SessionDelegate m_sessionDelegate;