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
This commit is contained in:
Martin Gräßlin 2008-08-05 08:10:01 +00:00
parent f10369232e
commit 37512e7591
4 changed files with 30 additions and 6 deletions

View file

@ -70,6 +70,7 @@ CubeEffect::CubeEffect()
, slide( false ) , slide( false )
, oldDesktop( 0 ) , oldDesktop( 0 )
, activeScreen( 0 ) , activeScreen( 0 )
, animateDesktopChange( false )
{ {
KConfigGroup conf = effects->effectConfig( "Cube" ); KConfigGroup conf = effects->effectConfig( "Cube" );
borderActivate = (ElectricBorder)conf.readEntry( "BorderActivate", (int)ElectricNone ); borderActivate = (ElectricBorder)conf.readEntry( "BorderActivate", (int)ElectricNone );
@ -80,6 +81,7 @@ CubeEffect::CubeEffect()
reflection = conf.readEntry( "Reflection", true ); reflection = conf.readEntry( "Reflection", true );
rotationDuration = conf.readEntry( "RotationDuration", 500 ); rotationDuration = conf.readEntry( "RotationDuration", 500 );
backgroundColor = conf.readEntry( "BackgroundColor", QColor( Qt::black ) ); backgroundColor = conf.readEntry( "BackgroundColor", QColor( Qt::black ) );
animateDesktopChange = conf.readEntry( "AnimateDesktopChange", false );
capColor = conf.readEntry( "CapColor", KColorScheme( QPalette::Active, KColorScheme::Window ).background().color() ); capColor = conf.readEntry( "CapColor", KColorScheme( QPalette::Active, KColorScheme::Window ).background().color() );
paintCaps = conf.readEntry( "Caps", true ); paintCaps = conf.readEntry( "Caps", true );
QString file = conf.readEntry( "Wallpaper", QString("") ); QString file = conf.readEntry( "Wallpaper", QString("") );
@ -1550,6 +1552,8 @@ void CubeEffect::desktopChanged( int old )
return; return;
if( activated ) if( activated )
return; return;
if( !animateDesktopChange )
return;
slide = true; slide = true;
oldDesktop = old; oldDesktop = old;
setActive( true ); setActive( true );

View file

@ -105,6 +105,7 @@ class CubeEffect
int rotationDuration; int rotationDuration;
QList<EffectWindow*> windowsOnOtherScreens; QList<EffectWindow*> windowsOnOtherScreens;
int activeScreen; int activeScreen;
bool animateDesktopChange;
}; };
} // namespace } // namespace

View file

