dde-dock/frame/item/systemtraypluginitem.cpp
listenerri e9c48fb2f0 refactor(system-tray): new fashion system tray
Change-Id: I7d359c1a33fbb32bc174026e7aee130d328313ef
2018-10-22 10:06:12 +08:00

23 lines
816 B
C++
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#include "systemtraypluginitem.h"
#include <QEvent>
SystemTrayPluginItem::SystemTrayPluginItem(PluginsItemInterface * const pluginInter, const QString &itemKey, QWidget *parent)
: PluginsItem(pluginInter, itemKey, parent)
{
}
bool SystemTrayPluginItem::eventFilter(QObject *watched, QEvent *e)
{
// 时尚模式下
// 监听插件Widget的"FashionSystemTraySize"属性
// 当接收到这个属性变化的事件后重新计算和设置dock的大小
if (watched == centralWidget() && e->type() == QEvent::DynamicPropertyChange
&& static_cast<QDynamicPropertyChangeEvent *>(e)->propertyName() == "FashionSystemTraySize") {
Q_EMIT fashionSystemTraySizeChanged(watched->property("FashionSystemTraySize").toSize());
}
return PluginsItem::eventFilter(watched, e);
}