2016-06-03 16:06:11 +08:00
|
|
|
#ifndef APPITEM_H
|
|
|
|
#define APPITEM_H
|
|
|
|
|
|
|
|
#include "dockitem.h"
|
|
|
|
#include "dbus/dbusdockentry.h"
|
2016-06-06 14:57:07 +08:00
|
|
|
#include "dbus/dbusclientmanager.h"
|
2016-06-03 16:06:11 +08:00
|
|
|
|
|
|
|
class AppItem : public DockItem
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit AppItem(const QDBusObjectPath &entry, QWidget *parent = nullptr);
|
|
|
|
|
2016-06-14 11:22:19 +08:00
|
|
|
const QString appId() const;
|
2016-07-22 14:59:43 +08:00
|
|
|
void updateWindowIconGeometries();
|
2016-06-21 17:24:03 +08:00
|
|
|
static void setIconBaseSize(const int size);
|
|
|
|
static int iconBaseSize();
|
|
|
|
static int itemBaseHeight();
|
|
|
|
static int itemBaseWidth();
|
2016-06-14 11:22:19 +08:00
|
|
|
|
2016-08-08 09:52:05 +08:00
|
|
|
inline ItemType itemType() const {return App;}
|
|
|
|
|
2016-08-18 15:14:50 +08:00
|
|
|
public slots:
|
|
|
|
void refershIcon();
|
|
|
|
|
2016-06-03 16:06:11 +08:00
|
|
|
private:
|
|
|
|
void paintEvent(QPaintEvent *e);
|
2016-06-06 14:28:28 +08:00
|
|
|
void mouseReleaseEvent(QMouseEvent *e);
|
2016-06-07 14:40:45 +08:00
|
|
|
void mousePressEvent(QMouseEvent *e);
|
|
|
|
void mouseMoveEvent(QMouseEvent *e);
|
2016-08-30 16:34:02 +08:00
|
|
|
void wheelEvent(QWheelEvent *e);
|
2016-06-15 11:20:05 +08:00
|
|
|
void resizeEvent(QResizeEvent *e);
|
2016-06-23 14:45:57 +08:00
|
|
|
void dragEnterEvent(QDragEnterEvent *e);
|
2016-06-23 15:30:06 +08:00
|
|
|
void dropEvent(QDropEvent *e);
|
2016-06-06 14:28:28 +08:00
|
|
|
|
2016-06-15 16:17:51 +08:00
|
|
|
void invokedMenuItem(const QString &itemId, const bool checked);
|
|
|
|
const QString contextMenu() const;
|
2016-07-18 14:13:36 +08:00
|
|
|
QWidget *popupTips();
|
2016-06-15 16:17:51 +08:00
|
|
|
|
2016-06-07 14:40:45 +08:00
|
|
|
void startDrag();
|
2016-06-14 16:01:01 +08:00
|
|
|
|
|
|
|
private slots:
|
2016-06-15 11:20:05 +08:00
|
|
|
void updateTitle();
|
|
|
|
void updateIcon();
|
2016-06-23 14:28:47 +08:00
|
|
|
void activeChanged();
|
2016-06-03 16:06:11 +08:00
|
|
|
|
|
|
|
private:
|
2016-07-18 14:13:36 +08:00
|
|
|
QLabel *m_appNameTips;
|
2016-06-03 16:06:11 +08:00
|
|
|
DBusDockEntry *m_itemEntry;
|
2016-06-06 14:28:28 +08:00
|
|
|
|
2016-06-07 16:01:37 +08:00
|
|
|
bool m_draging;
|
|
|
|
|
2016-06-23 14:28:47 +08:00
|
|
|
bool m_active;
|
2016-06-14 11:22:19 +08:00
|
|
|
WindowDict m_titles;
|
|
|
|
QString m_id;
|
2016-06-23 14:28:47 +08:00
|
|
|
QPixmap m_smallIcon;
|
|
|
|
QPixmap m_largeIcon;
|
2016-07-12 16:33:01 +08:00
|
|
|
QPixmap m_horizontalIndicator;
|
|
|
|
QPixmap m_verticalIndicator;
|
|
|
|
QPixmap m_activeHorizontalIndicator;
|
|
|
|
QPixmap m_activeVerticalIndicator;
|
2016-06-06 14:57:07 +08:00
|
|
|
|
2016-07-22 14:59:43 +08:00
|
|
|
QRect m_lastGlobalGeometry;
|
|
|
|
QTimer * m_updateIconGeometryTimer;
|
|
|
|
|
2016-06-21 17:24:03 +08:00
|
|
|
static int IconBaseSize;
|
2016-06-15 16:17:51 +08:00
|
|
|
static QPoint MousePressPos;
|
2016-06-03 16:06:11 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // APPITEM_H
|