Go to the documentation of this file.
6 #include <QCoreApplication>
7 #include <QDomDocument>
25 const QString &
filename, QDomElement &element,
bool showWarnings)
27 if (element.tagName() ==
"layout")
31 if (layout ==
"vertical")
36 else if (element.tagName() ==
"style")
40 if (effect ==
"slide")
83 LOG(VB_GENERAL, LOG_ERR,
"Progress image doesn't exist");
91 float percentage = 0.0;
93 if (total <= 0 || current <= 0 || current > total)
96 percentage = (float)
current / (
float)total;
99 QRect fillArea = progressType->
GetArea();
101 int height = fillArea.height();
102 int width = fillArea.width();
103 int x = fillArea.x();
104 int y = fillArea.y();
112 width = (int)((
float)fillArea.width() * percentage);
116 height = (int)((
float)fillArea.height() * percentage);
124 int newwidth = (int)((
float)fillArea.width() * percentage);
125 x = width - newwidth;
130 int newheight = (int)((
float)fillArea.height() * percentage);
131 y = height - newheight;
141 auto *progressImage =
dynamic_cast<MythUIImage *
>(progressType);
142 auto *progressShape =
dynamic_cast<MythUIShape *
>(progressType);
152 else if (progressShape)
153 progressShape->SetCropRect(x, y, width, height);
173 m_total = progressbar->m_total;
174 m_start = progressbar->m_start;
183 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 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.
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