fix: 解决accesible问题

通知中心的tips消息是根据数量改变的需要按照objectName来显示,不可变换,系统插件和托盘插件未显示对应的信息
Log: 修改自动化标记问题


(cherry picked from commit 52b5cfa1f46a245c4c72a52593de6a5805f69ef8)
This commit is contained in:
fengshaoxiong 2020-07-16 06:28:02 +00:00 committed by 黎仲鸣
parent 52e62425e9
commit 218e6ae867
5 changed files with 7 additions and 3 deletions

View File

@ -69,7 +69,8 @@ void DockPopupWindow::setContent(QWidget *content)
QAccessibleEvent event(this, QAccessible::NameChanged);
QAccessible::updateAccessibility(&event);
setAccessibleName(content->objectName() + "-popup");
if (!content->objectName().trimmed().isEmpty())
setAccessibleName(content->objectName() + "-popup");
DArrowRectangle::setContent(content);
}

View File

@ -91,7 +91,7 @@ SET_FORM_ACCESSIBLE(MultitaskingWidget, "plugin-multitasking")
SET_FORM_ACCESSIBLE(ShowDesktopWidget, "plugin-showdesktop")
SET_FORM_ACCESSIBLE(OverlayWarningWidget, "plugin-overlaywarningwidget")
SET_FORM_ACCESSIBLE(QWidget, m_w->objectName().isEmpty() ? "widget" : m_w->objectName())
SET_LABEL_ACCESSIBLE(QLabel, m_w->text().isEmpty() ? m_w->objectName().isEmpty() ? "text" : m_w->objectName() : m_w->text())
SET_LABEL_ACCESSIBLE(QLabel, m_w->objectName() == "notifications" ? m_w->objectName() : m_w->text().isEmpty() ? m_w->objectName().isEmpty() ? "text" : m_w->objectName() : m_w->text())
SET_BUTTON_ACCESSIBLE(DIconButton, m_w->objectName().isEmpty() ? "imagebutton" : m_w->objectName())
SET_BUTTON_ACCESSIBLE(DSwitchButton, m_w->text().isEmpty() ? "switchbutton" : m_w->text())
SET_BUTTON_ACCESSIBLE(DesktopWidget, "desktopWidget");

View File

@ -40,7 +40,7 @@ TrashPlugin::TrashPlugin(QObject *parent)
, m_trashWidget(nullptr)
, m_tipsLabel(new TipsWidget)
{
m_tipsLabel->setObjectName("trashtips");
m_tipsLabel->setObjectName("trash");
}
const QString TrashPlugin::pluginName() const

View File

@ -603,6 +603,7 @@ void SNITrayWidget::showHoverTips()
return;
m_tipsLabel->setText(tooltip.title);
m_tipsLabel->setAccessibleName(tooltip.title);
showPopupWindow(m_tipsLabel);
}

View File

@ -137,11 +137,13 @@ void SystemTrayItem::sendClick(uint8_t mouseButton, int x, int y)
QWidget *SystemTrayItem::trayTipsWidget()
{
m_pluginInter->itemTipsWidget(m_itemKey)->setAccessibleName(m_pluginInter->pluginName());
return m_pluginInter->itemTipsWidget(m_itemKey);
}
QWidget *SystemTrayItem::trayPopupApplet()
{
m_pluginInter->itemPopupApplet(m_itemKey)->setAccessibleName(m_pluginInter->pluginName());
return m_pluginInter->itemPopupApplet(m_itemKey);
}