dde-dock/plugins/onboard/onboarditem.h
listenerri 06d55e20d6 feat: add new plugin for onboard
https://github.com/linuxdeepin/internal-discussion/issues/610

Change-Id: Iada7d06f804a6a7d6df7078781f93be08694bce4
2018-12-24 09:09:45 +08:00

55 lines
1.4 KiB
C++

/*
* Copyright (C) 2011 ~ 2018 Deepin Technology Co., Ltd.
*
* Author: listenerri <listenerri@gmail.com>
*
* Maintainer: listenerri <listenerri@gmail.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 ONBOARDITEM_H
#define ONBOARDITEM_H
#include "constants.h"
#include <QWidget>
class OnboardItem : public QWidget
{
Q_OBJECT
public:
explicit OnboardItem(QWidget *parent = nullptr);
signals:
void requestContextMenu() const;
protected:
QSize sizeHint() const;
void paintEvent(QPaintEvent *e);
void mousePressEvent(QMouseEvent *e);
void enterEvent(QEvent *e);
void leaveEvent(QEvent *e);
private:
const QPixmap loadSvg(const QString &fileName, const QSize &size) const;
private:
bool m_hover;
Dock::DisplayMode m_displayMode;
};
#endif // ONBOARDITEM_H