HAL
dock_button.h
Go to the documentation of this file.
1
// MIT License
2
//
3
// Copyright (c) 2019 Ruhr University Bochum, Chair for Embedded Security. All Rights reserved.
4
// Copyright (c) 2019 Marc Fyrbiak, Sebastian Wallat, Max Hoffmann ("ORIGINAL AUTHORS"). All rights reserved.
5
// Copyright (c) 2021 Max Planck Institute for Security and Privacy. All Rights reserved.
6
// Copyright (c) 2021 Jörn Langheinrich, Julian Speith, Nils Albartus, René Walendy, Simon Klix ("ORIGINAL AUTHORS"). All Rights reserved.
7
//
8
// Permission is hereby granted, free of charge, to any person obtaining a copy
9
// of this software and associated documentation files (the "Software"), to deal
10
// in the Software without restriction, including without limitation the rights
11
// to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12
// copies of the Software, and to permit persons to whom the Software is
13
// furnished to do so, subject to the following conditions:
14
//
15
// The above copyright notice and this permission notice shall be included in all
16
// copies or substantial portions of the Software.
17
//
18
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19
// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20
// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21
// AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23
// OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24
// SOFTWARE.
25
26
#pragma once
27
28
#include <QToolButton>
29
30
namespace
hal
31
{
32
class
ContentWidget
;
33
40
enum class
button_orientation
41
{
42
horizontal
= 0,
43
vertical_up
= 1,
44
vertical_down
= 2
45
};
46
55
class
DockButton
:
public
QToolButton
56
{
57
Q_OBJECT
58
Q_PROPERTY
(
QColor
textColor
READ
textColor
WRITE
setTextColor
)
59
Q_PROPERTY
(
QColor
checkedColor
READ
checkedColor
WRITE
setCheckedColor
)
60
Q_PROPERTY
(
QColor
hoverColor
READ
hoverColor
WRITE
setHoverColor
)
61
62
public
:
71
DockButton
(
ContentWidget
*
widget
,
button_orientation
orientation,
QObject
*
eventFilter
,
QWidget
*
parent
);
72
78
void
paintEvent
(
QPaintEvent
*
event
)
override
;
79
83
86
QColor
textColor
();
87
91
QColor
checkedColor
();
92
96
QColor
hoverColor
();
98
102
107
void
setTextColor
(
const
QColor
& color);
108
113
void
setCheckedColor
(
const
QColor
& color);
114
119
void
setHoverColor
(
const
QColor
& color);
121
125
void
adjustSize
();
126
132
int
relativeWidth
();
133
139
ContentWidget
*
widget
();
140
147
bool
hidden
();
148
154
bool
available
();
155
162
void
setAvailable
(
bool
available
);
163
169
void
setRelativeHeight
(
int
height
);
170
171
//overshadowed functions
172
176
void
hide
();
177
181
void
show
();
182
183
public
Q_SLOTS
:
184
192
void
handleClicked
(
bool
mChecked);
193
194
private
:
195
ContentWidget
* mWidget;
196
button_orientation
mOrientation;
197
int
mWidth;
198
int
mHeight;
199
int
mRelativeWidth;
200
int
mRelativeHeight;
201
int
mIconSize;
202
int
mTextOffset;
203
int
mWidthPadding;
204
int
mHeightPadding;
205
bool
mHidden;
206
bool
mAvailable =
true
;
207
208
QColor
mTextColor;
209
QColor
mCheckedColor;
210
QColor
mHoverColor;
211
};
212
}
hal::ContentWidget
Abstract class for Widgets within HAL's ContentArea.
Definition:
content_widget.h:50
hal::DockButton
A button of in the DockerBar.
Definition:
dock_button.h:56
hal::DockButton::setCheckedColor
void setCheckedColor(const QColor &color)
Definition:
dock_button.cpp:83
hal::DockButton::hoverColor
QColor hoverColor
Definition:
dock_button.h:60
hal::DockButton::setAvailable
void setAvailable(bool available)
Definition:
dock_button.cpp:156
hal::DockButton::textColor
QColor textColor()
hal::DockButton::hide
void hide()
Definition:
dock_button.cpp:134
hal::DockButton::relativeWidth
int relativeWidth()
Definition:
dock_button.cpp:116
hal::DockButton::available
bool available()
Definition:
dock_button.cpp:151
hal::DockButton::DockButton
DockButton(ContentWidget *widget, button_orientation orientation, QObject *eventFilter, QWidget *parent)
Definition:
dock_button.cpp:12
hal::DockButton::textColor
QColor textColor
Definition:
dock_button.h:58
hal::DockButton::checkedColor
QColor checkedColor()
hal::DockButton::show
void show()
Definition:
dock_button.cpp:140
hal::DockButton::hoverColor
QColor hoverColor()
hal::DockButton::setRelativeHeight
void setRelativeHeight(int height)
Definition:
dock_button.cpp:161
hal::DockButton::checkedColor
QColor checkedColor
Definition:
dock_button.h:59
hal::DockButton::handleClicked
void handleClicked(bool mChecked)
Definition:
dock_button.cpp:121
hal::DockButton::paintEvent
void paintEvent(QPaintEvent *event) override
Definition:
dock_button.cpp:29
hal::DockButton::setHoverColor
void setHoverColor(const QColor &color)
Definition:
dock_button.cpp:88
hal::DockButton::widget
ContentWidget * widget()
Definition:
dock_button.cpp:129
hal::DockButton::setTextColor
void setTextColor(const QColor &color)
Definition:
dock_button.cpp:78
hal::DockButton::adjustSize
void adjustSize()
Definition:
dock_button.cpp:93
hal::DockButton::hidden
bool hidden()
Definition:
dock_button.cpp:146
hal::button_orientation
button_orientation
Definition:
dock_button.h:41
hal::button_orientation::horizontal
@ horizontal
hal::button_orientation::vertical_up
@ vertical_up
hal::button_orientation::vertical_down
@ vertical_down
hal
Definition:
parser_liberty.cpp:10
QColor
QObject
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::Q_PROPERTY
Q_PROPERTY(...)
QObject::Q_SLOTS
Q_SLOTSQ_SLOTS
QObject::eventFilter
virtual bool eventFilter(QObject *watched, QEvent *event)
QObject::parent
QObject * parent() const const
QPaintEvent
QToolButton
QToolButton::event
virtual bool event(QEvent *event) override
QWidget
QWidget::height
height
plugins
gui
include
gui
docking_system
dock_button.h
Generated on Tue Apr 8 2025 20:12:19 for HAL by
1.9.1