mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 09:23:03 +00:00
fix: 修复快捷面板插件子面板无法关闭主面板的问题
在子插件点击相应的功能按钮的时候,调用requestSetAppletVisible方法来隐藏面板 Log: 优化快捷面板插件功能 Influence: 进入快捷面板的蓝牙子界面点击设置,进入声音子界面点击设置,进入亮度调整子界面点击设置,在弹出对应的功能后,观察快捷面板是否隐藏 Task: https://pms.uniontech.com/task-view-222353.html Change-Id: Ifeb450497c17220545fbda10c159f1e50b00c534
This commit is contained in:
parent
b337d88dd4
commit
f295b434f8
@ -67,6 +67,7 @@ BluetoothItem::BluetoothItem(AdaptersManager *adapterManager, QWidget *parent)
|
|||||||
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, &BluetoothItem::refreshIcon);
|
connect(DGuiApplicationHelper::instance(), &DGuiApplicationHelper::themeTypeChanged, this, &BluetoothItem::refreshIcon);
|
||||||
connect(m_applet, &BluetoothApplet::noAdapter, this, &BluetoothItem::noAdapter);
|
connect(m_applet, &BluetoothApplet::noAdapter, this, &BluetoothItem::noAdapter);
|
||||||
connect(m_applet, &BluetoothApplet::justHasAdapter, this, &BluetoothItem::justHasAdapter);
|
connect(m_applet, &BluetoothApplet::justHasAdapter, this, &BluetoothItem::justHasAdapter);
|
||||||
|
connect(m_applet, &BluetoothApplet::requestHide, this, &BluetoothItem::requestHide);
|
||||||
}
|
}
|
||||||
|
|
||||||
QWidget *BluetoothItem::tipsWidget()
|
QWidget *BluetoothItem::tipsWidget()
|
||||||
|
@ -62,6 +62,7 @@ signals:
|
|||||||
void requestContextMenu() const;
|
void requestContextMenu() const;
|
||||||
void noAdapter();
|
void noAdapter();
|
||||||
void justHasAdapter();
|
void justHasAdapter();
|
||||||
|
void requestHide();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Dock::TipsWidget *m_tipsLabel;
|
Dock::TipsWidget *m_tipsLabel;
|
||||||
|
@ -60,15 +60,18 @@ void BluetoothPlugin::init(PluginProxyInterface *proxyInter)
|
|||||||
|
|
||||||
m_bluetoothWidget.reset(new BluetoothMainWidget(m_adapterManager));
|
m_bluetoothWidget.reset(new BluetoothMainWidget(m_adapterManager));
|
||||||
|
|
||||||
connect(m_bluetoothItem.data(), &BluetoothItem::justHasAdapter, [&] {
|
connect(m_bluetoothItem.data(), &BluetoothItem::justHasAdapter, [ this ] {
|
||||||
m_proxyInter->itemAdded(this, BLUETOOTH_KEY);
|
m_proxyInter->itemAdded(this, BLUETOOTH_KEY);
|
||||||
});
|
});
|
||||||
connect(m_bluetoothItem.data(), &BluetoothItem::noAdapter, [&] {
|
connect(m_bluetoothItem.data(), &BluetoothItem::requestHide, [ this ] {
|
||||||
|
m_proxyInter->requestSetAppletVisible(this, QUICK_ITEM_KEY, false);
|
||||||
|
});
|
||||||
|
connect(m_bluetoothItem.data(), &BluetoothItem::noAdapter, [ this ] {
|
||||||
m_proxyInter->requestSetAppletVisible(this, QUICK_ITEM_KEY, false);
|
m_proxyInter->requestSetAppletVisible(this, QUICK_ITEM_KEY, false);
|
||||||
m_proxyInter->requestSetAppletVisible(this, BLUETOOTH_KEY, false);
|
m_proxyInter->requestSetAppletVisible(this, BLUETOOTH_KEY, false);
|
||||||
m_proxyInter->itemRemoved(this, BLUETOOTH_KEY);
|
m_proxyInter->itemRemoved(this, BLUETOOTH_KEY);
|
||||||
});
|
});
|
||||||
connect(m_bluetoothWidget.data(), &BluetoothMainWidget::requestExpand, this, [ = ] {
|
connect(m_bluetoothWidget.data(), &BluetoothMainWidget::requestExpand, this, [ this ] {
|
||||||
m_proxyInter->requestSetAppletVisible(this, QUICK_ITEM_KEY, true);
|
m_proxyInter->requestSetAppletVisible(this, QUICK_ITEM_KEY, true);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
@ -302,6 +302,7 @@ void BluetoothApplet::initConnect()
|
|||||||
.method(QString("ShowPage"))
|
.method(QString("ShowPage"))
|
||||||
.arg(QString("bluetooth"))
|
.arg(QString("bluetooth"))
|
||||||
.call();
|
.call();
|
||||||
|
emit requestHide();
|
||||||
});
|
});
|
||||||
connect(DApplicationHelper::instance(), &DApplicationHelper::themeTypeChanged, this, &BluetoothApplet::updateIconTheme);
|
connect(DApplicationHelper::instance(), &DApplicationHelper::themeTypeChanged, this, &BluetoothApplet::updateIconTheme);
|
||||||
connect(m_airPlaneModeInter, &DBusAirplaneMode::EnabledChanged, this, &BluetoothApplet::setAirplaneModeEnabled);
|
connect(m_airPlaneModeInter, &DBusAirplaneMode::EnabledChanged, this, &BluetoothApplet::setAirplaneModeEnabled);
|
||||||
|
@ -102,6 +102,7 @@ signals:
|
|||||||
void justHasAdapter();
|
void justHasAdapter();
|
||||||
void powerChanged(bool state);
|
void powerChanged(bool state);
|
||||||
void deviceStateChanged(const Device *device);
|
void deviceStateChanged(const Device *device);
|
||||||
|
void requestHide();
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
// 蓝牙适配器增加
|
// 蓝牙适配器增加
|
||||||
|
@ -73,6 +73,9 @@ void DisplayPlugin::init(PluginProxyInterface *proxyInter)
|
|||||||
connect(m_displayWidget.data(), &BrightnessWidget::brightClicked, this, [ this ] {
|
connect(m_displayWidget.data(), &BrightnessWidget::brightClicked, this, [ this ] {
|
||||||
m_proxyInter->requestSetAppletVisible(this, QUICK_ITEM_KEY, true);
|
m_proxyInter->requestSetAppletVisible(this, QUICK_ITEM_KEY, true);
|
||||||
});
|
});
|
||||||
|
connect(m_displaySettingWidget.data(), &DisplaySettingWidget::requestHide, this, [ this ] {
|
||||||
|
m_proxyInter->requestSetAppletVisible(this, QUICK_ITEM_KEY, false);
|
||||||
|
});
|
||||||
connect(m_model.data(), &BrightnessModel::screenVisibleChanged, this, [ this ](bool visible) {
|
connect(m_model.data(), &BrightnessModel::screenVisibleChanged, this, [ this ](bool visible) {
|
||||||
if (visible)
|
if (visible)
|
||||||
m_proxyInter->itemAdded(this, pluginName());
|
m_proxyInter->itemAdded(this, pluginName());
|
||||||
|
@ -42,7 +42,7 @@ DisplaySettingWidget::DisplaySettingWidget(QWidget *parent)
|
|||||||
.path("/org/deepin/dde/ControlCenter1")
|
.path("/org/deepin/dde/ControlCenter1")
|
||||||
.interface("org.deepin.dde.ControlCenter1")
|
.interface("org.deepin.dde.ControlCenter1")
|
||||||
.method("ShowPage").arg(QString("display")).call();
|
.method("ShowPage").arg(QString("display")).call();
|
||||||
hide();
|
Q_EMIT requestHide();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -34,9 +34,13 @@ class DevCollaborationWidget;
|
|||||||
class DisplaySettingWidget : public QWidget
|
class DisplaySettingWidget : public QWidget
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit DisplaySettingWidget(QWidget *parent = nullptr);
|
explicit DisplaySettingWidget(QWidget *parent = nullptr);
|
||||||
|
|
||||||
|
Q_SIGNALS:
|
||||||
|
void requestHide();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
void initUI();
|
void initUI();
|
||||||
void resizeWidgetHeight();
|
void resizeWidgetHeight();
|
||||||
|
@ -449,7 +449,7 @@ void SoundDevicesWidget::onSelectIndexChanged(const QModelIndex &index)
|
|||||||
.path("/org/deepin/dde/ControlCenter1")
|
.path("/org/deepin/dde/ControlCenter1")
|
||||||
.interface("org.deepin.dde.ControlCenter1")
|
.interface("org.deepin.dde.ControlCenter1")
|
||||||
.method("ShowPage").arg(QString("sound")).call();
|
.method("ShowPage").arg(QString("sound")).call();
|
||||||
hide();
|
emit requestHide();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -53,6 +53,7 @@ public:
|
|||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
void enableChanged(bool);
|
void enableChanged(bool);
|
||||||
|
void requestHide();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
bool eventFilter(QObject *watcher, QEvent *event) override;
|
bool eventFilter(QObject *watcher, QEvent *event) override;
|
||||||
|
@ -70,6 +70,9 @@ void SoundPlugin::init(PluginProxyInterface *proxyInter)
|
|||||||
}
|
}
|
||||||
|
|
||||||
connect(m_soundDeviceWidget.data(), &SoundDevicesWidget::enableChanged, m_soundWidget.data(), &SoundWidget::setEnabled);
|
connect(m_soundDeviceWidget.data(), &SoundDevicesWidget::enableChanged, m_soundWidget.data(), &SoundWidget::setEnabled);
|
||||||
|
connect(m_soundDeviceWidget.data(), &SoundDevicesWidget::requestHide, this, [ this ] {
|
||||||
|
m_proxyInter->requestSetAppletVisible(this, QUICK_ITEM_KEY, false);
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
void SoundPlugin::pluginStateSwitched()
|
void SoundPlugin::pluginStateSwitched()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user