LMMS
Loading...
Searching...
No Matches
BarModelEditor.h
Go to the documentation of this file.
1/*
2 * BarModelEditor.h - edit model values using a bar display
3 *
4 * Copyright (c) 2023-now Michael Gregorius
5 *
6 * This file is part of LMMS - https://lmms.io
7 *
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public
10 * License as published by the Free Software Foundation; either
11 * version 2 of the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public
19 * License along with this program (see COPYING); if not, write to the
20 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21 * Boston, MA 02110-1301 USA.
22 *
23 */
24
25#pragma once
26
27#ifndef LMMS_GUI_BAR_MODEL_EDITOR_H
28#define LMMS_GUI_BAR_MODEL_EDITOR_H
29
31
32
33namespace lmms::gui
34{
35
36class LMMS_EXPORT BarModelEditor : public FloatModelEditorBase
37{
38 Q_OBJECT
39
40public:
44
45 BarModelEditor(QString text, FloatModel * floatModel, QWidget * parent = nullptr);
46
47 // Define how the widget will behave in a layout
48 QSizePolicy sizePolicy() const;
49
51
52 QSize sizeHint() const override;
53
56
57 QBrush const & getBarBrush() const;
58 void setBarBrush(QBrush const & barBrush);
59
60 QColor const & getTextColor() const;
61 void setTextColor(QColor const & textColor);
62
63protected:
64 void paintEvent(QPaintEvent *event) override;
65
66private:
67 QString const m_text;
68
70 QBrush m_barBrush;
72};
73
74} // namespace lmms::gui
75
76#endif // LMMS_GUI_BAR_MODEL_EDITOR_H
#define READ(addr)
Definition Ay_Cpu.cpp:92
#define WRITE(addr, data)
Definition Ay_Cpu.cpp:93
#define override
Definition DistrhoDefines.h:73
Definition AutomatableModel.h:463
QBrush backgroundBrush
Definition BarModelEditor.h:41
BarModelEditor(QString text, FloatModel *floatModel, QWidget *parent=nullptr)
Definition BarModelEditor.cpp:9
QColor textColor
Definition BarModelEditor.h:43
QSize sizeHint() const override
Definition BarModelEditor.cpp:30
QBrush const & getBarBrush() const
Definition BarModelEditor.cpp:45
void setBarBrush(QBrush const &barBrush)
Definition BarModelEditor.cpp:50
QColor m_textColor
Definition BarModelEditor.h:71
void setTextColor(QColor const &textColor)
Definition BarModelEditor.cpp:60
QBrush m_barBrush
Definition BarModelEditor.h:70
QBrush m_backgroundBrush
Definition BarModelEditor.h:69
QBrush barBrush
Definition BarModelEditor.h:42
QSizePolicy sizePolicy() const
Definition BarModelEditor.cpp:19
void paintEvent(QPaintEvent *event) override
Definition BarModelEditor.cpp:65
void setBackgroundBrush(QBrush const &backgroundBrush)
Definition BarModelEditor.cpp:40
QColor const & getTextColor() const
Definition BarModelEditor.cpp:55
QBrush const & getBackgroundBrush() const
Definition BarModelEditor.cpp:35
QString const m_text
Definition BarModelEditor.h:67
QSize minimumSizeHint() const override
Definition BarModelEditor.cpp:24
FloatModelEditorBase(DirectionOfManipulation directionOfManipulation=DirectionOfManipulation::Vertical, QWidget *_parent=nullptr, const QString &_name=QString())
default ctor
Definition FloatModelEditorBase.cpp:50
static uintptr_t parent
Definition pugl.h:1644
Definition AudioPortAudio.cpp:223
const char * text
Definition swell-functions.h:167
#define const
Definition zconf.h:137