mirror of
https://github.com/linuxdeepin/dde-dock.git
synced 2025-06-04 17:33:05 +00:00
refactor: rename system-tray to tray
Change-Id: Ic5fcbb85851aebb490ab633b355d77fa3d578914
This commit is contained in:
parent
efd8e01e6a
commit
b696c4daf2
Notes:
gerrit
2018-11-20 14:39:17 +08:00
Verified+1: <jenkins@deepin.com> Code-Review+2: listenerri <listenerri@gmail.com> Submitted-by: listenerri <listenerri@gmail.com> Submitted-at: Tue, 20 Nov 2018 14:39:17 +0800 Reviewed-on: https://cr.deepin.io/39861 Project: dde/dde-dock Branch: refs/heads/master
@ -24,7 +24,7 @@
|
||||
#include "item/stretchitem.h"
|
||||
#include "item/launcheritem.h"
|
||||
#include "item/pluginsitem.h"
|
||||
#include "item/systemtraypluginitem.h"
|
||||
#include "item/traypluginitem.h"
|
||||
#include "util/docksettings.h"
|
||||
|
||||
#include <QDebug>
|
||||
@ -89,7 +89,7 @@ void DockItemController::updatePluginsItemOrderKey()
|
||||
for (auto item : m_itemList)
|
||||
{
|
||||
DockItem::ItemType tyep = item->itemType();
|
||||
if (item.isNull() || (tyep != DockItem::Plugins && tyep != DockItem::SystemTrayPlugin))
|
||||
if (item.isNull() || (tyep != DockItem::Plugins && tyep != DockItem::TrayPlugin))
|
||||
continue;
|
||||
static_cast<PluginsItem *>(item.data())->setItemSortKey(++index);
|
||||
}
|
||||
@ -108,8 +108,8 @@ void DockItemController::itemMove(DockItem * const moveItem, DockItem * const re
|
||||
return;
|
||||
|
||||
// plugins move
|
||||
if (moveType == DockItem::Plugins || moveType == DockItem::SystemTrayPlugin)
|
||||
if (replaceType != DockItem::Plugins && replaceType != DockItem::SystemTrayPlugin)
|
||||
if (moveType == DockItem::Plugins || moveType == DockItem::TrayPlugin)
|
||||
if (replaceType != DockItem::Plugins && replaceType != DockItem::TrayPlugin)
|
||||
return;
|
||||
|
||||
const int moveIndex = m_itemList.indexOf(moveItem);
|
||||
@ -124,7 +124,7 @@ void DockItemController::itemMove(DockItem * const moveItem, DockItem * const re
|
||||
|
||||
// update plugins sort key if order changed
|
||||
if (moveType == DockItem::Plugins || replaceType == DockItem::Plugins
|
||||
|| moveType == DockItem::SystemTrayPlugin || replaceType == DockItem::SystemTrayPlugin)
|
||||
|| moveType == DockItem::TrayPlugin || replaceType == DockItem::TrayPlugin)
|
||||
m_updatePluginsOrderTimer->start();
|
||||
|
||||
// for app move, index 0 is launcher item, need to pass it.
|
||||
@ -136,7 +136,7 @@ void DockItemController::itemMove(DockItem * const moveItem, DockItem * const re
|
||||
|
||||
void DockItemController::itemDroppedIntoContainer(DockItem * const item)
|
||||
{
|
||||
Q_ASSERT(item->itemType() == DockItem::Plugins || item->itemType() == DockItem::SystemTrayPlugin);
|
||||
Q_ASSERT(item->itemType() == DockItem::Plugins || item->itemType() == DockItem::TrayPlugin);
|
||||
|
||||
PluginsItem *pi = static_cast<PluginsItem *>(item);
|
||||
|
||||
@ -167,7 +167,7 @@ void DockItemController::itemDragOutFromContainer(DockItem * const item)
|
||||
switch (item->itemType())
|
||||
{
|
||||
case DockItem::Plugins:
|
||||
case DockItem::SystemTrayPlugin:
|
||||
case DockItem::TrayPlugin:
|
||||
static_cast<PluginsItem *>(item)->setInContainer(false);
|
||||
pluginItemInserted(static_cast<PluginsItem *>(item));
|
||||
break;
|
||||
@ -196,7 +196,7 @@ void DockItemController::placeholderItemRemoved(PlaceholderItem *item)
|
||||
m_itemList.removeOne(item);
|
||||
}
|
||||
|
||||
// refresh right spliter visible of fashion system tray plugin item
|
||||
// refresh right spliter visible of fashion tray plugin item
|
||||
void DockItemController::refreshFSTItemSpliterVisible()
|
||||
{
|
||||
if (DockSettings::Instance().displayMode() != Dock::DisplayMode::Fashion) {
|
||||
@ -204,8 +204,8 @@ void DockItemController::refreshFSTItemSpliterVisible()
|
||||
}
|
||||
|
||||
for (int i = 0; i < m_itemList.size(); ++i) {
|
||||
if (m_itemList.at(i)->itemType() == DockItem::ItemType::SystemTrayPlugin) {
|
||||
static_cast<SystemTrayPluginItem *>(m_itemList.at(i).data())
|
||||
if (m_itemList.at(i)->itemType() == DockItem::ItemType::TrayPlugin) {
|
||||
static_cast<TrayPluginItem *>(m_itemList.at(i).data())
|
||||
->setRightSplitVisible(i != (m_itemList.size() - 1));
|
||||
break;
|
||||
}
|
||||
@ -250,7 +250,7 @@ DockItemController::DockItemController(QObject *parent)
|
||||
connect(m_pluginsInter, &DockPluginsController::pluginItemInserted, this, &DockItemController::pluginItemInserted, Qt::QueuedConnection);
|
||||
connect(m_pluginsInter, &DockPluginsController::pluginItemRemoved, this, &DockItemController::pluginItemRemoved, Qt::QueuedConnection);
|
||||
connect(m_pluginsInter, &DockPluginsController::pluginItemUpdated, this, &DockItemController::itemUpdated, Qt::QueuedConnection);
|
||||
connect(m_pluginsInter, &DockPluginsController::fashionSystemTraySizeChanged, this, &DockItemController::fashionSystemTraySizeChanged, Qt::QueuedConnection);
|
||||
connect(m_pluginsInter, &DockPluginsController::fashionTraySizeChanged, this, &DockItemController::fashionTraySizeChanged, Qt::QueuedConnection);
|
||||
|
||||
QMetaObject::invokeMethod(this, "refershItemsIcon", Qt::QueuedConnection);
|
||||
}
|
||||
@ -318,7 +318,7 @@ void DockItemController::pluginItemInserted(PluginsItem *item)
|
||||
for (int i(0); i != m_itemList.size(); ++i)
|
||||
{
|
||||
DockItem::ItemType type = m_itemList[i]->itemType();
|
||||
if (type != DockItem::Plugins && type != DockItem::SystemTrayPlugin)
|
||||
if (type != DockItem::Plugins && type != DockItem::TrayPlugin)
|
||||
continue;
|
||||
|
||||
firstPluginPosition = i;
|
||||
@ -390,7 +390,7 @@ void DockItemController::sortPluginItems()
|
||||
for (int i(0); i != m_itemList.size(); ++i)
|
||||
{
|
||||
DockItem::ItemType type = m_itemList[i]->itemType();
|
||||
if (type == DockItem::Plugins || type == DockItem::SystemTrayPlugin)
|
||||
if (type == DockItem::Plugins || type == DockItem::TrayPlugin)
|
||||
{
|
||||
firstPluginIndex = i;
|
||||
break;
|
||||
|
@ -53,7 +53,7 @@ signals:
|
||||
void itemMoved(DockItem *item, const int index) const;
|
||||
void itemManaged(DockItem *item) const;
|
||||
void itemUpdated(DockItem *item) const;
|
||||
void fashionSystemTraySizeChanged(const QSize &systemTraySize) const;
|
||||
void fashionTraySizeChanged(const QSize &traySize) const;
|
||||
|
||||
public slots:
|
||||
void refershItemsIcon();
|
||||
|
@ -23,7 +23,7 @@
|
||||
#include "pluginsiteminterface.h"
|
||||
#include "dockitemcontroller.h"
|
||||
#include "dockpluginloader.h"
|
||||
#include "item/systemtraypluginitem.h"
|
||||
#include "item/traypluginitem.h"
|
||||
|
||||
#include <QDebug>
|
||||
#include <QDir>
|
||||
@ -48,10 +48,10 @@ void DockPluginsController::itemAdded(PluginsItemInterface * const itemInter, co
|
||||
return;
|
||||
|
||||
PluginsItem *item = nullptr;
|
||||
if (itemInter->pluginName() == "system-tray") {
|
||||
item = new SystemTrayPluginItem(itemInter, itemKey);
|
||||
connect(static_cast<SystemTrayPluginItem *>(item), &SystemTrayPluginItem::fashionSystemTraySizeChanged,
|
||||
this, &DockPluginsController::fashionSystemTraySizeChanged, Qt::UniqueConnection);
|
||||
if (itemInter->pluginName() == "tray") {
|
||||
item = new TrayPluginItem(itemInter, itemKey);
|
||||
connect(static_cast<TrayPluginItem *>(item), &TrayPluginItem::fashionTraySizeChanged,
|
||||
this, &DockPluginsController::fashionTraySizeChanged, Qt::UniqueConnection);
|
||||
} else {
|
||||
item = new PluginsItem(itemInter, itemKey);
|
||||
}
|
||||
|
@ -53,7 +53,7 @@ signals:
|
||||
void pluginItemInserted(PluginsItem *pluginItem) const;
|
||||
void pluginItemRemoved(PluginsItem *pluginItem) const;
|
||||
void pluginItemUpdated(PluginsItem *pluginItem) const;
|
||||
void fashionSystemTraySizeChanged(const QSize &systemTraySize) const;
|
||||
void fashionTraySizeChanged(const QSize &traySize) const;
|
||||
|
||||
private slots:
|
||||
void startLoader();
|
||||
|
@ -47,7 +47,7 @@ public:
|
||||
Plugins,
|
||||
Container,
|
||||
Placeholder,
|
||||
SystemTrayPlugin,
|
||||
TrayPlugin,
|
||||
};
|
||||
|
||||
public:
|
||||
|
@ -19,37 +19,37 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#include "systemtraypluginitem.h"
|
||||
#include "traypluginitem.h"
|
||||
|
||||
#include <QEvent>
|
||||
|
||||
SystemTrayPluginItem::SystemTrayPluginItem(PluginsItemInterface * const pluginInter, const QString &itemKey, QWidget *parent)
|
||||
TrayPluginItem::TrayPluginItem(PluginsItemInterface * const pluginInter, const QString &itemKey, QWidget *parent)
|
||||
: PluginsItem(pluginInter, itemKey, parent)
|
||||
{
|
||||
}
|
||||
|
||||
void SystemTrayPluginItem::setSuggestIconSize(QSize size)
|
||||
void TrayPluginItem::setSuggestIconSize(QSize size)
|
||||
{
|
||||
// invoke the method "setSuggestIconSize" of FashionTrayItem class
|
||||
QMetaObject::invokeMethod(centralWidget(), "setSuggestIconSize", Qt::QueuedConnection, Q_ARG(QSize, size));
|
||||
}
|
||||
|
||||
void SystemTrayPluginItem::setRightSplitVisible(const bool visible)
|
||||
void TrayPluginItem::setRightSplitVisible(const bool visible)
|
||||
{
|
||||
// invoke the method "setRightSplitVisible" of FashionTrayItem class
|
||||
QMetaObject::invokeMethod(centralWidget(), "setRightSplitVisible", Qt::QueuedConnection, Q_ARG(bool, visible));
|
||||
}
|
||||
|
||||
bool SystemTrayPluginItem::eventFilter(QObject *watched, QEvent *e)
|
||||
bool TrayPluginItem::eventFilter(QObject *watched, QEvent *e)
|
||||
{
|
||||
// 时尚模式下
|
||||
// 监听插件Widget的"FashionSystemTraySize"属性
|
||||
// 监听插件Widget的"FashionTraySize"属性
|
||||
// 当接收到这个属性变化的事件后,重新计算和设置dock的大小
|
||||
|
||||
if (watched == centralWidget() && e->type() == QEvent::DynamicPropertyChange) {
|
||||
const QString &propertyName = static_cast<QDynamicPropertyChangeEvent *>(e)->propertyName();
|
||||
if (propertyName == "FashionSystemTraySize") {
|
||||
Q_EMIT fashionSystemTraySizeChanged(watched->property("FashionSystemTraySize").toSize());
|
||||
if (propertyName == "FashionTraySize") {
|
||||
Q_EMIT fashionTraySizeChanged(watched->property("FashionTraySize").toSize());
|
||||
} else if (propertyName == "RequestWindowAutoHide") {
|
||||
Q_EMIT requestWindowAutoHide(watched->property("RequestWindowAutoHide").toBool());
|
||||
} else if (propertyName == "RequestRefershWindowVisible") {
|
@ -19,28 +19,28 @@
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef SYSTEMTRAYPLUGINITEM_H
|
||||
#define SYSTEMTRAYPLUGINITEM_H
|
||||
#ifndef TRAYPLUGINITEM_H
|
||||
#define TRAYPLUGINITEM_H
|
||||
|
||||
#include "pluginsitem.h"
|
||||
|
||||
class SystemTrayPluginItem : public PluginsItem
|
||||
class TrayPluginItem : public PluginsItem
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
SystemTrayPluginItem(PluginsItemInterface* const pluginInter, const QString &itemKey, QWidget *parent = 0);
|
||||
TrayPluginItem(PluginsItemInterface* const pluginInter, const QString &itemKey, QWidget *parent = 0);
|
||||
|
||||
inline ItemType itemType() const Q_DECL_OVERRIDE {return ItemType::SystemTrayPlugin;}
|
||||
inline ItemType itemType() const Q_DECL_OVERRIDE {return ItemType::TrayPlugin;}
|
||||
|
||||
void setSuggestIconSize(QSize size);
|
||||
void setRightSplitVisible(const bool visible);
|
||||
|
||||
Q_SIGNALS:
|
||||
void fashionSystemTraySizeChanged(const QSize &systemTraySize) const;
|
||||
void fashionTraySizeChanged(const QSize &traySize) const;
|
||||
|
||||
private:
|
||||
bool eventFilter(QObject *watched, QEvent *e) Q_DECL_OVERRIDE;
|
||||
};
|
||||
|
||||
#endif // SYSTEMTRAYPLUGINITEM_H
|
||||
#endif // TRAYPLUGINITEM_H
|
@ -31,7 +31,7 @@
|
||||
|
||||
#include <window/mainwindow.h>
|
||||
|
||||
#include <item/systemtraypluginitem.h>
|
||||
#include <item/traypluginitem.h>
|
||||
|
||||
static DockItem *DraggingItem = nullptr;
|
||||
static PlaceholderItem *RequestDockItem = nullptr;
|
||||
@ -311,7 +311,7 @@ void MainPanel::dragLeaveEvent(QDragLeaveEvent *e)
|
||||
|
||||
if (DraggingItem) {
|
||||
DockItem::ItemType type = DraggingItem->itemType();
|
||||
if (type != DockItem::Plugins && type != DockItem::SystemTrayPlugin)
|
||||
if (type != DockItem::Plugins && type != DockItem::TrayPlugin)
|
||||
DraggingItem->hide();
|
||||
}
|
||||
}
|
||||
@ -405,9 +405,9 @@ void MainPanel::adjustItemSize()
|
||||
int totalHeight = 0;
|
||||
const auto &itemList = m_itemController->itemList();
|
||||
|
||||
// FSTray: FashionSystemTray
|
||||
const QSize &FSTrayTotalSize = DockSettings::Instance().fashionSystemTraySize(); // the total size of FSTray
|
||||
SystemTrayPluginItem *FSTrayItem = nullptr; // the FSTray item object
|
||||
// FTray: FashionTray
|
||||
const QSize &FSTrayTotalSize = DockSettings::Instance().fashionTraySize(); // the total size of FSTray
|
||||
TrayPluginItem *FSTrayItem = nullptr; // the FSTray item object
|
||||
QSize FSTraySuggestIconSize = itemSize; // the suggested size of FStray icons
|
||||
|
||||
for (auto item : itemList)
|
||||
@ -432,11 +432,11 @@ void MainPanel::adjustItemSize()
|
||||
totalHeight += itemSize.height();
|
||||
break;
|
||||
case DockItem::Plugins:
|
||||
case DockItem::SystemTrayPlugin:
|
||||
case DockItem::TrayPlugin:
|
||||
if (m_displayMode == Fashion) {
|
||||
// 特殊处理时尚模式下的托盘插件
|
||||
if (item->itemType() == DockItem::SystemTrayPlugin) {
|
||||
FSTrayItem = static_cast<SystemTrayPluginItem *>(item.data());
|
||||
if (item->itemType() == DockItem::TrayPlugin) {
|
||||
FSTrayItem = static_cast<TrayPluginItem *>(item.data());
|
||||
if (m_position == Dock::Top || m_position == Dock::Bottom) {
|
||||
// item->setFixedWidth(FSTrayTotalSize.width());
|
||||
// item->setFixedHeight(itemSize.height());
|
||||
@ -548,7 +548,7 @@ void MainPanel::adjustItemSize()
|
||||
if (m_itemController->itemIsInContainer(item))
|
||||
continue;
|
||||
}
|
||||
if (itemType == DockItem::SystemTrayPlugin) {
|
||||
if (itemType == DockItem::TrayPlugin) {
|
||||
if (m_displayMode == Dock::Fashion) {
|
||||
switch (m_position) {
|
||||
case Dock::Top:
|
||||
@ -651,7 +651,7 @@ void MainPanel::itemDragStarted()
|
||||
static_cast<QGraphicsView *>(m_appDragWidget)->viewport()->installEventFilter(this);
|
||||
}
|
||||
|
||||
if (draggingTyep == DockItem::Plugins || draggingTyep == DockItem::SystemTrayPlugin)
|
||||
if (draggingTyep == DockItem::Plugins || draggingTyep == DockItem::TrayPlugin)
|
||||
{
|
||||
if (static_cast<PluginsItem *>(DraggingItem)->allowContainer())
|
||||
{
|
||||
@ -688,7 +688,7 @@ void MainPanel::itemDropped(QObject *destnation)
|
||||
|
||||
// drag from container
|
||||
if (itemIsInContainer
|
||||
&& (src->itemType() == DockItem::Plugins || src->itemType() == DockItem::SystemTrayPlugin)
|
||||
&& (src->itemType() == DockItem::Plugins || src->itemType() == DockItem::TrayPlugin)
|
||||
&& destnation == this)
|
||||
m_itemController->itemDragOutFromContainer(src);
|
||||
|
||||
|
@ -43,7 +43,7 @@ DockSettings::DockSettings(QWidget *parent)
|
||||
, m_autoHide(true)
|
||||
, m_isMaxSize(false)
|
||||
, m_opacity(0.4)
|
||||
, m_fashionSystemTraySize(QSize(0, 0))
|
||||
, m_fashionTraySize(QSize(0, 0))
|
||||
, m_fashionModeAct(tr("Fashion Mode"), this)
|
||||
, m_efficientModeAct(tr("Efficient Mode"), this)
|
||||
, m_topPosAct(tr("Top"), this)
|
||||
@ -149,7 +149,7 @@ DockSettings::DockSettings(QWidget *parent)
|
||||
|
||||
connect(m_itemController, &DockItemController::itemInserted, this, &DockSettings::dockItemCountChanged, Qt::QueuedConnection);
|
||||
connect(m_itemController, &DockItemController::itemRemoved, this, &DockSettings::dockItemCountChanged, Qt::QueuedConnection);
|
||||
connect(m_itemController, &DockItemController::fashionSystemTraySizeChanged, this, &DockSettings::onFashionSystemTraySizeChanged, Qt::QueuedConnection);
|
||||
connect(m_itemController, &DockItemController::fashionTraySizeChanged, this, &DockSettings::onFashionTraySizeChanged, Qt::QueuedConnection);
|
||||
|
||||
connect(m_displayInter, &DBusDisplay::PrimaryRectChanged, this, &DockSettings::primaryScreenChanged, Qt::QueuedConnection);
|
||||
connect(m_displayInter, &DBusDisplay::ScreenHeightChanged, this, &DockSettings::primaryScreenChanged, Qt::QueuedConnection);
|
||||
@ -526,15 +526,15 @@ void DockSettings::onOpacityChanged(const double value)
|
||||
emit opacityChanged(value * 255);
|
||||
}
|
||||
|
||||
void DockSettings::onFashionSystemTraySizeChanged(const QSize &systemTraySize)
|
||||
void DockSettings::onFashionTraySizeChanged(const QSize &traySize)
|
||||
{
|
||||
if (m_displayMode == Dock::Efficient)
|
||||
return;
|
||||
|
||||
if (m_fashionSystemTraySize == systemTraySize)
|
||||
if (m_fashionTraySize == traySize)
|
||||
return;
|
||||
|
||||
m_fashionSystemTraySize = systemTraySize;
|
||||
m_fashionTraySize = traySize;
|
||||
|
||||
calculateWindowConfig();
|
||||
|
||||
@ -585,8 +585,8 @@ void DockSettings::calculateWindowConfig()
|
||||
}
|
||||
}
|
||||
|
||||
const int perfectWidth = visibleItemCount * defaultWidth + PANEL_BORDER * 2 + PANEL_PADDING * 2 + PANEL_MARGIN * 2 + m_fashionSystemTraySize.width();
|
||||
const int perfectHeight = visibleItemCount * defaultHeight + PANEL_BORDER * 2 + PANEL_PADDING * 2 + PANEL_MARGIN * 2 + m_fashionSystemTraySize.height();
|
||||
const int perfectWidth = visibleItemCount * defaultWidth + PANEL_BORDER * 2 + PANEL_PADDING * 2 + PANEL_MARGIN * 2 + m_fashionTraySize.width();
|
||||
const int perfectHeight = visibleItemCount * defaultHeight + PANEL_BORDER * 2 + PANEL_PADDING * 2 + PANEL_MARGIN * 2 + m_fashionTraySize.height();
|
||||
const int maxWidth = m_primaryRect.width() - FASHION_MODE_PADDING * 2;
|
||||
const int maxHeight = m_primaryRect.height() - FASHION_MODE_PADDING * 2;
|
||||
const int calcWidth = qMin(maxWidth, perfectWidth);
|
||||
|
@ -78,7 +78,7 @@ public:
|
||||
inline const QRect frontendWindowRect() const { return m_frontendRect; }
|
||||
inline const QSize windowSize() const { return m_mainWindowSize; }
|
||||
inline const quint8 Opacity() const { return m_opacity * 255; }
|
||||
inline const QSize fashionSystemTraySize() const { return m_fashionSystemTraySize; }
|
||||
inline const QSize fashionTraySize() const { return m_fashionTraySize; }
|
||||
|
||||
const QSize panelSize() const;
|
||||
const QRect windowRect(const Position position, const bool hide = false) const;
|
||||
@ -111,7 +111,7 @@ private slots:
|
||||
void resetFrontendGeometry();
|
||||
void updateForbidPostions();
|
||||
void onOpacityChanged(const double value);
|
||||
void onFashionSystemTraySizeChanged(const QSize &systemTraySize);
|
||||
void onFashionTraySizeChanged(const QSize &traySize);
|
||||
|
||||
private:
|
||||
DockSettings(QWidget *parent = 0);
|
||||
@ -138,7 +138,7 @@ private:
|
||||
QRect m_primaryRawRect;
|
||||
QRect m_frontendRect;
|
||||
QSize m_mainWindowSize;
|
||||
QSize m_fashionSystemTraySize;
|
||||
QSize m_fashionTraySize;
|
||||
|
||||
WhiteMenu m_settingsMenu;
|
||||
WhiteMenu *m_hideSubMenu;
|
||||
|
@ -198,7 +198,7 @@ void FashionTrayItem::onTrayListExpandChanged(const bool expand)
|
||||
}
|
||||
}
|
||||
|
||||
// used by QMetaObject::invokeMethod in SystemTrayPluginItem / MainPanel class
|
||||
// used by QMetaObject::invokeMethod in TrayPluginItem / MainPanel class
|
||||
void FashionTrayItem::setSuggestIconSize(QSize size)
|
||||
{
|
||||
size = size * 0.6;
|
||||
@ -363,9 +363,9 @@ void FashionTrayItem::setCurrentAttentionTray(FashionTrayWidgetWrapper *attentio
|
||||
|
||||
void FashionTrayItem::requestResize()
|
||||
{
|
||||
// reset property "FashionSystemTraySize" to notify dock resize
|
||||
// reset property "FashionTraySize" to notify dock resize
|
||||
// DockPluginsController will watch this property
|
||||
setProperty("FashionSystemTraySize", sizeHint());
|
||||
setProperty("FashionTraySize", sizeHint());
|
||||
}
|
||||
|
||||
void FashionTrayItem::moveOutAttionTray()
|
||||
|
@ -65,9 +65,9 @@ void StatusNotifierWatcher::RegisterStatusNotifierItem(const QString &serviceOrP
|
||||
QString notifierItemId = service + path;
|
||||
if (QDBusConnection::sessionBus().interface()->isServiceRegistered(service).value() &&
|
||||
!m_registeredServices.contains(notifierItemId)) {
|
||||
qDebug()<<"Registering" << notifierItemId << "to system tray";
|
||||
qDebug()<<"Registering" << notifierItemId << "to tray";
|
||||
|
||||
//check if the service has registered a SystemTray object
|
||||
//check if the service has registered a Tray object
|
||||
com::deepin::dde::StatusNotifierItem trayclient(service, path,
|
||||
QDBusConnection::sessionBus());
|
||||
if (trayclient.isValid()) {
|
||||
@ -112,7 +112,7 @@ void StatusNotifierWatcher::RegisterStatusNotifierHost(const QString &service)
|
||||
if (service.contains(QStringLiteral("org.kde.StatusNotifierHost-")) &&
|
||||
QDBusConnection::sessionBus().interface()->isServiceRegistered(service).value() &&
|
||||
!m_statusNotifierHostServices.contains(service)) {
|
||||
qDebug()<<"Registering"<<service<<"as system tray";
|
||||
qDebug()<<"Registering"<<service<<"as tray";
|
||||
|
||||
m_statusNotifierHostServices.insert(service);
|
||||
m_serviceWatcher->addWatchedService(service);
|
||||
|
@ -40,7 +40,7 @@ SystemTrayItem::SystemTrayItem(PluginsItemInterface * const pluginInter, const Q
|
||||
m_popupAdjustDelayTimer(new QTimer(this)),
|
||||
m_itemKey(itemKey)
|
||||
{
|
||||
qDebug() << "load system tray plugins item: " << m_pluginInter->pluginName() << itemKey << m_centralWidget;
|
||||
qDebug() << "load tray plugins item: " << m_pluginInter->pluginName() << itemKey << m_centralWidget;
|
||||
|
||||
m_centralWidget->setParent(this);
|
||||
m_centralWidget->setVisible(true);
|
||||
|
@ -42,14 +42,14 @@ TrayPlugin::TrayPlugin(QObject *parent)
|
||||
{
|
||||
m_fashionItem = new FashionTrayItem(position());
|
||||
|
||||
m_tipsLabel->setObjectName("sys-tray");
|
||||
m_tipsLabel->setObjectName("tray");
|
||||
m_tipsLabel->setText(tr("System Tray"));
|
||||
m_tipsLabel->setVisible(false);
|
||||
}
|
||||
|
||||
const QString TrayPlugin::pluginName() const
|
||||
{
|
||||
return "system-tray";
|
||||
return "tray";
|
||||
}
|
||||
|
||||
void TrayPlugin::init(PluginProxyInterface *proxyInter)
|
||||
@ -308,7 +308,7 @@ void TrayPlugin::trayRemoved(const QString &itemKey)
|
||||
}
|
||||
|
||||
// only delete tray object when it is a tray of applications
|
||||
// set the parent of the tray object to avoid be deconstructed by parent(DockItem/PluginsItem/SystemTrayPluginsItem)
|
||||
// set the parent of the tray object to avoid be deconstructed by parent(DockItem/PluginsItem/TrayPluginsItem)
|
||||
if (widget->trayTyep() == AbstractTrayWidget::TrayType::SystemTray) {
|
||||
widget->setParent(nullptr);
|
||||
} else {
|
||||
|
Loading…
x
Reference in New Issue
Block a user