make svg stylesheet private
there isn't anymore the "SVG" magic parameter in Theme:: styleSheet()
This commit is contained in:
parent
edb2603012
commit
aa3652ec86
@ -289,29 +289,6 @@ const QString ThemePrivate::processStyleSheet(const QString &css)
|
|||||||
cachedStyleSheets.insert(DEFAULTSTYLE, stylesheet);
|
cachedStyleSheets.insert(DEFAULTSTYLE, stylesheet);
|
||||||
}
|
}
|
||||||
|
|
||||||
return stylesheet;
|
|
||||||
} else if (css == "SVG") {
|
|
||||||
stylesheet = cachedStyleSheets.value(SVGSTYLE);
|
|
||||||
if (stylesheet.isEmpty()) {
|
|
||||||
QString skel = ".ColorScheme-%1{color:%2;}";
|
|
||||||
|
|
||||||
stylesheet += skel.arg("Text","%textcolor");
|
|
||||||
stylesheet += skel.arg("Background","%backgroundcolor");
|
|
||||||
|
|
||||||
stylesheet += skel.arg("ButtonText","%buttontextcolor");
|
|
||||||
stylesheet += skel.arg("ButtonBackground","%buttonbackgroundcolor");
|
|
||||||
stylesheet += skel.arg("ButtonHover","%buttonhovercolor");
|
|
||||||
stylesheet += skel.arg("ButtonFocus","%buttonfocuscolor");
|
|
||||||
|
|
||||||
stylesheet += skel.arg("ViewText","%viewtextcolor");
|
|
||||||
stylesheet += skel.arg("ViewBackground","%viewbackgroundcolor");
|
|
||||||
stylesheet += skel.arg("ViewHover","%viewhovercolor");
|
|
||||||
stylesheet += skel.arg("ViewFocus","%viewfocuscolor");
|
|
||||||
|
|
||||||
stylesheet = processStyleSheet(stylesheet);
|
|
||||||
cachedStyleSheets.insert(SVGSTYLE, stylesheet);
|
|
||||||
}
|
|
||||||
|
|
||||||
return stylesheet;
|
return stylesheet;
|
||||||
} else {
|
} else {
|
||||||
stylesheet = css;
|
stylesheet = css;
|
||||||
@ -348,6 +325,32 @@ const QString ThemePrivate::processStyleSheet(const QString &css)
|
|||||||
return stylesheet;
|
return stylesheet;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const QString ThemePrivate::svgStyleSheet()
|
||||||
|
{
|
||||||
|
QString stylesheet = cachedStyleSheets.value(SVGSTYLE);
|
||||||
|
if (stylesheet.isEmpty()) {
|
||||||
|
QString skel = ".ColorScheme-%1{color:%2;}";
|
||||||
|
|
||||||
|
stylesheet += skel.arg("Text","%textcolor");
|
||||||
|
stylesheet += skel.arg("Background","%backgroundcolor");
|
||||||
|
|
||||||
|
stylesheet += skel.arg("ButtonText","%buttontextcolor");
|
||||||
|
stylesheet += skel.arg("ButtonBackground","%buttonbackgroundcolor");
|
||||||
|
stylesheet += skel.arg("ButtonHover","%buttonhovercolor");
|
||||||
|
stylesheet += skel.arg("ButtonFocus","%buttonfocuscolor");
|
||||||
|
|
||||||
|
stylesheet += skel.arg("ViewText","%viewtextcolor");
|
||||||
|
stylesheet += skel.arg("ViewBackground","%viewbackgroundcolor");
|
||||||
|
stylesheet += skel.arg("ViewHover","%viewhovercolor");
|
||||||
|
stylesheet += skel.arg("ViewFocus","%viewfocuscolor");
|
||||||
|
|
||||||
|
stylesheet = processStyleSheet(stylesheet);
|
||||||
|
cachedStyleSheets.insert(SVGSTYLE, stylesheet);
|
||||||
|
}
|
||||||
|
|
||||||
|
return stylesheet;
|
||||||
|
}
|
||||||
|
|
||||||
void ThemePrivate::settingsFileChanged(const QString &file)
|
void ThemePrivate::settingsFileChanged(const QString &file)
|
||||||
{
|
{
|
||||||
if (file.endsWith(themeRcFile)) {
|
if (file.endsWith(themeRcFile)) {
|
||||||
|
@ -78,6 +78,7 @@ public:
|
|||||||
void processWallpaperSettings(KConfigBase *metadata);
|
void processWallpaperSettings(KConfigBase *metadata);
|
||||||
|
|
||||||
const QString processStyleSheet(const QString &css);
|
const QString processStyleSheet(const QString &css);
|
||||||
|
const QString svgStyleSheet();
|
||||||
QColor color(Theme::ColorRole role) const;
|
QColor color(Theme::ColorRole role) const;
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
|
@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "svg.h"
|
#include "svg.h"
|
||||||
#include "private/svg_p.h"
|
#include "private/svg_p.h"
|
||||||
|
#include "private/theme_p.h"
|
||||||
|
|
||||||
#include <cmath>
|
#include <cmath>
|
||||||
|
|
||||||
@ -413,7 +414,7 @@ void SvgPrivate::createRenderer()
|
|||||||
//kDebug() << "FAIL! **************************";
|
//kDebug() << "FAIL! **************************";
|
||||||
//kDebug() << path << "**";
|
//kDebug() << path << "**";
|
||||||
|
|
||||||
QString styleSheet = cacheAndColorsTheme()->styleSheet("SVG");
|
QString styleSheet = cacheAndColorsTheme()->d->svgStyleSheet();
|
||||||
styleCrc = qChecksum(styleSheet.toUtf8(), styleSheet.size());
|
styleCrc = qChecksum(styleSheet.toUtf8(), styleSheet.size());
|
||||||
|
|
||||||
QHash<QString, SharedSvgRenderer::Ptr>::const_iterator it = s_renderers.constFind(styleCrc + path);
|
QHash<QString, SharedSvgRenderer::Ptr>::const_iterator it = s_renderers.constFind(styleCrc + path);
|
||||||
|
@ -34,6 +34,7 @@ namespace Plasma
|
|||||||
{
|
{
|
||||||
|
|
||||||
class ThemePrivate;
|
class ThemePrivate;
|
||||||
|
class SvgPrivate;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class Theme plasma/theme.h <Plasma/Theme>
|
* @class Theme plasma/theme.h <Plasma/Theme>
|
||||||
@ -312,7 +313,7 @@ class PLASMA_EXPORT Theme : public QObject
|
|||||||
void themeChanged();
|
void themeChanged();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class ThemeSingleton;
|
friend class SvgPrivate;
|
||||||
friend class ThemePrivate;
|
friend class ThemePrivate;
|
||||||
ThemePrivate *d;
|
ThemePrivate *d;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user