possibility to set an attached colorscope to not inherit
this makes an easy bridging between the plasma and kirigami theming reviewed-by:Eike Hein
This commit is contained in:
parent
ee2b12be04
commit
b62118c90c
@ -210,6 +210,21 @@ QColor ColorScope::negativeTextColor() const
|
||||
return m_theme.color(Plasma::Theme::NegativeTextColor, m_group);
|
||||
}
|
||||
|
||||
bool ColorScope::inherit() const
|
||||
{
|
||||
return m_inherit;
|
||||
}
|
||||
|
||||
void ColorScope::setInherit(bool inherit)
|
||||
{
|
||||
if (m_inherit == inherit) {
|
||||
return;
|
||||
}
|
||||
m_inherit = inherit;
|
||||
emit inheritChanged();
|
||||
emit colorsChanged();
|
||||
}
|
||||
|
||||
void ColorScope::itemChange(ItemChange change, const ItemChangeData &value)
|
||||
{
|
||||
if (change == QQuickItem::ItemSceneChange) {
|
||||
|
@ -79,6 +79,12 @@ class ColorScope : public QQuickItem
|
||||
*/
|
||||
Q_PROPERTY(QColor negativeTextColor READ negativeTextColor NOTIFY colorsChanged)
|
||||
|
||||
/**
|
||||
* true if the scope inherits from its parent scope
|
||||
* @since 5.39
|
||||
*/
|
||||
Q_PROPERTY(bool inherit READ inherit WRITE setInherit NOTIFY inheritChanged)
|
||||
|
||||
public:
|
||||
/// @cond INTERNAL_DOCS
|
||||
ColorScope(QQuickItem *parent = 0, QObject *parentObject = 0);
|
||||
@ -95,6 +101,9 @@ public:
|
||||
QColor neutralTextColor() const;
|
||||
QColor negativeTextColor() const;
|
||||
|
||||
bool inherit() const;
|
||||
void setInherit(bool inherit);
|
||||
|
||||
////NEEDED BY QML TO CREATE ATTACHED PROPERTIES
|
||||
static ColorScope *qmlAttachedProperties(QObject *object);
|
||||
|
||||
@ -106,6 +115,7 @@ public:
|
||||
Q_SIGNALS:
|
||||
void colorGroupChanged();
|
||||
void colorsChanged();
|
||||
void inheritChanged();
|
||||
|
||||
private:
|
||||
bool m_inherit;
|
||||
|
Loading…
Reference in New Issue
Block a user