Commit f5f83ddd authored by Denis Kuplyakov's avatar Denis Kuplyakov
Browse files

Finally finished ColorScheme class by introducing QPalette::ColorGroup

parameter for queries.
parent f80d51d2
......@@ -27,6 +27,20 @@ ColorScheme::ColorScheme(QDeclarativeItem *parent) :
{
}
QPalette::ColorGroup ColorScheme::getColorGroup() const
{
return m_colorGroup;
}
void ColorScheme::setColorGroup(QPalette::ColorGroup colorGroup)
{
m_colorGroup = colorGroup;
emit onBackgroundChange();
emit onDecorationChange();
emit onForegroundChange();
emit onShadeChange();
}
KColorScheme::ColorSet ColorScheme::getColorSet() const
{
return m_colorSet;
......@@ -88,24 +102,24 @@ QColor ColorScheme::background() const
{
return KStatefulBrush(m_colorSet,
m_backgroundRole)
.brush(QPalette::Active).color();
.brush(m_colorGroup).color();
}
QColor ColorScheme::foreground() const
{
return KStatefulBrush(m_colorSet,
m_foregroundRole)
.brush(QPalette::Active).color();
.brush(m_colorGroup).color();
}
QColor ColorScheme::decoration() const
{
return KStatefulBrush(m_colorSet,
m_decorationRole)
.brush(QPalette::Active).color();
.brush(m_colorGroup).color();
}
QColor ColorScheme::shade() const
{
return KColorScheme(QPalette::Active).shade(m_shadeRole);
return KColorScheme(m_colorGroup).shade(m_shadeRole);
}
......@@ -53,8 +53,9 @@
*/
class ColorScheme : public QDeclarativeItem
{
//TODO: add QPalette::ColorGroup param
Q_OBJECT
Q_PROPERTY(QPalette::ColorGroup colorGroup
READ getColorGroup WRITE setColorGroup)
Q_PROPERTY(KColorScheme::ColorSet colorSet
READ getColorSet WRITE setColorSet)
Q_PROPERTY(KColorScheme::BackgroundRole backgroundRole
......@@ -73,6 +74,15 @@ class ColorScheme : public QDeclarativeItem
public:
explicit ColorScheme(QDeclarativeItem *parent = 0);
/**
* @return current QPalette::ColorGroup parameter value
*/
QPalette::ColorGroup getColorGroup() const;
/**
* Sets QPalette::ColorGroup parameter value to @p colorGroup
*/
void setColorGroup(QPalette::ColorGroup colorGroup);
/**
* @return current KColorScheme::ColorSet parameter value
*/
......@@ -146,6 +156,7 @@ signals:
void onShadeChange();
private:
QPalette::ColorGroup m_colorGroup;
KColorScheme::ColorSet m_colorSet;
KColorScheme::BackgroundRole m_backgroundRole;
KColorScheme::ForegroundRole m_foregroundRole;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment