2017-09-18 14:33:44 +08:00
|
|
|
/*
|
2018-02-07 11:52:47 +08:00
|
|
|
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
|
2017-09-18 14:33:44 +08:00
|
|
|
*
|
|
|
|
* Author: sbw <sbw@sbw.so>
|
|
|
|
*
|
|
|
|
* Maintainer: sbw <sbw@sbw.so>
|
|
|
|
*
|
|
|
|
* 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/>.
|
|
|
|
*/
|
|
|
|
|
2016-06-14 16:49:29 +08:00
|
|
|
#ifndef LAUNCHERITEM_H
|
|
|
|
#define LAUNCHERITEM_H
|
|
|
|
|
|
|
|
#include "dockitem.h"
|
|
|
|
|
2021-12-31 17:27:09 +08:00
|
|
|
namespace Dock {
|
|
|
|
class TipsWidget;
|
|
|
|
}
|
2018-10-22 19:59:07 +08:00
|
|
|
|
2021-03-12 13:20:13 +08:00
|
|
|
class QGSettings;
|
2016-06-14 16:49:29 +08:00
|
|
|
class LauncherItem : public DockItem
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2021-03-12 13:20:13 +08:00
|
|
|
explicit LauncherItem(QWidget *parent = nullptr);
|
2016-06-14 16:49:29 +08:00
|
|
|
|
2019-10-31 15:38:56 +08:00
|
|
|
inline ItemType itemType() const override {return Launcher;}
|
2016-08-08 09:52:05 +08:00
|
|
|
|
2021-03-06 18:40:13 +08:00
|
|
|
void refreshIcon() override;
|
2017-03-07 17:30:30 +08:00
|
|
|
|
2019-08-01 15:59:25 +08:00
|
|
|
protected:
|
|
|
|
void showEvent(QShowEvent* event) override;
|
|
|
|
|
2016-06-14 16:49:29 +08:00
|
|
|
private:
|
2019-10-31 15:38:56 +08:00
|
|
|
void paintEvent(QPaintEvent *e) override;
|
|
|
|
void resizeEvent(QResizeEvent *e) override;
|
|
|
|
void mousePressEvent(QMouseEvent *e) override;
|
|
|
|
void mouseReleaseEvent(QMouseEvent *e) override;
|
2016-06-14 16:49:29 +08:00
|
|
|
|
2019-10-31 15:38:56 +08:00
|
|
|
QWidget *popupTips() override;
|
2016-07-20 11:31:04 +08:00
|
|
|
|
2019-08-01 15:59:25 +08:00
|
|
|
void onGSettingsChanged(const QString& key);
|
|
|
|
|
|
|
|
bool checkGSettingsControl() const;
|
|
|
|
|
2016-06-14 16:49:29 +08:00
|
|
|
private:
|
2019-10-31 15:38:56 +08:00
|
|
|
QPixmap m_icon;
|
2021-03-12 13:20:13 +08:00
|
|
|
const QGSettings *m_gsettings;
|
2021-12-31 17:27:09 +08:00
|
|
|
QSharedPointer<TipsWidget> m_tips;
|
2016-06-14 16:49:29 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // LAUNCHERITEM_H
|