Remove thumbnail bar from CoverSwitch Effect

The usage has always been questionable as the thumbnails are
too small to properly recognize something.

Now BoxSwitch Effect has reach its end of life which would have
required to keep most of the code just for this thumbnail bar.

If required it would be better to integrate the normal QML based
TabBox to be rendered together with an effect.

BUG: 296070
FIXED-IN: 4.11.0
This commit is contained in:
Martin Gräßlin 2012-04-01 09:04:20 +02:00
parent 5046345da0
commit 8c4d695907
6 changed files with 5 additions and 151 deletions

View file

@ -38,8 +38,6 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
#include <kdebug.h>
#include "../boxswitch/boxswitch_proxy.h"
namespace KWin
{
@ -98,9 +96,6 @@ void CoverSwitchEffect::reconfigure(ReconfigureFlags)
reflection = CoverSwitchConfig::reflection();
windowTitle = CoverSwitchConfig::windowTitle();
zPosition = CoverSwitchConfig::zPosition();
thumbnails = CoverSwitchConfig::thumbnails();
dynamicThumbnails = CoverSwitchConfig::dynamicThumbnails();
thumbnailWindows = CoverSwitchConfig::thumbnailWindows();
timeLine.setCurveShape(QTimeLine::EaseInOutCurve);
timeLine.setDuration(animationDuration);
@ -393,15 +388,6 @@ void CoverSwitchEffect::paintScreen(int mask, QRegion region, ScreenPaintData& d
captionFrame->setCrossFadeProgress(timeLine.currentValue());
captionFrame->render(region, opacity);
}
if ((thumbnails && (!dynamicThumbnails ||
(dynamicThumbnails && currentWindowList.size() >= thumbnailWindows)))
&& !(start || stop)) {
BoxSwitchEffectProxy *proxy =
static_cast<BoxSwitchEffectProxy*>(effects->getProxy("boxswitch"));
if (proxy)
proxy->paintWindowsBox(region);
}
}
}
@ -543,10 +529,6 @@ void CoverSwitchEffect::slotTabBoxAdded(int mode)
&& effects->currentTabBoxWindowList().count() > 0) {
input = effects->createFullScreenInputWindow(this, Qt::ArrowCursor);
activeScreen = effects->activeScreen();
BoxSwitchEffectProxy *proxy =
static_cast<BoxSwitchEffectProxy*>(effects->getProxy("boxswitch"));
if (proxy)
proxy->activate(mode, true, false, 0.05f);
if (!stop && !stopRequested) {
effects->refTabBox();
effects->setActiveFullScreenEffect(this);

View file

@ -45,8 +45,6 @@ class CoverSwitchEffect
Q_PROPERTY(bool reflection READ isReflection)
Q_PROPERTY(bool windowTitle READ isWindowTitle)
Q_PROPERTY(qreal zPosition READ windowZPosition)
Q_PROPERTY(bool dynamicThumbnails READ isDynamicThumbnails)
Q_PROPERTY(int thumbnailWindows READ configurredThumbnailWindows)
Q_PROPERTY(bool primaryTabBox READ isPrimaryTabBox)
Q_PROPERTY(bool secondaryTabBox READ isSecondaryTabBox)
// TODO: mirror colors
@ -86,12 +84,6 @@ public:
qreal windowZPosition() const {
return zPosition;
}
bool isDynamicThumbnails() const {
return dynamicThumbnails;
}
int configurredThumbnailWindows() const {
return thumbnailWindows;
}
bool isPrimaryTabBox() const {
return primaryTabBox;
}
@ -158,10 +150,6 @@ private:
EffectFrame* captionFrame;
QFont captionFont;
bool thumbnails;
bool dynamicThumbnails;
int thumbnailWindows;
bool primaryTabBox;
bool secondaryTabBox;

View file

@ -29,15 +29,6 @@
<entry name="WindowTitle" type="Bool">
<default>true</default>
</entry>
<entry name="Thumbnails" type="Bool">
<default>true</default>
</entry>
<entry name="DynamicThumbnails" type="Bool">
<default>true</default>
</entry>
<entry name="ThumbnailWindows" type="UInt">
<default>8</default>
</entry>
<entry name="zPosition" type="UInt">
<default>900</default>
</entry>

View file

@ -44,9 +44,6 @@ CoverSwitchEffectConfig::CoverSwitchEffectConfig(QWidget* parent, const QVariant
layout->addWidget(m_ui);
connect(m_ui->kcfg_Thumbnails, SIGNAL(stateChanged(int)), this, SLOT(thumbnailsChanged()));
connect(m_ui->kcfg_DynamicThumbnails, SIGNAL(stateChanged(int)), this, SLOT(thumbnailsChanged()));
addConfig(CoverSwitchConfig::self(), m_ui);
}
@ -56,15 +53,6 @@ void CoverSwitchEffectConfig::save()
EffectsHandler::sendReloadMessage("coverswitch");
}
void CoverSwitchEffectConfig::thumbnailsChanged()
{
bool enabled = m_ui->kcfg_Thumbnails->isChecked() && m_ui->kcfg_DynamicThumbnails->isChecked();
m_ui->kcfg_DynamicThumbnails->setEnabled(m_ui->kcfg_Thumbnails->isChecked());
m_ui->kcfg_ThumbnailWindows->setEnabled(enabled);
m_ui->labelThumbnailWindows->setEnabled(enabled);
}
} // namespace
#include "coverswitch_config.moc"

