Commit a46f5f89 authored by Martin Flöser's avatar Martin Flöser
Browse files

Add an option to show/not hide panels. Panels are of course not included into...

Add an option to show/not hide panels. Panels are of course not included into filtering and cannot be selected. Like all other windows you can't interact with panels. Option is default off.
CCBUG: 178913

svn path=/trunk/KDE/kdebase/workspace/; revision=910398
parent b2a6be6b
......@@ -97,6 +97,7 @@ void PresentWindowsEffect::reconfigure( ReconfigureFlags )
m_accuracy = conf.readEntry( "Accuracy", 1 ) * 20;
m_fillGaps = conf.readEntry( "FillGaps", true );
m_fadeDuration = double( animationTime( 150 ));
m_showPanel = conf.readEntry( "ShowPanel", false );
}
//-----------------------------------------------------------------------------
......@@ -187,7 +188,11 @@ void PresentWindowsEffect::prePaintWindow( EffectWindow *w, WindowPrePaintData &
else
m_windowData[w].opacity = qMax( 0.0, m_windowData[w].opacity - time / m_fadeDuration );
if( m_windowData[w].opacity == 0.0 )
w->disablePainting( EffectWindow::PAINT_DISABLED );
{
// don't disable painting for panels if show panel is set
if( !w->isDock() || ( w->isDock() && !m_showPanel ))
w->disablePainting( EffectWindow::PAINT_DISABLED );
}
else if( m_windowData[w].opacity != 1.0 )
data.setTranslucent();
......@@ -207,6 +212,12 @@ void PresentWindowsEffect::paintWindow( EffectWindow *w, int mask, QRegion regio
{
if( m_activated || m_motionManager.areWindowsMoving() )
{
if( w->isDock() && m_showPanel )
{
// in case the panel should be shown just display it without any changes
effects->paintWindow( w, mask, region, data );
return;
}
// Apply opacity and brightness
data.opacity *= m_windowData[w].opacity;
data.brightness *= interpolate( 0.7, 1.0, m_windowData[w].highlight );
......@@ -525,6 +536,8 @@ void PresentWindowsEffect::rearrangeWindows()
void PresentWindowsEffect::calculateWindowTransformationsClosest( EffectWindowList windowlist, int screen )
{
QRect area = effects->clientArea( ScreenArea, screen, effects->currentDesktop() );
if( m_showPanel ) // reserve space for the panel
area = effects->clientArea( MaximizeArea, screen, effects->currentDesktop() );
int columns = int( ceil( sqrt( double( windowlist.count() ))));
int rows = int( ceil( windowlist.count() / double( columns )));
......@@ -606,6 +619,8 @@ void PresentWindowsEffect::calculateWindowTransformationsClosest( EffectWindowLi
void PresentWindowsEffect::calculateWindowTransformationsKompose( EffectWindowList windowlist, int screen )
{
QRect availRect = effects->clientArea( ScreenArea, screen, effects->currentDesktop() );
if( m_showPanel ) // reserve space for the panel
availRect = effects->clientArea( MaximizeArea, screen, effects->currentDesktop() );
qSort( windowlist ); // The location of the windows should not depend on the stacking order
// Following code is taken from Kompose 0.5.4, src/komposelayout.cpp
......@@ -768,6 +783,8 @@ void PresentWindowsEffect::calculateWindowTransformationsNatural( EffectWindowLi
qSort( windowlist );
QRect area = effects->clientArea( ScreenArea, screen, effects->currentDesktop() );
if( m_showPanel ) // reserve space for the panel
area = effects->clientArea( MaximizeArea, screen, effects->currentDesktop() );
QRect bounds = area;
int direction = 0;
QHash<EffectWindow*, QRect> targets;
......
......@@ -139,6 +139,7 @@ class PresentWindowsEffect
int m_accuracy;
bool m_fillGaps;
double m_fadeDuration;
bool m_showPanel;
// Activation
bool m_activated;
......
......@@ -71,6 +71,7 @@ PresentWindowsEffectConfig::PresentWindowsEffectConfig(QWidget* parent, const QV
connect( m_ui->displayIconBox, SIGNAL( stateChanged( int )), this, SLOT( changed() ));
connect( m_ui->switchingBox, SIGNAL( stateChanged( int )), this, SLOT( changed() ));
connect( m_ui->ignoreMinimizedBox, SIGNAL( stateChanged( int )), this, SLOT( changed() ));
connect( m_ui->showPanelBox, SIGNAL( stateChanged( int )), this, SLOT( changed() ));
connect( m_ui->accuracySlider, SIGNAL( valueChanged( int )), this, SLOT( changed() ));
connect( m_ui->fillGapsBox, SIGNAL( stateChanged( int )), this, SLOT( changed() ));
connect( m_ui->shortcutEditor, SIGNAL( keyChange() ), this, SLOT( changed() ));
......@@ -107,6 +108,9 @@ void PresentWindowsEffectConfig::load()
bool ignoreMinimized = conf.readEntry( "IgnoreMinimized", false );
m_ui->ignoreMinimizedBox->setChecked( ignoreMinimized );
bool showPanel = conf.readEntry( "ShowPanel", false );
m_ui->showPanelBox->setChecked( showPanel );
int accuracy = conf.readEntry( "Accuracy", 1 );
m_ui->accuracySlider->setSliderPosition( accuracy );
......@@ -131,6 +135,7 @@ void PresentWindowsEffectConfig::save()
conf.writeEntry( "DrawWindowIcons", m_ui->displayIconBox->isChecked() );
conf.writeEntry( "TabBox", m_ui->switchingBox->isChecked() );
conf.writeEntry( "IgnoreMinimized", m_ui->ignoreMinimizedBox->isChecked() );
conf.writeEntry( "ShowPanel", m_ui->showPanelBox->isChecked() );
int accuracy = m_ui->accuracySlider->value();
conf.writeEntry( "Accuracy", accuracy );
......@@ -153,6 +158,7 @@ void PresentWindowsEffectConfig::defaults()
m_ui->displayIconBox->setChecked( true );
m_ui->switchingBox->setChecked( false );
m_ui->ignoreMinimizedBox->setChecked( false );
m_ui->showPanelBox->setChecked( false );
m_ui->accuracySlider->setSliderPosition( 1 );
m_ui->fillGapsBox->setChecked( true );
m_ui->shortcutEditor->allDefault();
......
......@@ -5,7 +5,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>533</width>
<width>535</width>
<height>345</height>
</rect>
</property>
......@@ -38,7 +38,7 @@
</sizepolicy>
</property>
<property name="specialValueText" >
<string comment="Duration of rearrangement">Default</string>
<string comment="Duration of rearrangement" >Default</string>
</property>
<property name="suffix" >
<string> msec</string>
......@@ -120,6 +120,13 @@
</property>
</widget>
</item>
<item row="6" column="0" colspan="2" >
<widget class="QCheckBox" name="showPanelBox" >
<property name="text" >
<string>Show &amp;panels</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment