new function bool hasElementPrefix(prefix) that checks if the given
element prefix exists for the loaded svg and build fix woops svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=803066
This commit is contained in:
parent
5939dfc87c
commit
0f1809e9f4
10
panelsvg.cpp
10
panelsvg.cpp
@ -153,6 +153,13 @@ void PanelSvg::setElementPrefix(Plasma::Location location)
|
|||||||
d->location = location;
|
d->location = location;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool PanelSvg::hasElementPrefix(const QString & prefix) const
|
||||||
|
{
|
||||||
|
//for now it simply checks if a center element exists,
|
||||||
|
//because it could make sense for certain themes to not have all the elements
|
||||||
|
return hasElement(prefix + "-center");
|
||||||
|
}
|
||||||
|
|
||||||
void PanelSvg::setElementPrefix(const QString & prefix)
|
void PanelSvg::setElementPrefix(const QString & prefix)
|
||||||
{
|
{
|
||||||
const QString oldPrefix(d->prefix);
|
const QString oldPrefix(d->prefix);
|
||||||
@ -364,8 +371,7 @@ void PanelSvg::Private::generateBackground(PanelData *panel)
|
|||||||
}
|
}
|
||||||
|
|
||||||
p.drawTiledPixmap(QRect(panel->leftWidth, panel->topHeight,
|
p.drawTiledPixmap(QRect(panel->leftWidth, panel->topHeight,
|
||||||
contentWidth, contentHeight),
|
contentWidth, contentHeight), center);
|
||||||
prefix + "center"), center);
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (contentHeight > 0 && contentWidth > 0) {
|
if (contentHeight > 0 && contentWidth > 0) {
|
||||||
|
@ -133,6 +133,13 @@ class PLASMA_EXPORT PanelSvg : public Svg
|
|||||||
*/
|
*/
|
||||||
void setElementPrefix(const QString & prefix);
|
void setElementPrefix(const QString & prefix);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return true if the svg has the necessary elements with the given prefix
|
||||||
|
* to draw a panel
|
||||||
|
* @arg prefix the given prefix we want to check if drawable
|
||||||
|
*/
|
||||||
|
bool hasElementPrefix(const QString & prefix) const;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Returns the prefix for SVG elements of the PanelSvg
|
* Returns the prefix for SVG elements of the PanelSvg
|
||||||
* @return the prefix
|
* @return the prefix
|
||||||
|
Loading…
Reference in New Issue
Block a user