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
3Pencil2D - Traditional Animation Software
4Copyright (C) 2005-2007 Patrick Corrieri & Pascal Naidon
5Copyright (C) 2012-2020 Matthew Chiawen Chang
6
7This program is free software; you can redistribute it and/or
8modify it under the terms of the GNU General Public License
9as published by the Free Software Foundation; version 2 of the License.
10
11This program is distributed in the hope that it will be useful,
12but WITHOUT ANY WARRANTY; without even the implied warranty of
13MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14GNU 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
24class QLabel;
25class QToolButton;
26
27class TitleBarWidget : public QWidget
28{
29 Q_OBJECT
30public:
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
40signals:
41 void closeButtonPressed();
42 void undockButtonPressed();
43
44private:
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
Generated on Thu Jun 5 2025 14:06:43 for Pencil2D by doxygen 1.9.6 based on revision 4c63407997b2c03e5048716586dec6fbbb755173