mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-02 15:45:21 +00:00
fix: 修复快捷面板应用打开详细页面位置错误的问题
快捷面板点击到了非展开区域的情况下,直接打开快捷面板的弹出窗口,导致隐藏了快捷面板窗口 Log: 优化快捷面板交互问题 Influence: 从快捷面板展开蓝牙或者网络右侧的展开按钮,观察是否显示正常 Task: https://pms.uniontech.com/task-view-211641.html Change-Id: I52a3a74d035aed28465d82c5efb680f9ddb9ded8
This commit is contained in:
parent
3a5e8c1ec6
commit
3e84154462
@ -77,8 +77,8 @@ bool QuickSettingItem::eventFilter(QObject *obj, QEvent *event)
|
||||
if (!command.isEmpty())
|
||||
QProcess::startDetached(command);
|
||||
|
||||
if (QWidget *w = m_pluginInter->itemPopupApplet(m_itemKey))
|
||||
showPopupApplet(w);
|
||||
if (!isPrimary())
|
||||
Q_EMIT detailClicked(m_pluginInter);
|
||||
}
|
||||
} else if (event->type() == QEvent::Resize) {
|
||||
if (obj == m_nameLabel) {
|
||||
|
@ -250,6 +250,39 @@ bool QuickSettingContainer::isApplet(PluginsItemInterface *itemInter) const
|
||||
return json.value("applet").toBool();
|
||||
}
|
||||
|
||||
bool QuickSettingContainer::isQuickPlugin(PluginsItemInterface *itemInter) const
|
||||
{
|
||||
// 先判断是否为快捷面板区域(类似声音、亮度,音乐等)
|
||||
QWidget *itemWidget = itemInter->itemWidget(QUICK_ITEM_KEY);
|
||||
if (itemWidget) {
|
||||
for (int i = 0; i < m_componentWidget->layout()->count(); i++) {
|
||||
QLayoutItem *layoutItem = m_componentWidget->layout()->itemAt(i);
|
||||
if (!layoutItem)
|
||||
continue;
|
||||
|
||||
DBlurEffectWidget *effectWidget = qobject_cast<DBlurEffectWidget *>(layoutItem->widget());
|
||||
if (!effectWidget || !effectWidget->layout())
|
||||
continue;
|
||||
|
||||
for (int j = 0; j < effectWidget->layout()->count(); j++) {
|
||||
QLayoutItem *layoutItem = effectWidget->layout()->itemAt(i);
|
||||
if (!layoutItem || layoutItem->widget() != itemWidget)
|
||||
continue;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (QuickSettingItem *settingItem : m_quickSettings) {
|
||||
if (settingItem->pluginItem() != itemInter)
|
||||
continue;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void QuickSettingContainer::onPluginInsert(PluginsItemInterface * itemInter)
|
||||
{
|
||||
QWidget *itemWidget = itemInter->itemWidget(QUICK_ITEM_KEY);
|
||||
@ -524,13 +557,11 @@ void QuickSettingContainer::onResizeView()
|
||||
|
||||
void QuickSettingContainer::onRequestAppletShow(PluginsItemInterface *itemInter, const QString &itemKey)
|
||||
{
|
||||
if (itemKey == QUICK_ITEM_KEY) {
|
||||
// 显示弹出的内容
|
||||
QWidget *itemApplet = itemInter->itemPopupApplet(itemKey);
|
||||
if (!itemApplet)
|
||||
return;
|
||||
// 显示弹出的内容
|
||||
QWidget *itemApplet = itemInter->itemPopupApplet(itemKey);
|
||||
if (!itemApplet)
|
||||
return;
|
||||
|
||||
showWidget(itemApplet, itemInter->pluginDisplayName());
|
||||
onResizeView();
|
||||
}
|
||||
showWidget(itemApplet, itemInter->pluginDisplayName());
|
||||
onResizeView();
|
||||
}
|
||||
|
@ -85,6 +85,8 @@ private:
|
||||
QPoint hotSpot(const QPixmap &pixmap);
|
||||
// 判断是否支持显示在面板上
|
||||
bool isApplet(PluginsItemInterface * itemInter) const;
|
||||
// 判断插件是否在当前快捷面板上
|
||||
bool isQuickPlugin(PluginsItemInterface * itemInter) const;
|
||||
|
||||
private:
|
||||
static DockPopupWindow *m_popWindow;
|
||||
|
Loading…
x
Reference in New Issue
Block a user