fixed detection of pressed state for decoration's 'toggle like' buttons.

This commit is contained in:
Hugo Pereira Da Costa 2011-06-14 18:49:46 +02:00
parent 15ea44e709
commit 5194705e30

View file

@ -223,10 +223,14 @@ namespace Oxygen
// draw shadow
painter.drawPixmap( 0, 0, _helper.windecoButtonGlow( shadow, scale ) );
// draw button shape
const bool pressed( (_status == Oxygen::Pressed) ||
( isChecked() && isToggleButton() ) );
// decide on pressed state
const bool pressed(
(_status == Oxygen::Pressed) ||
( _type == ButtonSticky && _client.isOnAllDesktops() ) ||
( _type == ButtonAbove && _client.keepAbove() ) ||
( _type == ButtonBelow && _client.keepBelow() ) );
// draw button shape
painter.drawPixmap(0, 0, _helper.windecoButton( base, pressed, scale ) );
}