Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions plugins/dde-dock/bluetooth/componments/bluetoothapplet.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -340,16 +340,16 @@ void BluetoothApplet::updateSize()
static const int settingHeight = DeviceItemHeight + 10 + 10;
height += settingHeight;

// 如果比快捷面板允许的最小高度还小,则以快捷面板允许的最小高度为准
const int hMargins = m_mainLayout->contentsMargins().top() + m_mainLayout->contentsMargins().bottom();
height = qMax(m_minHeight - hMargins, height);

// 最大的高度为显示8个设备的高度
static const int maxHeight = (TitleHeight + TitleSpace) + (MaxDeviceCount * DeviceItemHeight) + ((MaxDeviceCount-1) * 10) + settingHeight;

// 如果比允许的最大高度还大,则以最大高度为准
height = qMin(maxHeight, height);

// 如果比快捷面板允许的最小高度还小,则以快捷面板允许的最小高度为准
const int hMargins = m_mainLayout->contentsMargins().top() + m_mainLayout->contentsMargins().bottom();
height = qMax(m_minHeight - hMargins, height);

// 加上飞行模式提示控件高度
m_airplaneModeWidget->isVisibleTo(this) ? m_airplaneModeWidget->setFixedHeight(height - settingHeight - adapterHeight) : m_airplaneModeWidget->setFixedHeight(0);

Expand Down