Skip to content

Commit c62b808

Browse files
yixinsharkdeepin-bot[bot]
authored andcommitted
fix: When a Bluetooth device is connected, the list of other devices is automatically collapsed
When a Bluetooth device is connected, cancel the automatic collapse of the list of other devices Log: as title Pms: BUG-284983
1 parent 12c389f commit c62b808

File tree

2 files changed

+2
-18
lines changed

2 files changed

+2
-18
lines changed

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

Lines changed: 2 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ BluetoothAdapterItem::BluetoothAdapterItem(Adapter *adapter, QWidget *parent)
8181
, m_showUnnamedDevices(false)
8282
, m_stateBtnEnabled(true)
8383
, m_adapterSwitchEnabled(true)
84-
, m_autoFold(true)
8584
, m_scanTimer(new QTimer(this))
8685
{
8786
initUi();
@@ -254,8 +253,7 @@ void BluetoothAdapterItem::onDeviceAdded(const Device *device)
254253
}
255254
}
256255
m_myDeviceWidget->setVisible(m_myDeviceModel->rowCount() > 0 && m_adapterStateBtn->isChecked());
257-
if(m_autoFold)
258-
m_otherDeviceControlWidget->setExpandState(m_myDeviceModel->rowCount() < 1 && m_adapterStateBtn->isChecked());
256+
259257
if (m_adapterSwitchEnabled) {
260258
emit deviceCountChanged();
261259
}
@@ -277,8 +275,6 @@ void BluetoothAdapterItem::onDeviceAdded(const Device *device)
277275
emit deviceCountChanged();
278276
}
279277
m_myDeviceWidget->setVisible(m_myDeviceModel->rowCount() > 0 && m_adapterStateBtn->isChecked());
280-
if(m_autoFold)
281-
m_otherDeviceControlWidget->setExpandState(m_myDeviceModel->rowCount() < 1 && m_adapterStateBtn->isChecked());
282278
}
283279

284280
void BluetoothAdapterItem::onDeviceRemoved(const Device *device)
@@ -462,9 +458,7 @@ void BluetoothAdapterItem::initConnect()
462458
emit deviceCountChanged();
463459
}
464460
});
465-
connect(m_otherDeviceControlWidget, &DeviceControlWidget::clicked, this, [this] {
466-
m_autoFold = false;
467-
});
461+
468462
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, [this]{
469463
updateMyDeviceLabelTheme();
470464
update();
@@ -543,14 +537,6 @@ void BluetoothAdapterItem::showEvent(QShowEvent *event)
543537
QWidget::showEvent(event);
544538
}
545539

546-
void BluetoothAdapterItem::hideEvent(QHideEvent *event)
547-
{
548-
// 面板隐藏时,重置为自动折叠模式,下次显示时使用默认行为
549-
m_autoFold = true;
550-
551-
QWidget::hideEvent(event);
552-
}
553-
554540
void BluetoothAdapterItem::updateMyDeviceLabelTheme()
555541
{
556542
DPalette palette = DPaletteHelper::instance()->palette(m_myDeviceLabel);

plugins/dde-dock/bluetooth/componments/bluetoothadapteritem.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,7 +165,6 @@ public slots:
165165

166166
protected:
167167
void showEvent(QShowEvent *event) override;
168-
void hideEvent(QHideEvent *event) override;
169168

170169
signals:
171170
void adapterPowerChanged();
@@ -199,7 +198,6 @@ public slots:
199198
bool m_showUnnamedDevices;
200199
bool m_stateBtnEnabled;
201200
bool m_adapterSwitchEnabled;
202-
bool m_autoFold;
203201

204202
QTimer *m_scanTimer;
205203

0 commit comments

Comments
 (0)