Add shade and unshade buttons
BUG: 166887 svn path=/trunk/KDE/kdebase/workspace/; revision=872210
This commit is contained in:
parent
ecfaf59014
commit
844f815ff8
4 changed files with 17 additions and 0 deletions
|
@ -143,6 +143,7 @@ bool OxygenFactory::supports( Ability ability ) const
|
||||||
case AbilityButtonAboveOthers:
|
case AbilityButtonAboveOthers:
|
||||||
case AbilityButtonBelowOthers:
|
case AbilityButtonBelowOthers:
|
||||||
case AbilityButtonSpacer:
|
case AbilityButtonSpacer:
|
||||||
|
case AbilityButtonShade:
|
||||||
return true;
|
return true;
|
||||||
// no colors supported at this time
|
// no colors supported at this time
|
||||||
default:
|
default:
|
||||||
|
|
|
@ -48,6 +48,7 @@ enum ButtonType {
|
||||||
ButtonSticky,
|
ButtonSticky,
|
||||||
ButtonAbove,
|
ButtonAbove,
|
||||||
ButtonBelow,
|
ButtonBelow,
|
||||||
|
ButtonShade,
|
||||||
ButtonTypeCount
|
ButtonTypeCount
|
||||||
};
|
};
|
||||||
Q_DECLARE_FLAGS(ButtonTypes, ButtonType)
|
Q_DECLARE_FLAGS(ButtonTypes, ButtonType)
|
||||||
|
|
|
@ -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( 7.5, 7), QPointF(10.5,10));
|
||||||
p->drawLine(QPointF(10.5,10), QPointF(13.5, 7));
|
p->drawLine(QPointF(10.5,10), QPointF(13.5, 7));
|
||||||
break;
|
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:
|
default:
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
|
@ -200,6 +200,9 @@ KCommonDecorationButton *OxygenClient::createButton(::ButtonType type)
|
||||||
case OnAllDesktopsButton:
|
case OnAllDesktopsButton:
|
||||||
return new OxygenButton(*this, i18n("On All Desktops"), ButtonSticky);
|
return new OxygenButton(*this, i18n("On All Desktops"), ButtonSticky);
|
||||||
|
|
||||||
|
case ShadeButton:
|
||||||
|
return new OxygenButton(*this, i18n("Shade Button"), ButtonShade);
|
||||||
|
|
||||||
default:
|
default:
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue