2020-08-05 19:46:15 +08:00
|
|
|
/*
|
2021-06-18 17:36:06 +08:00
|
|
|
* Copyright (C) 2018 ~ 2020 Deepin Technology Co., Ltd.
|
2020-08-05 19:46:15 +08:00
|
|
|
*
|
|
|
|
* Author: fanpengcheng <fanpengcheng_cm@deepin.com>
|
|
|
|
*
|
|
|
|
* Maintainer: fanpengcheng <fanpengcheng_cm@deepin.com>
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
#ifndef MENUWORKER_H
|
|
|
|
#define MENUWORKER_H
|
|
|
|
#include <QObject>
|
|
|
|
|
|
|
|
#include "constants.h"
|
|
|
|
|
|
|
|
#include <com_deepin_dde_daemon_dock.h>
|
|
|
|
|
|
|
|
using DBusDock = com::deepin::dde::daemon::Dock;
|
2021-03-12 13:20:13 +08:00
|
|
|
class QMenu;
|
2021-02-19 18:08:06 +08:00
|
|
|
class QGSettings;
|
2020-08-05 19:46:15 +08:00
|
|
|
/**
|
|
|
|
* @brief The MenuWorker class 此类用于处理任务栏右键菜单的逻辑
|
|
|
|
*/
|
|
|
|
class MenuWorker : public QObject
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
explicit MenuWorker(DBusDock *dockInter,QWidget *parent = nullptr);
|
|
|
|
|
2022-01-06 10:53:18 +08:00
|
|
|
void showDockSettingsMenu(QMenu *menu);
|
2020-08-05 19:46:15 +08:00
|
|
|
|
|
|
|
signals:
|
|
|
|
void autoHideChanged(const bool autoHide) const;
|
2021-03-11 18:03:12 +08:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void setAutoHide(const bool autoHide);
|
2022-08-26 14:20:09 +08:00
|
|
|
void onNotifyDaemonInterfaceUpdate(DBusDock *dockInter);
|
2020-08-05 19:46:15 +08:00
|
|
|
|
2021-03-11 18:03:12 +08:00
|
|
|
private:
|
2022-01-06 10:53:18 +08:00
|
|
|
QMenu *createMenu(QMenu *settingsMenu);
|
2020-08-05 19:46:15 +08:00
|
|
|
|
2021-09-28 15:59:06 +08:00
|
|
|
private slots:
|
|
|
|
void onDockSettingsTriggered();
|
|
|
|
|
2020-08-05 19:46:15 +08:00
|
|
|
private:
|
|
|
|
DBusDock *m_dockInter;
|
|
|
|
bool m_autoHide;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // MENUWORKER_H
|