Cube/Cylinder/Sphere can be used for "walk through desktop" functionality. This new mode has to be enabled in the settings. Default is off. Mouse functionality is disabled in this tab box mode.

CCBUG: 169888

svn path=/trunk/KDE/kdebase/workspace/; revision=854275
This commit is contained in:
Martin Gräßlin 2008-08-29 09:22:36 +00:00
parent 19a9dd4095
commit 95c30f158f
8 changed files with 99 additions and 0 deletions

View file

@ -76,6 +76,8 @@ CubeEffect::CubeEffect()
, closeOnMouseRelease( false )
, zoom( 0.0 )
, zPosition( 0.0 )
, useForTabBox( false )
, tabBoxMode( false )
, capListCreated( false )
, capList( 0 )
{
@ -105,6 +107,7 @@ void CubeEffect::loadConfig( QString config )
paintCaps = conf.readEntry( "Caps", true );
closeOnMouseRelease = conf.readEntry( "CloseOnMouseRelease", false );
zPosition = conf.readEntry( "ZPosition", 100.0 );
useForTabBox = conf.readEntry( "TabBox", false );
QString file = conf.readEntry( "Wallpaper", QString("") );
if( !file.isEmpty() )
{
@ -1554,6 +1557,8 @@ void CubeEffect::mouseChanged( const QPoint& pos, const QPoint& oldpos, Qt::Mous
{
if( !activated )
return;
if( tabBoxMode )
return;
if( stop || slide )
return;
QRect rect = effects->clientArea( FullScreenArea, activeScreen, effects->currentDesktop());
@ -1618,4 +1623,36 @@ void CubeEffect::desktopChanged( int old )
setActive( false );
}
void CubeEffect::tabBoxAdded( int mode )
{
if( activated )
return;
if( effects->activeFullScreenEffect() && effects->activeFullScreenEffect() != this )
return;
if( useForTabBox && mode != TabBoxWindowsMode )
{
effects->refTabBox();
tabBoxMode = true;
setActive( true );
rotateToDesktop( effects->currentTabBoxDesktop() );
}
}
void CubeEffect::tabBoxUpdated()
{
if( activated )
rotateToDesktop( effects->currentTabBoxDesktop() );
}
void CubeEffect::tabBoxClosed()
{
if( activated )
{
effects->unrefTabBox();
tabBoxMode = false;
setActive( false );
}
}
} // namespace

View file

@ -46,6 +46,9 @@ class CubeEffect
virtual void mouseChanged( const QPoint& pos, const QPoint& oldpos, Qt::MouseButtons buttons,
Qt::MouseButtons oldbuttons, Qt::KeyboardModifiers modifiers, Qt::KeyboardModifiers oldmodifiers );
virtual void desktopChanged( int old );
virtual void tabBoxAdded( int mode );
virtual void tabBoxUpdated();
virtual void tabBoxClosed();
protected slots:
void toggle();
protected:
@ -112,6 +115,8 @@ class CubeEffect
bool closeOnMouseRelease;
float zoom;
float zPosition;
bool useForTabBox;
bool tabBoxMode;
// GL lists
bool capListCreated;

View file

@ -92,6 +92,7 @@ CubeEffectConfig::CubeEffectConfig(QWidget* parent, const QVariantList& args) :
connect(m_ui->wallpaperRequester, SIGNAL(textChanged(QString)), this, SLOT(changed()));
connect(m_ui->closeOnMouseReleaseBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->zPositionSlider, SIGNAL(valueChanged(int)), this, SLOT(changed()));
connect(m_ui->walkThroughDesktopBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
load();
}
@ -114,6 +115,7 @@ void CubeEffectConfig::load()
bool animateChange = conf.readEntry( "AnimateDesktopChange", false );
bool bigCube = conf.readEntry( "BigCube", false );
bool closeOnMouseRelease = conf.readEntry( "CloseOnMouseRelease", false );
bool walkThroughDesktop = conf.readEntry( "TabBox", false );
m_ui->zPositionSlider->setValue( conf.readEntry( "ZPosition", 100 ) );
m_ui->wallpaperRequester->setPath( conf.readEntry( "Wallpaper", "" ) );
if( activateBorder == (int)ElectricNone )
@ -179,6 +181,14 @@ void CubeEffectConfig::load()
{
m_ui->closeOnMouseReleaseBox->setCheckState( Qt::Unchecked );
}
if( walkThroughDesktop )
{
m_ui->walkThroughDesktopBox->setCheckState( Qt::Checked );
}
else
{
m_ui->walkThroughDesktopBox->setCheckState( Qt::Unchecked );
}
m_ui->backgroundColorButton->setColor( background );
m_ui->capColorButton->setColor( capColor );
capsSelectionChanged();
@ -203,6 +213,7 @@ void CubeEffectConfig::save()
conf.writeEntry( "CloseOnMouseRelease", m_ui->closeOnMouseReleaseBox->checkState() == Qt::Checked ? true : false );
conf.writeEntry( "Wallpaper", m_ui->wallpaperRequester->url().path() );
conf.writeEntry( "ZPosition", m_ui->zPositionSlider->value() );
conf.writeEntry( "TabBox", m_ui->walkThroughDesktopBox->checkState() == Qt::Checked ? true : false );
int activateBorder = m_ui->screenEdgeCombo->currentIndex();
if( activateBorder == (int)ELECTRIC_COUNT )
@ -234,6 +245,7 @@ void CubeEffectConfig::defaults()
m_ui->closeOnMouseReleaseBox->setCheckState( Qt::Unchecked );
m_ui->wallpaperRequester->setPath( "" );
m_ui->zPositionSlider->setValue( 100 );
m_ui->walkThroughDesktopBox->setCheckState( Qt::Unchecked );
m_ui->editor->allDefault();
emit changed(true);
}

View file

@ -405,6 +405,13 @@ Otherwise cube will stay in the position.</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="walkThroughDesktopBox" >
<property name="text" >
<string>Use for walk through desktop list</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View file

@ -88,6 +88,7 @@ CylinderEffectConfig::CylinderEffectConfig(QWidget* parent, const QVariantList&
connect(m_ui->wallpaperRequester, SIGNAL(textChanged(QString)), this, SLOT(changed()));
connect(m_ui->closeOnMouseReleaseBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->zPositionSlider, SIGNAL(valueChanged(int)), this, SLOT(changed()));
connect(m_ui->walkThroughDesktopBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
load();
}
@ -108,6 +109,7 @@ void CylinderEffectConfig::load()
bool texturedCaps = conf.readEntry( "TexturedCaps", true );
bool caps = conf.readEntry( "Caps", true );
bool closeOnMouseRelease = conf.readEntry( "CloseOnMouseRelease", false );
bool walkThroughDesktop = conf.readEntry( "TabBox", false );
m_ui->zPositionSlider->setValue( conf.readEntry( "ZPosition", 100 ) );
m_ui->wallpaperRequester->setPath( conf.readEntry( "Wallpaper", "" ) );
if( activateBorder == (int)ElectricNone )
@ -157,6 +159,14 @@ void CylinderEffectConfig::load()
{
m_ui->closeOnMouseReleaseBox->setCheckState( Qt::Unchecked );
}
if( walkThroughDesktop )
{
m_ui->walkThroughDesktopBox->setCheckState( Qt::Checked );
}
else
{
m_ui->walkThroughDesktopBox->setCheckState( Qt::Unchecked );
}
m_ui->backgroundColorButton->setColor( background );
m_ui->capColorButton->setColor( capColor );
capsSelectionChanged();
@ -179,6 +189,7 @@ void CylinderEffectConfig::save()
conf.writeEntry( "CloseOnMouseRelease", m_ui->closeOnMouseReleaseBox->checkState() == Qt::Checked ? true : false );
conf.writeEntry( "Wallpaper", m_ui->wallpaperRequester->url().path() );
conf.writeEntry( "ZPosition", m_ui->zPositionSlider->value() );
conf.writeEntry( "TabBox", m_ui->walkThroughDesktopBox->checkState() == Qt::Checked ? true : false );
int activateBorder = m_ui->screenEdgeCombo->currentIndex();
if( activateBorder == (int)ELECTRIC_COUNT )
@ -208,6 +219,7 @@ void CylinderEffectConfig::defaults()
m_ui->closeOnMouseReleaseBox->setCheckState( Qt::Unchecked );
m_ui->wallpaperRequester->setPath( "" );
m_ui->zPositionSlider->setValue( 100 );
m_ui->walkThroughDesktopBox->setCheckState( Qt::Unchecked );
m_ui->editor->allDefault();
emit changed(true);
}

View file

@ -384,6 +384,13 @@ Otherwise cylinder will stay in the position.</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="walkThroughDesktopBox" >
<property name="text" >
<string>Use for walk through desktop list</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>

View file

@ -88,6 +88,7 @@ SphereEffectConfig::SphereEffectConfig(QWidget* parent, const QVariantList& args
connect(m_ui->closeOnMouseReleaseBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->zPositionSlider, SIGNAL(valueChanged(int)), this, SLOT(changed()));
connect(m_ui->capDeformationSlider, SIGNAL(valueChanged(int)), this, SLOT(changed()));
connect(m_ui->walkThroughDesktopBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
load();
}
@ -107,6 +108,7 @@ void SphereEffectConfig::load()
bool texturedCaps = conf.readEntry( "TexturedCaps", true );
bool caps = conf.readEntry( "Caps", true );
bool closeOnMouseRelease = conf.readEntry( "CloseOnMouseRelease", false );
bool walkThroughDesktop = conf.readEntry( "TabBox", false );
m_ui->zPositionSlider->setValue( conf.readEntry( "ZPosition", 450 ) );
m_ui->capDeformationSlider->setValue( conf.readEntry( "CapDeformation", 0 ) );
m_ui->wallpaperRequester->setPath( conf.readEntry( "Wallpaper", "" ) );
@ -149,6 +151,14 @@ void SphereEffectConfig::load()
{
m_ui->closeOnMouseReleaseBox->setCheckState( Qt::Unchecked );
}
if( walkThroughDesktop )
{
m_ui->walkThroughDesktopBox->setCheckState( Qt::Checked );
}
else
{
m_ui->walkThroughDesktopBox->setCheckState( Qt::Unchecked );
}
m_ui->backgroundColorButton->setColor( background );
m_ui->capColorButton->setColor( capColor );
capsSelectionChanged();
@ -171,6 +181,7 @@ void SphereEffectConfig::save()
conf.writeEntry( "Wallpaper", m_ui->wallpaperRequester->url().path() );
conf.writeEntry( "ZPosition", m_ui->zPositionSlider->value() );
conf.writeEntry( "CapDeformation", m_ui->capDeformationSlider->value() );
conf.writeEntry( "TabBox", m_ui->walkThroughDesktopBox->checkState() == Qt::Checked ? true : false );
int activateBorder = m_ui->screenEdgeCombo->currentIndex();
if( activateBorder == (int)ELECTRIC_COUNT )
@ -200,6 +211,7 @@ void SphereEffectConfig::defaults()
m_ui->wallpaperRequester->setPath( "" );
m_ui->zPositionSlider->setValue( 450 );
m_ui->capDeformationSlider->setValue( 0 );
m_ui->walkThroughDesktopBox->setCheckState( Qt::Unchecked );
m_ui->editor->allDefault();
emit changed(true);
}

View file

@ -447,6 +447,13 @@ Otherwise sphere will stay in the position.</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="walkThroughDesktopBox" >
<property name="text" >
<string>Use for walk through desktop list</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>