@ -76,6 +76,7 @@ CubeEffectConfig::CubeEffectConfig(QWidget* parent, const QVariantList& args) :
connect(m_ui->displayDesktopNameBox, SIGNAL(stateChanged(int)), this, SLOT(changed())); connect(m_ui->displayDesktopNameBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->reflectionBox, 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->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(changed()));
connect(m_ui->cubeCapsBox, SIGNAL(stateChanged(int)), this, SLOT(capsSelectionChanged())); connect(m_ui->cubeCapsBox, SIGNAL(stateChanged(int)), this, SLOT(capsSelectionChanged()));
connect(m_ui->capsImageBox, SIGNAL(stateChanged(int)), this, SLOT(changed())); 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() ); QColor capColor = conf.readEntry( "CapColor", KColorScheme( QPalette::Active, KColorScheme::Window ).background().color() );
bool texturedCaps = conf.readEntry( "TexturedCaps", true ); bool texturedCaps = conf.readEntry( "TexturedCaps", true );
bool caps = conf.readEntry( "Caps", true ); bool caps = conf.readEntry( "Caps", true );
bool animateChange = conf.readEntry( "AnimateDesktopChange", false );
if( activateBorder == (int)ElectricNone ) if( activateBorder == (int)ElectricNone )
activateBorder--; activateBorder--;
m_ui->screenEdgeCombo->setCurrentIndex( activateBorder ); m_ui->screenEdgeCombo->setCurrentIndex( activateBorder );
@ -138,6 +140,14 @@ void CubeEffectConfig::load()
{ {
m_ui->capsImageBox->setCheckState( Qt::Unchecked ); 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->backgroundColorButton->setColor( background );
m_ui->capColorButton->setColor( capColor ); m_ui->capColorButton->setColor( capColor );
capsSelectionChanged(); capsSelectionChanged();
@ -157,6 +167,7 @@ void CubeEffectConfig::save()
conf.writeEntry( "Caps", m_ui->cubeCapsBox->checkState() == Qt::Checked ? true : false ); conf.writeEntry( "Caps", m_ui->cubeCapsBox->checkState() == Qt::Checked ? true : false );
conf.writeEntry( "CapColor", m_ui->capColorButton->color() ); conf.writeEntry( "CapColor", m_ui->capColorButton->color() );
conf.writeEntry( "TexturedCaps", m_ui->capsImageBox->checkState() == Qt::Checked ? true : false ); 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(); int activateBorder = m_ui->screenEdgeCombo->currentIndex();
if( activateBorder == (int)ELECTRIC_COUNT ) if( activateBorder == (int)ELECTRIC_COUNT )
@ -183,6 +194,7 @@ void CubeEffectConfig::defaults()
m_ui->cubeCapsBox->setCheckState( Qt::Checked ); m_ui->cubeCapsBox->setCheckState( Qt::Checked );
m_ui->capColorButton->setColor( KColorScheme( QPalette::Active, KColorScheme::Window ).background().color() ); m_ui->capColorButton->setColor( KColorScheme( QPalette::Active, KColorScheme::Window ).background().color() );
m_ui->capsImageBox->setCheckState( Qt::Checked ); m_ui->capsImageBox->setCheckState( Qt::Checked );
m_ui->animateDesktopChangeBox->setCheckState( Qt::Unchecked );
m_ui->editor->allDefault(); m_ui->editor->allDefault();
emit changed(true); emit changed(true);
} }

View file

@ -146,7 +146,7 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="9" column="0" > <item row="10" column="0" >
<widget class="QLabel" name="label_6" > <widget class="QLabel" name="label_6" >
<property name="text" > <property name="text" >
<string>&amp;Background Color:</string> <string>&amp;Background Color:</string>
@ -156,17 +156,17 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="9" column="1" > <item row="10" column="1" >
<widget class="KColorButton" name="backgroundColorButton" /> <widget class="KColorButton" name="backgroundColorButton" />
</item> </item>
<item row="10" column="0" > <item row="11" column="0" >
<widget class="QCheckBox" name="cubeCapsBox" > <widget class="QCheckBox" name="cubeCapsBox" >
<property name="text" > <property name="text" >
<string>Cube &amp;Caps</string> <string>Cube &amp;Caps</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="11" column="0" > <item row="12" column="0" >
<widget class="QLabel" name="capColorLabel" > <widget class="QLabel" name="capColorLabel" >
<property name="text" > <property name="text" >
<string>C&amp;ap Color:</string> <string>C&amp;ap Color:</string>
@ -176,16 +176,23 @@
</property> </property>
</widget> </widget>
</item> </item>
<item row="11" column="1" > <item row="12" column="1" >
<widget class="KColorButton" name="capColorButton" /> <widget class="KColorButton" name="capColorButton" />
</item> </item>
<item row="12" column="0" > <item row="13" column="0" >
<widget class="QCheckBox" name="capsImageBox" > <widget class="QCheckBox" name="capsImageBox" >
<property name="text" > <property name="text" >
<string>Display &amp;image on cube caps</string> <string>Display &amp;image on cube caps</string>
</property> </property>
</widget> </widget>
</item> </item>
<item row="14" column="0" >
<widget class="QCheckBox" name="animateDesktopChangeBox" >
<property name="text" >
<string>&amp;Show cube when desktop changed</string>
</property>
</widget>
</item>
</layout> </layout>
</widget> </widget>
</item> </item>