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
statusbar.h
1/*
2
3Pencil2D - Traditional Animation Software
4Copyright (C) 2020 Jakob Gahde
5
6This program is free software; you can redistribute it and/or
7modify it under the terms of the GNU General Public License
8as published by the Free Software Foundation; version 2 of the License.
9
10This program is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13GNU General Public License for more details.
14
15*/
16
17#ifndef STATUSBAR_H
18#define STATUSBAR_H
19
20#include <QStatusBar>
21
22#include "pencildef.h"
23
24class Editor;
25class ElidedLabel;
26class QComboBox;
27class QLabel;
28class QSlider;
29
33class StatusBar : public QStatusBar
34{
35 Q_OBJECT
36
37public:
43 explicit StatusBar(QWidget *parent = nullptr);
44
52 void setEditor(Editor *editor) { mEditor = editor; }
53
54public slots:
60 void updateToolStatus(ToolType tool);
61
67 void updateModifiedStatus(bool modified);
68
72 void updateZoomStatus();
73
74signals:
75
81 void zoomChanged(double scale);
82
83private:
85 Editor *mEditor = nullptr;
86
88 QLabel *mToolIcon = nullptr;
90 ElidedLabel *mToolLabel = nullptr;
92 QLabel *mModifiedLabel = nullptr;
94 QComboBox *mZoomBox = nullptr;
96 QSlider *mZoomSlider = nullptr;
97};
98
99#endif // STATUSBAR_H
Editor
Definition: editor.h:71
ElidedLabel
[0]
Definition: elidedlabel.h:59
StatusBar
The status bar of Pencil2D's main window.
Definition: statusbar.h:34
StatusBar::mToolLabel
ElidedLabel * mToolLabel
Label used to display a short help text for the current tool.
Definition: statusbar.h:90
StatusBar::updateModifiedStatus
void updateModifiedStatus(bool modified)
Updates the file modification status.
Definition: statusbar.cpp:162
StatusBar::mZoomBox
QComboBox * mZoomBox
Combo box for choosing pre-defined or custom zoom levels.
Definition: statusbar.h:94
StatusBar::mToolIcon
QLabel * mToolIcon
Label used to display the icon of the current tool.
Definition: statusbar.h:88
StatusBar::updateToolStatus
void updateToolStatus(ToolType tool)
Updates the status bar with information about the current tool.
Definition: statusbar.cpp:93
StatusBar::mEditor
Editor * mEditor
The editor associated with this status bar.
Definition: statusbar.h:85
StatusBar::zoomChanged
void zoomChanged(double scale)
This signal is sent when the user chooses a new zoom level through the status bar.
StatusBar::setEditor
void setEditor(Editor *editor)
Associates an Editor instance with the status bar.
Definition: statusbar.h:52
StatusBar::mModifiedLabel
QLabel * mModifiedLabel
Label indicating that the current file contains unsaved changes.
Definition: statusbar.h:92
StatusBar::mZoomSlider
QSlider * mZoomSlider
Slider for adjusting the zoom level.
Definition: statusbar.h:96
StatusBar::updateZoomStatus
void updateZoomStatus()
Updates the zoom level displayed in the status bar.
Definition: statusbar.cpp:175
QComboBox
QLabel
QObject::Q_OBJECT
Q_OBJECTQ_OBJECT
QObject::parent
QObject * parent() const const
QSlider
QStatusBar
QWidget
Generated on Thu May 8 2025 04:47:53 for Pencil2D by doxygen 1.9.6 based on revision 4513250b1d5b1a3676ec0e67b06b7a885ceaae39