FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
ghostwriter/src/HudWindow.h at master · jackcoolpython/ghostwriter · GitHub
jackcoolpython
ghostwriter
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
ghostwriter
/
src
/
HudWindow.h
Copy path
More file actions
More file actions
Latest commit
History
History
History
159 lines (135 loc) · 4.8 KB
Breadcrumbs
ghostwriter
/
src
/
HudWindow.h
Copy path
File metadata and controls
159 lines (135 loc) · 4.8 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
/*
**********************************************************************
*
* Copyright (C) 2014-2017 wereturtle
*
* 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
* (at your option) 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
HUDWINDOW_H
#
define
HUDWINDOW_H
#
include
<
QWidget
>
#
include
"
HudWindowTypes.h
"
class
QGridLayout
;
class
QMouseEvent
;
class
QPaintEvent
;
class
QPoint
;
class
QColor
;
class
QLabel
;
class
QSizeGrip
;
class
QPushButton
;
class
QGraphicsColorizeEffect
;
/*
*
* A Heads Up Display dialog window, similar to Mac OS X HUD windows.
*/
class
HudWindow
:
public
QWidget
{
Q_OBJECT
public:
/*
*
* Constructor.
*/
HudWindow
(QWidget *parent =
0
);
/*
*
* Destructor.
*/
virtual
~HudWindow
();
/*
*
* Listens for key press events, and hides the HUD if the Escape key is
* pressed.
*/
void
keyPressEvent
(QKeyEvent* e);
/*
*
* Sets the central widget to display in this HUD.
*/
void
setCentralWidget
(QWidget* widget);
/*
*
* Sets the HUD window title.
*/
void
setWindowTitle
(
const
QString& title);
/*
*
* Gets the HUD foreground (i.e., text) color.
*/
QColor
getForegroundColor
();
/*
*
* Sets the HUD foreground (i.e., text) color.
*/
void
setForegroundColor
(
const
QColor& color);
/*
*
* Gets the HUD background color.
*/
QColor
getBackgroundColor
();
/*
*
* Sets the background color of the window. Setting an alpha value
* in the color will change the opacity of the window, but not any
* of its child widgets. To set an opacity value that will include
* all child widgets added to the window, call setWindowOpacity()
* instead.
*/
void
setBackgroundColor
(
const
QColor& color);
/*
*
* Sets whether the size grip in the lower right corner of the HUD
* window should be displayed.
*/
void
setSizeGripEnabled
(
bool
enabled);
/*
*
* Sets the window button layout (left or right side). Defaults to
* the right-hand side for Windows and Linux, and to the left-hand
* side for Mac OS X.
*/
void
setButtonLayout
(HudWindowButtonLayout layout);
/*
*
* Sets the shape of the window to have either square or rounded
* corners. Note that if desktop compositing is disabled, the
* corners will be square regardless of this setting.
*/
void
setShape
(HudWindowShape shape);
/*
*
* Sets whether desktop compositing is enabled for the HUD. Enabling
* will allow transparency of the HUD, as well as the drop shadow
* and rounded corners of the window. Disabling will cause a plain
* rectangle to be drawn with no transparency. This method is provided
* in case the application runs on a platform that does not support
* desktop compositing, so that the user can turn off the transparency
* effect and not have an unpleasant-looking window.
*/
void
setDesktopCompositingEnabled
(
bool
enabled);
signals:
void
closed
();
protected:
QGridLayout* layout;
QLabel* windowTitleLabel;
QPushButton* closeButton;
QSizeGrip* sizeGrip;
QColor foregroundColor;
QColor backgroundColor;
QColor titleBarButtonHoverColor;
QPixmap dropShadowImg;
QGraphicsColorizeEffect* closeButtonColorEffect;
QGraphicsColorizeEffect* sizeGripColorEffect;
bool
isTitleBarBeingDragged;
QPoint mouseDragStartingPoint;
bool
desktopCompositingEnabled;
QGridLayout* titleBarLayout;
HudWindowShape hudWindowShape;
QSize
sizeHint
()
const
;
void
paintEvent
(QPaintEvent* event);
void
resizeEvent
(QResizeEvent* event);
void
moveEvent
(QMoveEvent* event);
void
mousePressEvent
(QMouseEvent *event);
void
mouseReleaseEvent
(QMouseEvent* event);
void
mouseMoveEvent
(QMouseEvent* event);
private:
void
predrawDropShadow
();
};
#
endif
//
HUDWINDOW_H
Back
|
FazBrowse Home
|
New Git URL