Bug 227685 - Pushed button icon doesn't change in Oxygen theme
Summary: Pushed button icon doesn't change in Oxygen theme
Status: RESOLVED FIXED
Alias: None
Product: Oxygen
Classification: Plasma
Component: style (show other bugs)
Version: unspecified
Platform: unspecified Linux
: NOR normal
Target Milestone: ---
Assignee: Hugo Pereira Da Costa
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-02-19 16:30 UTC by steveren
Modified: 2010-02-23 00:05 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description steveren 2010-02-19 16:30:09 UTC
Version:            (using KDE 4.4.0)
OS:                Linux
Installed from:    Unlisted Binary Package

I have written a small app in QT4 which works perfectly, but there's a visual funny which only occurs with the Oxygen theme. I have some latching buttons which should display a different icon when they're depressed or released, but the icon change isn't happening.

If I bring up my app and change the theme from the KDE system settings, the effect comes and goes on the fly! See the screen shot below. The left hand side is Oxygen, the right hand is Plastique.

http://www.tallegra.nildram.co.uk/Oxygen%20button%20problem.png

This happens with at least KDE 4.3.5 (Fedora 11/12 distro standard) and 4.4.0 direct from the kde-unstable repo.
Comment 1 Hugo Pereira Da Costa 2010-02-20 02:57:45 UTC
Interesting bug.
I guess I could write a testcase similar to yours. But if your sources are too big, could you actually post them somewhere so that I'm sure we're comparing identical things ? 
(in the meanwhile I'll give it a shot on my side)


Hugo
Comment 2 steveren 2010-02-20 09:56:13 UTC
Complete minimal QT Creator project here:

http://www.tallegra.nildram.co.uk/bugtest.tar.gz
Comment 3 Hugo Pereira Da Costa 2010-02-20 17:12:28 UTC
Thanks a lot for the pointer.
In fact since there is nothing in oxygen that plays with the button icon, I rather suspect a bug in kstyle (from which oxygen inherits, and plastique doesn't).
Looking into it.
Comment 4 Hugo Pereira Da Costa 2010-02-20 17:52:42 UTC
SVN commit 1093328 by hpereiradacosta:

Check on button state (On/Off) when chosing which icon is to be drawn in a push button.
BUG: 227685


 M  +8 -2      kstyle.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=1093328
Comment 5 steveren 2010-02-20 20:03:34 UTC
Well that was efficient :-)

I'm a bit surprised that it wasn't spotted before, though. I'm an experienced programmer, but this was quite literally the first Linux GUI app I've ever written. Am I the only person to use icons on buttons that way, or the only person who uses a kstyle-derived theme?
Comment 6 Christoph Feck 2010-02-22 23:53:50 UTC
Since Oxygen inherits from KStyle, you are certainly not the only KStyle user :) But icons usually do not have a separate "On" state, so that bug remained unnoticed.
Comment 7 Hugo Pereira Da Costa 2010-02-23 00:05:04 UTC
actually, in terms of UI design, I always had a hard time understanding checkboxes (as in your example) that use two different icons for On and Off state. Because there is redundant (and sometime misleading) information in that thing:

two different icons distinguish the two states of the button, which is already done by the visual on/off rendering (raised/or sunken).
When I press on the sunken button with the second icon, do I negate (back to off state) the state corresponding to the second icon ? Or to the first ? 
(in your case you negate the state corresponding to the first icon, which effectively correspond to checking the state of the second icon, which contradicts the fact that the button goes from sunken to raised) (does that make sense ?)

Would have been different if you had a regular button which changes icon each time you press on it ...

Anyway: just my two cents, and anyway, this was a (now fixed) bug in kstyle and oxygen.