-
-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathTaskBarButton.hxx
59 lines (44 loc) · 1.29 KB
/
TaskBarButton.hxx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*
This file is part of liquidshell.
SPDX-FileCopyrightText: 2017 - 2024 Martin Koller <kollix@aon.at>
SPDX-License-Identifier: GPL-3.0-or-later
*/
#ifndef _TaskBarButton_H_
#define _TaskBarButton_H_
#include <QPushButton>
#include <QTimer>
class QLabel;
class KSqueezedTextLabel;
#include <KWinCompat.hxx>
class TaskBarButton : public QPushButton
{
Q_OBJECT
public:
TaskBarButton(WId wid);
void setIconSize(int size);
QSize sizeHint() const override;
Q_SIGNALS:
void clicked();
protected:
void mousePressEvent(QMouseEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void paintEvent(QPaintEvent *event) override;
void dragEnterEvent(QDragEnterEvent *event) override;
void dragLeaveEvent(QDragLeaveEvent *event) override;
void dropEvent(QDropEvent *event) override;
void moveEvent(QMoveEvent *) override { updateWMGeometry(); }
void resizeEvent(QResizeEvent *) override { updateWMGeometry(); }
private Q_SLOTS:
void fill();
void setBackground();
void windowChanged(WId id, NET::Properties props, NET::Properties2 props2);
private:
void updateWMGeometry();
private:
WId wid;
QLabel *iconLabel;
KSqueezedTextLabel *textLabel;
QTimer dragDropTimer;
QPoint dragStartPos;
};
#endif