Skip to content

Commit d4745e8

Browse files
committed
fix: Bluetooth item listView can display full items
ensure content widget height adapts to scroll area size Log: as title Pms: BUG-300891
1 parent 972165c commit d4745e8

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

plugins/dde-dock/bluetooth/componments/bluetoothapplet.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -357,8 +357,10 @@ void BluetoothApplet::updateSize()
357357
m_disableWidget->isVisibleTo(this) ? m_disableWidget->setFixedHeight(height - settingHeight - adapterHeight) : m_disableWidget->setFixedHeight(0);
358358

359359
// 设置滚动区高度
360-
m_scrollArea->setFixedHeight(height - settingHeight - m_disableWidget->height() - m_airplaneModeWidget->height());
361-
m_contentWidget->setMinimumHeight(adapterHeight);
360+
const int scrollAreaHeight = height - settingHeight - m_disableWidget->height() - m_airplaneModeWidget->height();
361+
m_scrollArea->setFixedHeight(scrollAreaHeight);
362+
// 确保内容控件高度至少等于适配器高度,并且不会超过滚动区域的高度太多
363+
m_contentWidget->setMinimumHeight(qMax(adapterHeight, scrollAreaHeight));
362364

363365
// top and bottom margin
364366
height += hMargins;

0 commit comments

Comments
 (0)