Pencil2D Animation
Download
Community
News
Docs
Contribute
Overview
Articles
Code
Class List
Class Index
Class Hierarchy
Class Members
File List
Loading...
Searching...
No Matches
app
src
titlebarwidget.h
1
/*
2
3
Pencil2D - Traditional Animation Software
4
Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5
Copyright (C) 2012-2020 Matthew Chiawen Chang
6
7
This program is free software; you can redistribute it and/or
8
modify it under the terms of the GNU General Public License
9
as published by the Free Software Foundation; version 2 of the License.
10
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
15
16
*/
17
#ifndef TITLEBARWIDGET_H
18
#define TITLEBARWIDGET_H
19
20
#include <QWidget>
21
22
#include "appearance.h"
23
24
class
QLabel
;
25
class
QToolButton
;
26
27
class
TitleBarWidget
:
public
QWidget
28
{
29
Q_OBJECT
30
public
:
31
explicit
TitleBarWidget
(
QWidget
*
parent
=
nullptr
);
32
~TitleBarWidget
();
33
34
void
resizeEvent(
QResizeEvent
* resizeEvent)
override
;
35
void
setTitle(
const
QString
& title);
36
void
paintEvent(
QPaintEvent
*)
override
;
37
38
void
setIsFloating(
bool
floating) { mIsFloating = floating; }
39
40
signals:
41
void
closeButtonPressed();
42
void
undockButtonPressed();
43
44
private
:
45
QString
flatButtonStylesheet()
const
;
46
void
showEvent(
QShowEvent
*
event
)
override
;
47
void
hideButtons(
bool
hide
);
48
void
hideButtonsIfNeeded(
int
width
);
49
50
QWidget
* createCustomTitleBarWidget(
QWidget
*
parent
);
51
52
QLabel
* mTitleLabel =
nullptr
;
53
QToolButton
* mCloseButton =
nullptr
;
54
QToolButton
* mDockButton =
nullptr
;
55
56
bool
mIsFloating =
false
;
57
58
int
mWidthOfFullLayout = 0;
59
};
60
61
#endif
// TITLEBARWIDGET_H
TitleBarWidget
Definition:
titlebarwidget.h:28
QLabel
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::parent
QObject * parent() const const
QPaintEvent
QResizeEvent
QShowEvent
QString
QToolButton
QWidget
QWidget::event
virtual bool event(QEvent *event) override
QWidget::hide
void hide()
QWidget::width
width