From 8c4d695907fe121533e87bf7b43a1a9a12c17607 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Gr=C3=A4=C3=9Flin?= Date: Sun, 1 Apr 2012 09:04:20 +0200 Subject: [PATCH] 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 --- effects/coverswitch/coverswitch.cpp | 18 ---- effects/coverswitch/coverswitch.h | 12 --- effects/coverswitch/coverswitch.kcfg | 9 -- effects/coverswitch/coverswitch_config.cpp | 12 --- effects/coverswitch/coverswitch_config.h | 3 - effects/coverswitch/coverswitch_config.ui | 102 +-------------------- 6 files changed, 5 insertions(+), 151 deletions(-) diff --git a/effects/coverswitch/coverswitch.cpp b/effects/coverswitch/coverswitch.cpp index 58d28f8d0b..626c05470e 100644 --- a/effects/coverswitch/coverswitch.cpp +++ b/effects/coverswitch/coverswitch.cpp @@ -38,8 +38,6 @@ along with this program. If not, see . #include -#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(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(effects->getProxy("boxswitch")); - if (proxy) - proxy->activate(mode, true, false, 0.05f); if (!stop && !stopRequested) { effects->refTabBox(); effects->setActiveFullScreenEffect(this); diff --git a/effects/coverswitch/coverswitch.h b/effects/coverswitch/coverswitch.h index 89987df66c..73ede747d9 100644 --- a/effects/coverswitch/coverswitch.h +++ b/effects/coverswitch/coverswitch.h @@ -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; diff --git a/effects/coverswitch/coverswitch.kcfg b/effects/coverswitch/coverswitch.kcfg index 17011d9643..9c2d6fd8d6 100644 --- a/effects/coverswitch/coverswitch.kcfg +++ b/effects/coverswitch/coverswitch.kcfg @@ -29,15 +29,6 @@ true - - true - - - true - - - 8 - 900 diff --git a/effects/coverswitch/coverswitch_config.cpp b/effects/coverswitch/coverswitch_config.cpp index e9f2e16414..379bc49e35 100644 --- a/effects/coverswitch/coverswitch_config.cpp +++ b/effects/coverswitch/coverswitch_config.cpp @@ -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" diff --git a/effects/coverswitch/coverswitch_config.h b/effects/coverswitch/coverswitch_config.h index 7d3d28b0bf..696e580880 100644 --- a/effects/coverswitch/coverswitch_config.h +++ b/effects/coverswitch/coverswitch_config.h @@ -45,9 +45,6 @@ public: public slots: virtual void save(); -private slots: - void thumbnailsChanged(); - private: CoverSwitchEffectConfigForm* m_ui; }; diff --git a/effects/coverswitch/coverswitch_config.ui b/effects/coverswitch/coverswitch_config.ui index 7386885d01..940c8a1739 100644 --- a/effects/coverswitch/coverswitch_config.ui +++ b/effects/coverswitch/coverswitch_config.ui @@ -172,50 +172,6 @@ - - - Thumbnail Bar - - - - - - Use additional thumbnail bar - - - - - - - Only show thumbnail bar if there are at least specified number of windows - - - Dynamic mode - - - - - - - - - Number of windows: - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - kcfg_ThumbnailWindows - - - - - - - - - - Reflections @@ -275,16 +231,16 @@ - - KIntSpinBox - QSpinBox -
knuminput.h
-
KColorButton QPushButton
kcolorbutton.h
+ + KIntSpinBox + QSpinBox +
knuminput.h
+
@@ -352,53 +308,5 @@ - - kcfg_Thumbnails - toggled(bool) - kcfg_DynamicThumbnails - setEnabled(bool) - - - 103 - 58 - - - 107 - 74 - - - - - kcfg_Thumbnails - toggled(bool) - labelThumbnailWindows - setEnabled(bool) - - - 181 - 53 - - - 259 - 106 - - - - - kcfg_Thumbnails - toggled(bool) - kcfg_ThumbnailWindows - setEnabled(bool) - - - 132 - 47 - - - 324 - 106 - - -