Sync r872210 from oxygen.

svn path=/trunk/KDE/kdebase/workspace/; revision=872701
This commit is contained in:
Luboš Luňák 2008-10-17 21:11:07 +00:00
parent 8f3441c7e2
commit 87bb545de4
4 changed files with 17 additions and 0 deletions

View file

@ -149,6 +149,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

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

View file

@ -335,6 +335,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

@ -202,6 +202,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;
}