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")
93 LOG(VB_GENERAL, LOG_ERR,
"Progress image doesn't exist");
101 float percentage = 0.0;
103 if (total <= 0 || current <= 0 || current > total)
106 percentage = (float)
current / (
float)total;
109 QRect fillArea = progressType->
GetArea();
111 int height = fillArea.height();
112 int width = fillArea.width();
113 int x = fillArea.x();
114 int y = fillArea.y();
122 width = (int)((
float)fillArea.width() * percentage);
126 height = (int)((
float)fillArea.height() * percentage);
134 int newwidth = (int)((
float)fillArea.width() * percentage);
135 x = width - newwidth;
140 int newheight = (int)((
float)fillArea.height() * percentage);
141 y = height - newheight;
151 auto *progressImage =
dynamic_cast<MythUIImage *
>(progressType);
152 auto *progressShape =
dynamic_cast<MythUIShape *
>(progressType);
162 else if (progressShape)
163 progressShape->SetCropRect(x, y, width, height);
183 m_total = progressbar->m_total;
184 m_start = progressbar->m_start;
193 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.
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