9#include <QCoreApplication>
10#include <QDomDocument>
27 const QString &
filename, QDomElement &element,
bool showWarnings)
29 if (element.tagName() ==
"layout")
33 if (layout ==
"vertical")
38 else if (element.tagName() ==
"hidedelay")
67 value = std::max(value, 1);
98 LOG(VB_GENERAL, LOG_ERR,
"Slider element doesn't exist");
107 QPoint endPos(newSliderArea.left(), newSliderArea.top());
111 int width = std::max((
int)lroundf(fillArea.width() * relativeSize),
114 endPos.setX(lroundf((fillArea.width() - width) * percentage));
118 int height = std::max((
int)lroundf(fillArea.height() * relativeSize),
121 endPos.setY(lroundf((fillArea.height() - height) * percentage));
124 slider->
SetArea(newSliderArea);
162 scrollbar->CopyFrom(
this);
Wrapper around QRect allowing us to handle percentage and other relative values for areas in mythui.
void setWidth(const QString &sWidth)
void setHeight(const QString &sHeight)
The base class on which all widgets and screens are based.
void AdjustAlpha(int mode, int alphachange, int minalpha=0, int maxalpha=255)
virtual void SetArea(const MythRect &rect)
virtual void CopyFrom(MythUIType *base)
Copy this widgets state from another.
virtual MythRect GetArea(void) const
If the object has a minimum area defined, return it, other wise return the default area.
void SetPosition(int x, int y)
Convenience method, calls SetPosition(const MythPoint&) Override that instead to change functionality...
MythUIType * GetChild(const QString &name) const
Get a named child of this UIType.
virtual void Reset(void)
Reset the widget to it's original state, should not reset changes made by the theme.
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 FinishedFading(void)
static QString getFirstText(QDomElement &element)
#define LOG(_MASK_, _LEVEL_, _QSTRING_)
static eu8 clamp(eu8 value, eu8 low, eu8 high)