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;
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
const QString oldPrefix(d->prefix);
|
||||
@ -364,8 +371,7 @@ void PanelSvg::Private::generateBackground(PanelData *panel)
|
||||
}
|
||||
|
||||
p.drawTiledPixmap(QRect(panel->leftWidth, panel->topHeight,
|
||||
contentWidth, contentHeight),
|
||||
prefix + "center"), center);
|
||||
contentWidth, contentHeight), center);
|
||||
}
|
||||
} else {
|
||||
if (contentHeight > 0 && contentWidth > 0) {
|
||||
|
@ -133,6 +133,13 @@ class PLASMA_EXPORT PanelSvg : public Svg
|
||||
*/
|
||||
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
|
||||
* @return the prefix
|
||||
|
Loading…
Reference in New Issue
Block a user