From 02a785b26c998d0da98662aab661f04e1ef3e8d4 Mon Sep 17 00:00:00 2001 From: zhaoyingzhen Date: Mon, 18 Aug 2025 15:09:37 +0800 Subject: [PATCH] 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 --- src/session-widgets/userframelist.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/session-widgets/userframelist.cpp b/src/session-widgets/userframelist.cpp index 1817835a..33bf438e 100644 --- a/src/session-widgets/userframelist.cpp +++ b/src/session-widgets/userframelist.cpp @@ -45,7 +45,7 @@ UserFrameList::UserFrameList(QWidget *parent) void UserFrameList::initUI() { - m_centerWidget = new QWidget; + m_centerWidget = new QWidget(this); m_centerWidget->setAccessibleName("UserFrameListCenterWidget"); m_flowLayout = new DFlowLayout(m_centerWidget); @@ -273,6 +273,7 @@ void UserFrameList::updateLayout(int width) if (countWidth > 0) { if (m_flowLayout->count() <= count) { m_scrollArea->setFixedSize(countWidth, userWidgetHeight + 20); + m_centerWidget->setMaximumHeight(m_scrollArea->height()); } else { m_scrollArea->setFixedSize(countWidth, (userWidgetHeight + UserFrameSpacing) * 2); }