Changeset View
Changeset View
Standalone View
Standalone View
src/kcolorscheme.cpp
Show First 20 Lines • Show All 167 Lines • ▼ Show 20 Line(s) | 160 | struct SetDefaultColors { | |||
---|---|---|---|---|---|
168 | int NegativeText[3]; | 168 | int NegativeText[3]; | ||
169 | int NeutralText[3]; | 169 | int NeutralText[3]; | ||
170 | int PositiveText[3]; | 170 | int PositiveText[3]; | ||
171 | }; | 171 | }; | ||
172 | 172 | | |||
173 | struct DecoDefaultColors { | 173 | struct DecoDefaultColors { | ||
174 | int Focus[3]; | 174 | int Focus[3]; | ||
175 | int Hover[3]; | 175 | int Hover[3]; | ||
176 | int Separator[3]; | ||||
176 | }; | 177 | }; | ||
177 | 178 | | |||
178 | // these numbers come from the Breeze color scheme ([breeze]/colors/Breeze.colors) | 179 | // these numbers come from the Breeze color scheme ([breeze]/colors/Breeze.colors) | ||
179 | static const SetDefaultColors defaultViewColors = { | 180 | static const SetDefaultColors defaultViewColors = { | ||
180 | { 252, 252, 252 }, // Background | 181 | { 252, 252, 252 }, // Background | ||
181 | { 239, 240, 241 }, // Alternate | 182 | { 239, 240, 241 }, // Alternate | ||
182 | { 35, 38, 39 }, // Normal | 183 | { 35, 38, 39 }, // Normal | ||
183 | { 127, 140, 141 }, // Inactive | 184 | { 127, 140, 141 }, // Inactive | ||
▲ Show 20 Lines • Show All 68 Lines • ▼ Show 20 Line(s) | 245 | static const SetDefaultColors defaultComplementaryColors = { | |||
252 | { 231, 76, 60 }, // Negative | 253 | { 231, 76, 60 }, // Negative | ||
253 | { 253, 188, 75 }, // Neutral | 254 | { 253, 188, 75 }, // Neutral | ||
254 | { 46, 174, 230 } // Positive | 255 | { 46, 174, 230 } // Positive | ||
255 | }; | 256 | }; | ||
256 | 257 | | |||
257 | static const DecoDefaultColors defaultDecorationColors = { | 258 | static const DecoDefaultColors defaultDecorationColors = { | ||
258 | { 61, 174, 233 }, // Focus | 259 | { 61, 174, 233 }, // Focus | ||
259 | { 147, 206, 233 }, // Hover | 260 | { 147, 206, 233 }, // Hover | ||
261 | { 188, 190, 191 }, // Separator | ||||
260 | }; | 262 | }; | ||
261 | //END default colors | 263 | //END default colors | ||
262 | 264 | | |||
263 | KSharedConfigPtr defaultConfig() { | 265 | KSharedConfigPtr defaultConfig() { | ||
264 | // cache the value we'll return, since usually it's going to be the same value | 266 | // cache the value we'll return, since usually it's going to be the same value | ||
265 | static thread_local KSharedConfigPtr config; | 267 | static thread_local KSharedConfigPtr config; | ||
266 | // Read from the application's color scheme file (as set by KColorSchemeManager). | 268 | // Read from the application's color scheme file (as set by KColorSchemeManager). | ||
267 | // If unset, this is equivalent to openConfig() and the system scheme is used. | 269 | // If unset, this is equivalent to openConfig() and the system scheme is used. | ||
▲ Show 20 Lines • Show All 84 Lines • ▼ Show 20 Line(s) | 347 | { | |||
352 | _brushes.fg[KColorScheme::LinkText] = cfg.readEntry("ForegroundLink", SET_DEFAULT(LinkText)); | 354 | _brushes.fg[KColorScheme::LinkText] = cfg.readEntry("ForegroundLink", SET_DEFAULT(LinkText)); | ||
353 | _brushes.fg[KColorScheme::VisitedText] = cfg.readEntry("ForegroundVisited", SET_DEFAULT(VisitedText)); | 355 | _brushes.fg[KColorScheme::VisitedText] = cfg.readEntry("ForegroundVisited", SET_DEFAULT(VisitedText)); | ||
354 | _brushes.fg[KColorScheme::NegativeText] = cfg.readEntry("ForegroundNegative", SET_DEFAULT(NegativeText)); | 356 | _brushes.fg[KColorScheme::NegativeText] = cfg.readEntry("ForegroundNegative", SET_DEFAULT(NegativeText)); | ||
355 | _brushes.fg[KColorScheme::NeutralText] = cfg.readEntry("ForegroundNeutral", SET_DEFAULT(NeutralText)); | 357 | _brushes.fg[KColorScheme::NeutralText] = cfg.readEntry("ForegroundNeutral", SET_DEFAULT(NeutralText)); | ||
356 | _brushes.fg[KColorScheme::PositiveText] = cfg.readEntry("ForegroundPositive", SET_DEFAULT(PositiveText)); | 358 | _brushes.fg[KColorScheme::PositiveText] = cfg.readEntry("ForegroundPositive", SET_DEFAULT(PositiveText)); | ||
357 | 359 | | |||
358 | _brushes.deco[KColorScheme::FocusColor] = cfg.readEntry("DecorationFocus", DECO_DEFAULT(Focus)); | 360 | _brushes.deco[KColorScheme::FocusColor] = cfg.readEntry("DecorationFocus", DECO_DEFAULT(Focus)); | ||
359 | _brushes.deco[KColorScheme::HoverColor] = cfg.readEntry("DecorationHover", DECO_DEFAULT(Hover)); | 361 | _brushes.deco[KColorScheme::HoverColor] = cfg.readEntry("DecorationHover", DECO_DEFAULT(Hover)); | ||
362 | _brushes.deco[KColorScheme::SeparatorColor] = cfg.readEntry("DecorationSeparator", DECO_DEFAULT(Separator)); | ||||
360 | 363 | | |||
361 | // apply state adjustments | 364 | // apply state adjustments | ||
362 | if (state != QPalette::Active) { | 365 | if (state != QPalette::Active) { | ||
363 | StateEffects effects(state, config); | 366 | StateEffects effects(state, config); | ||
364 | for (auto &fg : _brushes.fg) { | 367 | for (auto &fg : _brushes.fg) { | ||
365 | fg = effects.brush(fg, _brushes.bg[KColorScheme::NormalBackground]); | 368 | fg = effects.brush(fg, _brushes.bg[KColorScheme::NormalBackground]); | ||
366 | } | 369 | } | ||
367 | for (auto &deco : _brushes.deco) { | 370 | for (auto &deco : _brushes.deco) { | ||
▲ Show 20 Lines • Show All 374 Lines • Show Last 20 Lines |