MythTV master
mythuiscrollbar.h
Go to the documentation of this file.
1#ifndef MYTHUI_SCROLLBAR_H_
2#define MYTHUI_SCROLLBAR_H_
3
4#include "mythuitype.h"
5
6const int kDefaultMaxValue = 99;
7const int kDefaultPageStep = 10;
8
16{
17 Q_OBJECT
18
19 public:
20 MythUIScrollBar(MythUIType *parent, const QString &name)
21 : MythUIType(parent, name) {}
22 ~MythUIScrollBar() override = default;
23
24 void Reset(void) override; // MythUIType
25
26 enum LayoutType : std::uint8_t { LayoutVertical, LayoutHorizontal };
27
28 void SetPageStep(int value);
29 void SetSliderPosition(int value);
30 void SetMaximum(int value);
31
32 protected slots:
33 void DoneFading(void);
34
35 protected:
36 bool ParseElement(const QString &filename, QDomElement &element,
37 bool showWarnings) override; // MythUIType
38 void CopyFrom(MythUIType *base) override; // MythUIType
39 void CreateCopy(MythUIType *parent) override; // MythUIType
40 void Finalize(void) override; // MythUIType
41
42 void CalculatePosition(void);
43 void timerEvent(QTimerEvent *event) override; // QObject
44
45 LayoutType m_layout {LayoutVertical};
46
48 int m_pageStep {kDefaultPageStep};
49 int m_sliderPosition {0};
50 int m_maximum {0};
51
52 std::chrono::milliseconds m_hideDelay {0ms};
53 int m_timerId {0};
54};
55
56#endif
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
Definition: mythrect.h:18
Scroll bar widget.
~MythUIScrollBar() override=default
MythRect m_sliderArea
MythUIScrollBar(MythUIType *parent, const QString &name)
The base class on which all widgets and screens are based.
Definition: mythuitype.h:86
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
virtual void Finalize(void)
Perform any post-xml parsing initialisation tasks.
virtual void CreateCopy(MythUIType *parent)
Copy the state of this widget to the one given, it must be of the same type.
virtual void Reset(void)
Reset the widget to it's original state, should not reset changes made by the theme.
Definition: mythuitype.cpp:73
virtual bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings)
Parse the xml definition of this widget setting the state of the object accordingly.
#define MUI_PUBLIC
Definition: mythuiexp.h:9
const int kDefaultMaxValue
const int kDefaultPageStep