From kde-core-devel Fri Sep 14 22:23:18 2007 From: Thomas Zander Date: Fri, 14 Sep 2007 22:23:18 +0000 To: kde-core-devel Subject: KDE/kdelibs/kdeui/colors Message-Id: <1189808598.789958.7512.nullmailer () svn ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-core-devel&m=118980861732361 SVN commit 712618 by zander: recommit; please don't revert again. If you have a problem, talk first. Its actually very rude to revert a commit you already Ok-ed in concept on IRC without saying a word to me about it. CCMAIL: kde-core-devel@kde.org M +21 -32 kcolorscheme.cpp --- trunk/KDE/kdelibs/kdeui/colors/kcolorscheme.cpp #712617:712618 @@ -69,39 +69,28 @@ StateEffects::StateEffects(QPalette::ColorGroup state, const KSharedConfigPtr &config) : _color(0,0,0,0)//, _chain(0) not needed yet { - switch (state) { - case QPalette::Disabled: - { - KConfigGroup cfg(config, "ColorEffects:Disabled"); - _effects[Intensity] = cfg.readEntry( "IntensityEffect", (int)IntensityNoEffect ); - _effects[Color] = cfg.readEntry( "ColorEffect", (int)ColorNoEffect ); - _effects[Contrast] = cfg.readEntry( "ContrastEffect", (int)ContrastFade ); - _amount[Intensity] = cfg.readEntry( "IntensityAmount", +0.0 ); - _amount[Color] = cfg.readEntry( "ColorAmount", +0.0 ); - _amount[Contrast] = cfg.readEntry( "ContrastAmount", +0.7 ); - if (_effects[0] >= ColorFade) { - _color = cfg.readEntry( "Color", QColor(128,128,128) ); - } - } break; - // TODO (Inactive+Disabled) - create chain and fall through - case QPalette::Inactive: - { - KConfigGroup cfg(config, "ColorEffects:Inactive"); - _effects[Intensity] = cfg.readEntry( "IntensityEffect", (int)IntensityNoEffect ); - _effects[Color] = cfg.readEntry( "ColorEffect", (int)ColorNoEffect ); - _effects[Contrast] = cfg.readEntry( "ContrastEffect", (int)ContrastFade ); - _amount[Intensity] = cfg.readEntry( "IntensityAmount", +0.0 ); - _amount[Color] = cfg.readEntry( "ColorAmount", +0.0 ); - _amount[Contrast] = cfg.readEntry( "ContrastAmount", +0.4 ); - if (_effects[Color] >= ColorFade) { - _color = cfg.readEntry( "Color", QColor(128,128,128) ); - } - } break; - default: - _effects[0] = 0; - _effects[1] = 0; - _effects[2] = 0; + QString group; + if(state == QPalette::Disabled) + group = "ColorEffects:Disabled"; + else if(state == QPalette::Inactive) + group = "ColorEffects:Inactive"; + else { + _effects[0] = 0; + _effects[1] = 0; + _effects[2] = 0; } + + if(! group.isEmpty()) { + KConfigGroup cfg(config, group); + _effects[Intensity] = cfg.readEntry( "IntensityEffect", (int)IntensityNoEffect ); + _effects[Color] = cfg.readEntry( "ColorEffect", (int)ColorNoEffect ); + _effects[Contrast] = cfg.readEntry( "ContrastEffect", (int)ContrastFade ); + _amount[Intensity] = cfg.readEntry( "IntensityAmount", 0.0 ); + _amount[Color] = cfg.readEntry( "ColorAmount", 0.0 ); + _amount[Contrast] = cfg.readEntry( "ContrastAmount", 0.7 ); + if (_effects[0] >= ColorFade) + _color = cfg.readEntry( "Color", QColor(128, 128, 128) ); + } } QBrush StateEffects::brush(const QBrush &background) const