Add shade and unshade buttons

BUG: 166887

svn path=/trunk/KDE/kdebase/workspace/; revision=872210
This commit is contained in:
Huynh Huu Long 2008-10-16 16:13:18 +00:00
parent ecfaf59014
commit 844f815ff8
4 changed files with 17 additions and 0 deletions

View file

@ -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:

View file

@ -48,6 +48,7 @@ enum ButtonType {
ButtonSticky,
ButtonAbove,
ButtonBelow,
ButtonShade,
ButtonTypeCount
};
Q_DECLARE_FLAGS(ButtonTypes, ButtonType)

View file

@ -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;
}

View file

@ -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;
}