Make cylinder and sphere work with multi screen setup. Span on all screens is only option as scaling on one screen results in abstract art. So the option is removed from config dialog.

svn path=/trunk/KDE/kdebase/workspace/; revision=852200
This commit is contained in:
Martin Gräßlin 2008-08-25 14:12:12 +00:00
parent 255889ca65
commit 64dc9b1be6
6 changed files with 9 additions and 43 deletions

View file

@ -43,6 +43,7 @@ CylinderEffect::CylinderEffect()
wallpaper->discard();
loadConfig( "Cylinder" );
animateDesktopChange = false;
bigCube = true;
}
CylinderEffect::~CylinderEffect()
@ -80,6 +81,8 @@ bool CylinderEffect::loadData()
mShader->setUniform( "winTexture", 0 );
mShader->setUniform( "opacity", cubeOpacity );
QRect rect = effects->clientArea( FullScreenArea, activeScreen, effects->currentDesktop());
if( effects->numScreens() > 1 && (slide || bigCube ) )
rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
mShader->setUniform( "width", (float)rect.width() );
mShader->unbind();
}
@ -89,7 +92,7 @@ bool CylinderEffect::loadData()
void CylinderEffect::paintScene( int mask, QRegion region, ScreenPaintData& data )
{
glPushMatrix();
QRect rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
QRect rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop());
float cubeAngle = (effects->numberOfDesktops() - 2 )/(float)effects->numberOfDesktops() * 180.0f;
float radian = (cubeAngle*0.5)*M_PI/180;

View file

@ -81,7 +81,6 @@ CylinderEffectConfig::CylinderEffectConfig(QWidget* parent, const QVariantList&
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->bigCubeBox, 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()));
@ -108,7 +107,6 @@ void CylinderEffectConfig::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 bigCube = conf.readEntry( "BigCube", false );
bool closeOnMouseRelease = conf.readEntry( "CloseOnMouseRelease", false );
m_ui->zPositionSlider->setValue( conf.readEntry( "ZPosition", 100 ) );
m_ui->wallpaperLineEdit->setText( conf.readEntry( "Wallpaper", "" ) );
@ -151,14 +149,6 @@ void CylinderEffectConfig::load()
{
m_ui->capsImageBox->setCheckState( Qt::Unchecked );
}
if( bigCube )
{
m_ui->bigCubeBox->setCheckState( Qt::Checked );
}
else
{
m_ui->bigCubeBox->setCheckState( Qt::Unchecked );
}
if( closeOnMouseRelease )
{
m_ui->closeOnMouseReleaseBox->setCheckState( Qt::Checked );
@ -186,7 +176,6 @@ void CylinderEffectConfig::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( "BigCube", m_ui->bigCubeBox->checkState() == Qt::Checked ? true : false );
conf.writeEntry( "CloseOnMouseRelease", m_ui->closeOnMouseReleaseBox->checkState() == Qt::Checked ? true : false );
conf.writeEntry( "Wallpaper", m_ui->wallpaperLineEdit->text() );
conf.writeEntry( "ZPosition", m_ui->zPositionSlider->value() );
@ -216,7 +205,6 @@ void CylinderEffectConfig::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->bigCubeBox->setCheckState( Qt::Unchecked );
m_ui->closeOnMouseReleaseBox->setCheckState( Qt::Unchecked );
m_ui->wallpaperLineEdit->setText( "" );
m_ui->zPositionSlider->setValue( 100 );

View file

@ -176,13 +176,6 @@
</property>
</widget>
</item>
<item row="16" column="0" >
<widget class="QCheckBox" name="bigCubeBox" >
<property name="text" >
<string>S&amp;pan cube on all screens</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
@ -217,7 +210,7 @@
</item>
</layout>
</item>
<item row="17" column="0" >
<item row="16" column="0" >
<widget class="QCheckBox" name="closeOnMouseReleaseBox" >
<property name="text" >
<string>Close after mouse dra&amp;gging</string>
@ -323,7 +316,6 @@
<tabstop>cubeCapsBox</tabstop>
<tabstop>capColorButton</tabstop>
<tabstop>capsImageBox</tabstop>
<tabstop>bigCubeBox</tabstop>
</tabstops>
<resources/>
<connections>

View file

@ -47,6 +47,7 @@ SphereEffect::SphereEffect()
animateDesktopChange = false;
KConfigGroup conf = effects->effectConfig( "Sphere" );
zPosition = conf.readEntry( "ZPosition", 450.0 );
bigCube = true;
}
SphereEffect::~SphereEffect()
@ -84,6 +85,8 @@ bool SphereEffect::loadData()
mShader->setUniform( "winTexture", 0 );
mShader->setUniform( "opacity", cubeOpacity );
QRect rect = effects->clientArea( FullScreenArea, activeScreen, effects->currentDesktop());
if( effects->numScreens() > 1 && (slide || bigCube ) )
rect = effects->clientArea( FullArea, activeScreen, effects->currentDesktop() );
mShader->setUniform( "width", (float)rect.width() );
mShader->setUniform( "height", (float)rect.height() );
mShader->unbind();

