From 844f815ff8fdb3d49ecbf38b6ce61e25456ca163 Mon Sep 17 00:00:00 2001 From: Huynh Huu Long Date: Thu, 16 Oct 2008 16:13:18 +0000 Subject: [PATCH] Add shade and unshade buttons BUG: 166887 svn path=/trunk/KDE/kdebase/workspace/; revision=872210 --- clients/oxygen/oxygen.cpp | 1 + clients/oxygen/oxygen.h | 1 + clients/oxygen/oxygenbutton.cpp | 12 ++++++++++++ clients/oxygen/oxygenclient.cpp | 3 +++ 4 files changed, 17 insertions(+) diff --git a/clients/oxygen/oxygen.cpp b/clients/oxygen/oxygen.cpp index 0c2929267d..907443d744 100644 --- a/clients/oxygen/oxygen.cpp +++ b/clients/oxygen/oxygen.cpp @@ -143,6 +143,7 @@ bool OxygenFactory::supports( Ability ability ) const case AbilityButtonAboveOthers: case AbilityButtonBelowOthers: case AbilityButtonSpacer: + case AbilityButtonShade: return true; // no colors supported at this time default: diff --git a/clients/oxygen/oxygen.h b/clients/oxygen/oxygen.h index 2abc537096..2d4f98b1ee 100644 --- a/clients/oxygen/oxygen.h +++ b/clients/oxygen/oxygen.h @@ -48,6 +48,7 @@ enum ButtonType { ButtonSticky, ButtonAbove, ButtonBelow, + ButtonShade, ButtonTypeCount }; Q_DECLARE_FLAGS(ButtonTypes, ButtonType) diff --git a/clients/oxygen/oxygenbutton.cpp b/clients/oxygen/oxygenbutton.cpp index ad556881b9..5f53d0f17c 100644 --- a/clients/oxygen/oxygenbutton.cpp +++ b/clients/oxygen/oxygenbutton.cpp @@ -323,6 +323,18 @@ void OxygenButton::drawIcon(QPainter *p, QPalette &pal, ButtonType &type) p->drawLine(QPointF( 7.5, 7), QPointF(10.5,10)); p->drawLine(QPointF(10.5,10), QPointF(13.5, 7)); break; + case ButtonShade: + if (!isChecked()) // shade button + { + p->drawLine(QPointF( 7.5, 7.5), QPointF(10.5,10.5)); + p->drawLine(QPointF(10.5,10.5), QPointF(13.5, 7.5)); + p->drawLine(QPointF( 7.5,13.0), QPointF(13.5,13.0)); + } else { // unshade button + p->drawLine(QPointF( 7.5,10.5), QPointF(10.5, 7.5)); + p->drawLine(QPointF(10.5, 7.5), QPointF(13.5,10.5)); + p->drawLine(QPointF( 7.5,13.0), QPointF(13.5,13.0)); + } + break; default: break; } diff --git a/clients/oxygen/oxygenclient.cpp b/clients/oxygen/oxygenclient.cpp index f8995689be..5db1bf270f 100644 --- a/clients/oxygen/oxygenclient.cpp +++ b/clients/oxygen/oxygenclient.cpp @@ -200,6 +200,9 @@ KCommonDecorationButton *OxygenClient::createButton(::ButtonType type) case OnAllDesktopsButton: return new OxygenButton(*this, i18n("On All Desktops"), ButtonSticky); + case ShadeButton: + return new OxygenButton(*this, i18n("Shade Button"), ButtonShade); + default: return 0; }