Maki
Formally verfied low-code orchestration
Loading...
Searching...
No Matches
scroll_area.h
1#pragma once
2
3#include <QPainter>
4#include <QPainterPath>
5#include <QScrollArea>
6
10class StyledScrollArea : public QScrollArea
11{
12 Q_OBJECT
13
14public:
18 enum class BackgroundRole
19 {
20 Window,
21 Base,
22 Button,
23 Midlight,
24 Custom
25 };
26
32 StyledScrollArea(QWidget* parent = nullptr);
33
40
46 void setCustomBackgroundColor(const QColor& color);
47
48protected:
55 bool viewportEvent(QEvent* event) override;
56
57private:
58 BackgroundRole mBackgroundRole = BackgroundRole::Base;
60
66 QColor backgroundColor() const;
67};
QColor mCustomBackgroundColor
The current background role.
Definition scroll_area.h:59
void setCustomBackgroundColor(const QColor &color)
Sets a custom background color for the scroll area.
Definition scroll_area.cpp:22
QColor backgroundColor() const
The custom background color.
Definition scroll_area.cpp:42
StyledScrollArea(QWidget *parent=nullptr)
Constructs a StyledScrollArea with the given parent.
Definition scroll_area.cpp:6
BackgroundRole
Enumeration for different background roles.
Definition scroll_area.h:19
@ Base
The window background role.
Definition scroll_area.h:21
void setBackgroundRole(BackgroundRole role)
Sets the background role for the scroll area.
Definition scroll_area.cpp:16
bool viewportEvent(QEvent *event) override
Handles viewport events.
Definition scroll_area.cpp:29