Go to the documentation of this file.
9 #include <QCoreApplication>
10 #include <QDomDocument>
28 const QString &
filename, QDomElement &element,
bool showWarnings)
30 if (element.tagName() ==
"layout")
34 if (layout ==
"vertical")
39 else if (element.tagName() ==
"style")
43 if (effect ==
"slide")
90 LOG(VB_GENERAL, LOG_ERR,
"Progress image doesn't exist");
98 float percentage = 0.0;
100 if (total <= 0 || current <= 0 || current > total)
103 percentage = (float)
current / (
float)total;
106 QRect fillArea = progressType->
GetArea();
108 int height = fillArea.height();
109 int width = fillArea.width();
110 int x = fillArea.x();
111 int y = fillArea.y();
119 width = (int)((
float)fillArea.width() * percentage);
123 height = (int)((
float)fillArea.height() * percentage);
131 int newwidth = (int)((
float)fillArea.width() * percentage);
132 x = width - newwidth;
137 int newheight = (int)((
float)fillArea.height() * percentage);
138 y = height - newheight;
148 auto *progressImage =
dynamic_cast<MythUIImage *
>(progressType);
149 auto *progressShape =
dynamic_cast<MythUIShape *
>(progressType);
159 else if (progressShape)
160 progressShape->SetCropRect(x, y, width, height);
180 m_total = progressbar->m_total;
181 m_start = progressbar->m_start;
190 progressbar->CopyFrom(
this);
Image widget, displays a single image or multiple images in sequence.
void Finalize(void) override
Perform any post-xml parsing initialisation tasks.
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
QDateTime current(bool stripped)
Returns current Date and Time in UTC.
virtual MythRect GetArea(void) const
If the object has a minimum area defined, return it, other wise return the default area.
void SetCropRect(int x, int y, int width, int height)
bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings) override
Parse the xml definition of this widget setting the state of the object accordingly.
void Reset(void) override
Reset the widget to it's original state, should not reset changes made by the theme.
void Set(int start, int total, int used)
void DependChanged(bool isDefault)
static QString getFirstText(QDomElement &element)
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
void CreateCopy(MythUIType *parent) override
Copy the state of this widget to the one given, it must be of the same type.
static eu8 clamp(eu8 value, eu8 low, eu8 high)
virtual void Reset(void)
Reset the widget to it's original state, should not reset changes made by the theme.
The base class on which all widgets and screens are based.
A widget for rendering primitive shapes and lines.
virtual void SetVisible(bool visible)
void CalculatePosition(void)
void CopyFrom(MythUIType *base) override
Copy this widgets state from another.
MythUIProgressBar(MythUIType *parent, const QString &name)
virtual bool ParseElement(const QString &filename, QDomElement &element, bool showWarnings)
Parse the xml definition of this widget setting the state of the object accordingly.
void SetVisible(bool visible) override