From 37512e759148a3067af44ac8b6dd28cc6fc6e8bc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Tue, 5 Aug 2008 08:10:01 +0000 Subject: [PATCH] Add of config option if the cube should be shown when desktop is changed via pager or ctrl+f1-4. Turned of per default. svn path=/trunk/KDE/kdebase/workspace/; revision=842306 --- effects/cube.cpp | 4 ++++ effects/cube.h | 1 + effects/cube_config.cpp | 12 ++++++++++++ effects/cube_config.ui | 19 +++++++++++++------ 4 files changed, 30 insertions(+), 6 deletions(-) diff --git a/effects/cube.cpp b/effects/cube.cpp index 79c53213f3..94023e29a6 100644 --- a/effects/cube.cpp +++ b/effects/cube.cpp @@ -70,6 +70,7 @@ CubeEffect::CubeEffect() , slide( false ) , oldDesktop( 0 ) , activeScreen( 0 ) + , animateDesktopChange( false ) { KConfigGroup conf = effects->effectConfig( "Cube" ); borderActivate = (ElectricBorder)conf.readEntry( "BorderActivate", (int)ElectricNone ); @@ -80,6 +81,7 @@ CubeEffect::CubeEffect() reflection = conf.readEntry( "Reflection", true ); rotationDuration = conf.readEntry( "RotationDuration", 500 ); backgroundColor = conf.readEntry( "BackgroundColor", QColor( Qt::black ) ); + animateDesktopChange = conf.readEntry( "AnimateDesktopChange", false ); capColor = conf.readEntry( "CapColor", KColorScheme( QPalette::Active, KColorScheme::Window ).background().color() ); paintCaps = conf.readEntry( "Caps", true ); QString file = conf.readEntry( "Wallpaper", QString("") ); @@ -1550,6 +1552,8 @@ void CubeEffect::desktopChanged( int old ) return; if( activated ) return; + if( !animateDesktopChange ) + return; slide = true; oldDesktop = old; setActive( true ); diff --git a/effects/cube.h b/effects/cube.h index 630c255afe..542d29d6d2 100644 --- a/effects/cube.h +++ b/effects/cube.h @@ -105,6 +105,7 @@ class CubeEffect int rotationDuration; QList windowsOnOtherScreens; int activeScreen; + bool animateDesktopChange; }; } // namespace diff --git a/effects/cube_config.cpp b/effects/cube_config.cpp index 9c8f390f8e..f04c31027f 100644 --- a/effects/cube_config.cpp +++ b/effects/cube_config.cpp @@ -76,6 +76,7 @@ CubeEffectConfig::CubeEffectConfig(QWidget* parent, const QVariantList& args) : connect(m_ui->displayDesktopNameBox, SIGNAL(stateChanged(int)), this, SLOT(changed())); connect(m_ui->reflectionBox, SIGNAL(stateChanged(int)), this, SLOT(changed())); connect(m_ui->backgroundColorButton, SIGNAL(changed(QColor)), this, SLOT(changed())); + connect(m_ui->animateDesktopChangeBox, SIGNAL(stateChanged(int)), this, SLOT(changed())); connect(m_ui->cubeCapsBox, SIGNAL(stateChanged(int)), this, SLOT(changed())); connect(m_ui->cubeCapsBox, SIGNAL(stateChanged(int)), this, SLOT(capsSelectionChanged())); connect(m_ui->capsImageBox, SIGNAL(stateChanged(int)), this, SLOT(changed())); @@ -99,6 +100,7 @@ void CubeEffectConfig::load() QColor capColor = conf.readEntry( "CapColor", KColorScheme( QPalette::Active, KColorScheme::Window ).background().color() ); bool texturedCaps = conf.readEntry( "TexturedCaps", true ); bool caps = conf.readEntry( "Caps", true ); + bool animateChange = conf.readEntry( "AnimateDesktopChange", false ); if( activateBorder == (int)ElectricNone ) activateBorder--; m_ui->screenEdgeCombo->setCurrentIndex( activateBorder ); @@ -138,6 +140,14 @@ void CubeEffectConfig::load() { m_ui->capsImageBox->setCheckState( Qt::Unchecked ); } + if( animateChange ) + { + m_ui->animateDesktopChangeBox->setCheckState( Qt::Checked ); + } + else + { + m_ui->animateDesktopChangeBox->setCheckState( Qt::Unchecked ); + } m_ui->backgroundColorButton->setColor( background ); m_ui->capColorButton->setColor( capColor ); capsSelectionChanged(); @@ -157,6 +167,7 @@ void CubeEffectConfig::save() conf.writeEntry( "Caps", m_ui->cubeCapsBox->checkState() == Qt::Checked ? true : false ); conf.writeEntry( "CapColor", m_ui->capColorButton->color() ); conf.writeEntry( "TexturedCaps", m_ui->capsImageBox->checkState() == Qt::Checked ? true : false ); + conf.writeEntry( "AnimateDesktopChange", m_ui->animateDesktopChangeBox->checkState() == Qt::Checked ? true : false ); int activateBorder = m_ui->screenEdgeCombo->currentIndex(); if( activateBorder == (int)ELECTRIC_COUNT ) @@ -183,6 +194,7 @@ void CubeEffectConfig::defaults() m_ui->cubeCapsBox->setCheckState( Qt::Checked ); m_ui->capColorButton->setColor( KColorScheme( QPalette::Active, KColorScheme::Window ).background().color() ); m_ui->capsImageBox->setCheckState( Qt::Checked ); + m_ui->animateDesktopChangeBox->setCheckState( Qt::Unchecked ); m_ui->editor->allDefault(); emit changed(true); } diff --git a/effects/cube_config.ui b/effects/cube_config.ui index 462af3a8ab..dc9d24dc13 100644 --- a/effects/cube_config.ui +++ b/effects/cube_config.ui @@ -146,7 +146,7 @@ - + &Background Color: @@ -156,17 +156,17 @@ - + - + Cube &Caps - + C&ap Color: @@ -176,16 +176,23 @@ - + - + Display &image on cube caps + + + + &Show cube when desktop changed + + +