Skip to content

Commit 8765fb2

Browse files
committed
fix: Avoid display scrollbar in the vertical direction when a single row of users displayed
m_centerWidget added a maximum height constraint based on the scroll area height to improve layout management. Log: as title Pms: BUG-313337
1 parent c368e31 commit 8765fb2

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/session-widgets/userframelist.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ UserFrameList::UserFrameList(QWidget *parent)
4545

4646
void UserFrameList::initUI()
4747
{
48-
m_centerWidget = new QWidget;
48+
m_centerWidget = new QWidget(this);
4949
m_centerWidget->setAccessibleName("UserFrameListCenterWidget");
5050

5151
m_flowLayout = new DFlowLayout(m_centerWidget);
@@ -273,6 +273,7 @@ void UserFrameList::updateLayout(int width)
273273
if (countWidth > 0) {
274274
if (m_flowLayout->count() <= count) {
275275
m_scrollArea->setFixedSize(countWidth, userWidgetHeight + 20);
276+
m_centerWidget->setMaximumHeight(m_scrollArea->height());
276277
} else {
277278
m_scrollArea->setFixedSize(countWidth, (userWidgetHeight + UserFrameSpacing) * 2);
278279
}

0 commit comments

Comments
 (0)