mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 03:10:12 +02:00
* Manually lower opacity for disabled ImageButtons.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||
*
|
||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||
* Copyright 2010-2014, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
|
||||
*
|
||||
* Tomahawk is free software: you can redistribute it and/or modify
|
||||
@@ -77,6 +77,7 @@ ImageButton::clear()
|
||||
setIcon( QIcon() );
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
ImageButton::paintEvent( QPaintEvent* event )
|
||||
{
|
||||
@@ -85,14 +86,15 @@ ImageButton::paintEvent( QPaintEvent* event )
|
||||
|
||||
QIcon::Mode mode = isDown()
|
||||
? QIcon::Active
|
||||
: isEnabled()
|
||||
? QIcon::Normal
|
||||
: QIcon::Disabled;
|
||||
: QIcon::Normal;
|
||||
|
||||
QIcon::State state = isChecked()
|
||||
? QIcon::On
|
||||
: QIcon::Off;
|
||||
|
||||
if ( !isEnabled() )
|
||||
p.setOpacity( 0.4 );
|
||||
|
||||
icon().paint( &p, rect(), Qt::AlignCenter, mode, state );
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user