View file

@ -45,9 +45,6 @@ public:
public slots:
virtual void save();
private slots:
void thumbnailsChanged();
private:
CoverSwitchEffectConfigForm* m_ui;
};

View file

@ -172,50 +172,6 @@
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Thumbnail Bar</string>
</attribute>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="kcfg_Thumbnails">
<property name="text">
<string>Use additional thumbnail bar</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="kcfg_DynamicThumbnails">
<property name="toolTip">
<string>Only show thumbnail bar if there are at least specified number of windows</string>
</property>
<property name="text">
<string>Dynamic mode</string>
</property>
</widget>
</item>
<item>
<layout class="QFormLayout" name="formLayout">
<item row="0" column="0">
<widget class="QLabel" name="labelThumbnailWindows">
<property name="text">
<string>Number of windows:</string>
</property>
<property name="alignment">
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
</property>
<property name="buddy">
<cstring>kcfg_ThumbnailWindows</cstring>
</property>
</widget>
</item>
<item row="0" column="1">
<widget class="KIntSpinBox" name="kcfg_ThumbnailWindows"/>
</item>
</layout>
</item>
</layout>
</widget>
<widget class="QWidget" name="tab_3">
<attribute name="title">
<string>Reflections</string>
@ -275,16 +231,16 @@
</layout>
</widget>
<customwidgets>
<customwidget>
<class>KIntSpinBox</class>
<extends>QSpinBox</extends>
<header>knuminput.h</header>
</customwidget>
<customwidget>
<class>KColorButton</class>
<extends>QPushButton</extends>
<header>kcolorbutton.h</header>
</customwidget>
<customwidget>
<class>KIntSpinBox</class>
<extends>QSpinBox</extends>
<header>knuminput.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections>
@ -352,53 +308,5 @@
</hint>
</hints>
</connection>
<connection>
<sender>kcfg_Thumbnails</sender>
<signal>toggled(bool)</signal>
<receiver>kcfg_DynamicThumbnails</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>103</x>
<y>58</y>
</hint>
<hint type="destinationlabel">
<x>107</x>
<y>74</y>
</hint>
</hints>
</connection>
<connection>
<sender>kcfg_Thumbnails</sender>
<signal>toggled(bool)</signal>
<receiver>labelThumbnailWindows</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>181</x>
<y>53</y>
</hint>
<hint type="destinationlabel">
<x>259</x>
<y>106</y>
</hint>
</hints>
</connection>
<connection>
<sender>kcfg_Thumbnails</sender>
<signal>toggled(bool)</signal>
<receiver>kcfg_ThumbnailWindows</receiver>
<slot>setEnabled(bool)</slot>
<hints>
<hint type="sourcelabel">
<x>132</x>
<y>47</y>
</hint>
<hint type="destinationlabel">
<x>324</x>
<y>106</y>
</hint>
</hints>
</connection>
</connections>
</ui>