View file

@ -80,7 +80,6 @@ SphereEffectConfig::SphereEffectConfig(QWidget* parent, const QVariantList& args
connect(m_ui->cubeOpacitySpin, SIGNAL(valueChanged(int)), this, SLOT(changed()));
connect(m_ui->displayDesktopNameBox, SIGNAL(stateChanged(int)), this, SLOT(changed()));
connect(m_ui->backgroundColorButton, SIGNAL(changed(QColor)), this, SLOT(changed()));
connect(m_ui->bigCubeBox, 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()));
@ -106,7 +105,6 @@ void SphereEffectConfig::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 bigCube = conf.readEntry( "BigCube", false );
bool closeOnMouseRelease = conf.readEntry( "CloseOnMouseRelease", false );
m_ui->zPositionSlider->setValue( conf.readEntry( "ZPosition", 450 ) );
m_ui->wallpaperLineEdit->setText( conf.readEntry( "Wallpaper", "" ) );
@ -141,14 +139,6 @@ void SphereEffectConfig::load()
{
m_ui->capsImageBox->setCheckState( Qt::Unchecked );
}
if( bigCube )
{
m_ui->bigCubeBox->setCheckState( Qt::Checked );
}
else
{
m_ui->bigCubeBox->setCheckState( Qt::Unchecked );
}
if( closeOnMouseRelease )
{
m_ui->closeOnMouseReleaseBox->setCheckState( Qt::Checked );
@ -175,7 +165,6 @@ void SphereEffectConfig::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( "BigCube", m_ui->bigCubeBox->checkState() == Qt::Checked ? true : false );
conf.writeEntry( "CloseOnMouseRelease", m_ui->closeOnMouseReleaseBox->checkState() == Qt::Checked ? true : false );
conf.writeEntry( "Wallpaper", m_ui->wallpaperLineEdit->text() );
conf.writeEntry( "ZPosition", m_ui->zPositionSlider->value() );
@ -204,7 +193,6 @@ void SphereEffectConfig::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->bigCubeBox->setCheckState( Qt::Unchecked );
m_ui->closeOnMouseReleaseBox->setCheckState( Qt::Unchecked );
m_ui->wallpaperLineEdit->setText( "" );
m_ui->zPositionSlider->setValue( 450 );

View file

@ -169,13 +169,6 @@
</property>
</widget>
</item>
<item row="15" column="0" >
<widget class="QCheckBox" name="bigCubeBox" >
<property name="text" >
<string>S&amp;pan cube on all screens</string>
</property>
</widget>
</item>
<item row="1" column="0" >
<widget class="QLabel" name="label_2" >
<property name="text" >
@ -210,7 +203,7 @@
</item>
</layout>
</item>
<item row="16" column="0" >
<item row="15" column="0" >
<widget class="QCheckBox" name="closeOnMouseReleaseBox" >
<property name="text" >
<string>Close after mouse dra&amp;gging</string>
@ -315,7 +308,6 @@
<tabstop>cubeCapsBox</tabstop>
<tabstop>capColorButton</tabstop>
<tabstop>capsImageBox</tabstop>
<tabstop>bigCubeBox</tabstop>
</tabstops>
<resources/>
<connections>