Changeset View
Changeset View
Standalone View
Standalone View
src/libkirigami/platformtheme.cpp
Show First 20 Lines • Show All 123 Lines • ▼ Show 20 Line(s) | |||||
124 | { | 124 | { | ||
125 | if (customPalette.color(cg, cr) != color) { | 125 | if (customPalette.color(cg, cr) != color) { | ||
126 | customPalette.setColor(cg, cr, color); | 126 | customPalette.setColor(cg, cr, color); | ||
127 | } | 127 | } | ||
128 | } | 128 | } | ||
129 | 129 | | |||
130 | void PlatformThemePrivate::syncCustomPalette() | 130 | void PlatformThemePrivate::syncCustomPalette() | ||
131 | { | 131 | { | ||
132 | const auto prev = customPalette; | ||||
132 | for (auto state : { QPalette::Active, QPalette::Inactive, QPalette::Disabled }) { | 133 | for (auto state : { QPalette::Active, QPalette::Inactive, QPalette::Disabled }) { | ||
133 | setPaletteColor(customPalette, state, QPalette::WindowText, q->textColor()); | 134 | setPaletteColor(customPalette, state, QPalette::WindowText, q->textColor()); | ||
134 | setPaletteColor(customPalette, state, QPalette::Window, q->backgroundColor()); | 135 | setPaletteColor(customPalette, state, QPalette::Window, q->backgroundColor()); | ||
135 | setPaletteColor(customPalette, state, QPalette::Base, q->backgroundColor()); | 136 | setPaletteColor(customPalette, state, QPalette::Base, q->backgroundColor()); | ||
136 | setPaletteColor(customPalette, state, QPalette::Text, q->textColor()); | 137 | setPaletteColor(customPalette, state, QPalette::Text, q->textColor()); | ||
137 | setPaletteColor(customPalette, state, QPalette::Button, q->backgroundColor()); | 138 | setPaletteColor(customPalette, state, QPalette::Button, q->backgroundColor()); | ||
138 | setPaletteColor(customPalette, state, QPalette::ButtonText, q->textColor()); | 139 | setPaletteColor(customPalette, state, QPalette::ButtonText, q->textColor()); | ||
139 | setPaletteColor(customPalette, state, QPalette::Highlight, q->highlightColor()); | 140 | setPaletteColor(customPalette, state, QPalette::Highlight, q->highlightColor()); | ||
140 | setPaletteColor(customPalette, state, QPalette::HighlightedText, q->highlightedTextColor()); | 141 | setPaletteColor(customPalette, state, QPalette::HighlightedText, q->highlightedTextColor()); | ||
141 | setPaletteColor(customPalette, state, QPalette::ToolTipBase, q->backgroundColor()); | 142 | setPaletteColor(customPalette, state, QPalette::ToolTipBase, q->backgroundColor()); | ||
142 | setPaletteColor(customPalette, state, QPalette::ToolTipText, q->textColor()); | 143 | setPaletteColor(customPalette, state, QPalette::ToolTipText, q->textColor()); | ||
143 | setPaletteColor(customPalette, state, QPalette::Link, q->linkColor()); | 144 | setPaletteColor(customPalette, state, QPalette::Link, q->linkColor()); | ||
144 | setPaletteColor(customPalette, state, QPalette::LinkVisited, q->visitedLinkColor()); | 145 | setPaletteColor(customPalette, state, QPalette::LinkVisited, q->visitedLinkColor()); | ||
145 | } | 146 | } | ||
147 | if (prev != customPalette) { | ||||
146 | emit q->paletteChanged(customPalette); | 148 | emit q->paletteChanged(customPalette); | ||
147 | } | 149 | } | ||
150 | } | ||||
148 | 151 | | |||
149 | void PlatformThemePrivate::findParentStyle() | 152 | void PlatformThemePrivate::findParentStyle() | ||
150 | { | 153 | { | ||
151 | if (m_parentTheme) { | 154 | if (m_parentTheme) { | ||
152 | m_parentTheme->d->m_childThemes.remove(q); | 155 | m_parentTheme->d->m_childThemes.remove(q); | ||
153 | } | 156 | } | ||
154 | QQuickItem *candidate = qobject_cast<QQuickItem *>(q->parent()); | 157 | QQuickItem *candidate = qobject_cast<QQuickItem *>(q->parent()); | ||
155 | while (candidate) { | 158 | while (candidate) { | ||
▲ Show 20 Lines • Show All 783 Lines • Show Last 20 Lines |