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-07-19 11:21:29 +08:00
|
|
|
#ifndef DISKPLUGINITEM_H
|
|
|
|
#define DISKPLUGINITEM_H
|
|
|
|
|
|
|
|
#include "constants.h"
|
|
|
|
|
|
|
|
#include <QWidget>
|
|
|
|
#include <QPixmap>
|
|
|
|
|
|
|
|
class DiskPluginItem : public QWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit DiskPluginItem(QWidget *parent = 0);
|
|
|
|
|
2016-09-22 14:31:38 +08:00
|
|
|
signals:
|
|
|
|
void requestContextMenu() const;
|
|
|
|
|
2016-07-19 11:21:29 +08:00
|
|
|
public slots:
|
|
|
|
void setDockDisplayMode(const Dock::DisplayMode mode);
|
|
|
|
|
|
|
|
protected:
|
|
|
|
void paintEvent(QPaintEvent *e);
|
|
|
|
void resizeEvent(QResizeEvent *e);
|
2016-08-15 09:26:45 +08:00
|
|
|
void mousePressEvent(QMouseEvent *e);
|
2016-07-19 11:21:29 +08:00
|
|
|
QSize sizeHint() const;
|
|
|
|
|
|
|
|
private:
|
|
|
|
void updateIcon();
|
|
|
|
|
|
|
|
private:
|
|
|
|
Dock::DisplayMode m_displayMode;
|
|
|
|
|
|
|
|
QPixmap m_icon;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // DISKPLUGINITEM_H
|