By default, Bugzilla does not search the list of RESOLVED bugs.
You can force it to do so by putting the upper-case word ALL in front of your search query, e.g.: ALL tdelibs
We recommend searching for bugs this way, as you may discover that your bug has already been resolved and fixed in a later release.
Bug 1857 - TQPushbutton does not refresh/display icons correctly
Summary: TQPushbutton does not refresh/display icons correctly
Status: RESOLVED FIXED
Alias: None
Product: TDE
Classification: Unclassified
Component: tdebase (show other bugs)
Version: R14.0.0 [Trinity]
Hardware: All Linux
: P5 major
Assignee: Timothy Pearson
URL:
Depends on:
Blocks: 2014
  Show dependency treegraph
 
Reported: 2014-01-23 08:35 CST by Michele Calgaro
Modified: 2014-10-03 21:06 CDT (History)
4 users (show)

See Also:
Compiler Version:
TDE Version String:
Application Version:
Application Name:


Attachments
icon bug screenshot (attachment corrupted) (39.89 KB, image/png)
2014-02-23 23:59 CST, Michele Calgaro
Details
icon position snapshot (11.51 KB, image/png)
2014-03-02 22:13 CST, Michele Calgaro
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Michele Calgaro 2014-01-23 08:35:10 CST
To replicate this problem:

1) make sure you are using the tab bar extension plugin

2) open a file in Kate. Make sure the document list is also visible

3) modify the file. Notice the small floppy disk icon on the left of the file name in both the document list and the tab bar button

4) save the file. Notice the small floppy disk icon disappear in the document list but is still there in the tab bar button

I am using the QtCurve widget style. I don't remember if this was happening when I used Plastik. 
If you are using a different widget style, please help confirming this bug.
Comment 1 Darrell 2014-01-23 13:02:43 CST
Confirmed on Slackware. I'm using the KDE Classic widget style. Same result with Plastik and Keramik.
Comment 2 Michele Calgaro 2014-01-24 00:20:29 CST
Thanks Darrell.
Comment 3 Michele Calgaro 2014-02-18 07:29:51 CST
I am slowly working on this bug (busy time :( )

The problem has nothing to do with the Kate's tabbarextension itself.
Instead it is related to how the qtcurve style draws a pushbutton. When an iconset is added to the PB, the icon is displayed, but when the iconset is removed (set to null by setting it to TQIconSet()), the icon is not deleted correctly, even though TQPushButton::iconSet() returns NULL. A small change in the PB width can be noticed though, with a little bit of empty space added/removed to the left of the icon.
I proved the problem with a modified version of TQPushButton and a sample application. Next step is to find where the bug is in QtCurveStyle::drawControl().

Darrell already confirmed the same bug in Plastik and also Keramik, and as a comment in the QtCurveStyle::drawControl()->CE_PushButtonLabel case says, the code was taken from Plastik and Highcolor, so probably Highcolor is affected too.

Once I found a solution, we will have to test all available styles to see which ones need to be fixed.
Comment 4 Darrell 2014-02-18 12:37:45 CST
Another Trinity user contacted me about icons displaying similar characteristics in the system tray. I have a feeling the root cause is the same.
Comment 5 Michele Calgaro 2014-02-19 08:21:39 CST
Darrell, I have a little favor to ask you.
Using some old packages that you may have (older than October 2013 and if possible also one from early December 2013), could you please test if this problem was showing up? Just use the same steps described in my original bug report (if possible use qtcurve, but Plastik would do as well).

I have managed to come up with a working patch, but I need more time to investigate if the patch is the correct way to fix the problem or just a sloppy work around, before I post it.

I have reasons to believe that the problem *may* have been introduced by changes made to the TQStyleControlElementData in late December 2013, that's why I asking your help to confirm/deny that.
Comment 6 Darrell 2014-02-19 08:59:16 CST
>TQStyleControlElementData in late December 2013
I would not be surprised. There were some other side effects of those changes, although I don't remember the bug reports or related patches.

I have not had time to find R14 package sets, but the save icon works fine in 3.5.13.2, regardless of which style I chose.
Comment 7 Darrell 2014-02-19 10:53:17 CST
>Using some old packages that you may have
This is the closest I can isolate the failure:

Package set from Dec. 17, 2013: The icon works as expected.
Package set from Dec. 26, 2013: The icon fails to disappear.
Comment 8 Michele Calgaro 2014-02-20 01:35:35 CST
(In reply to comment #7)
Thanks Darrell, really appreciate your effort. Your interval matches my suspicion on commits:
- d1b6b7be, 2013-12-22 "[qt3] Repair performance regression accidentally introduced with new style API"
- 9ec64b2c, 2013-12-22 "[qt3] Add slow QStyleControlElementData copy constructor for use with python".
I suspect that those commits may have introduced also some other glitches here and there. I will have to spend some time on this bug.
Comment 9 Michele Calgaro 2014-02-23 08:35:31 CST
Until Dec 22, 2013 the problem did not exist. I also noticed that until then, the icon was correctly displayed at the far left of the button, with the text using the remaining space of the button and being centered (with a big gap between icon and text if the button is quite large).
Now instead the icon is drawn near the text and the "icon+text" is using the button space and being centered.
Working on this :)
Comment 10 Darrell 2014-02-23 16:55:31 CST
As I shared in bug 1800, this likely is a latent bug that always existed but never exposed.

In bug 1800 the problem affects setButtonOK method dialog buttons only. The culprit is whatever code the setButtonOK method shares with displaying icons in the tabbar plugin.

The plugin tabs are more or less buttons, or at least share similar drawing/painting attributes. Something in the shared code does not readjust the tab or button when an icon is used in the display.

The patch from before Dec. 22 did not cause the bug. Only exposed the bug.
Comment 11 Michele Calgaro 2014-02-23 23:59:52 CST
Created attachment 1950 [details]
icon bug screenshot (attachment corrupted)

(In reply to comment #10)
Darrell, thanks for your feedback, it is always very much appreciated.
I have narrowed down the problem for this bug to the patches committed on Dec 22 on qt3/tqt3 and tdelibs, regarding the QStyleControlElementData:

048b28db 2013-12-22 [tqt3] Automated update from Qt3
9ec64b2c 2013-12-22 [qt3] Add slow QStyleControlElementData copy constructor for use with python
7f8e73d6 2013-12-22 [tdelibs] Update to support latest TQt3 style API
523c1fd9 2013-12-22 [tqt3] Automated update from Qt3
d1b6b7be 2013-12-22 [qt3] Repair performance regression accidentally introduced with new style API

The tabs in Kate's tabbar extensions are TQPushbutton, so they are 100% buttons. The tabbar extension plugin itself has nothing wrong in it.

There is also another bug introduced later on (perhaps as a consequence of fixing something introduced by this bug).
If you see the attached image, the buttons on the left are before and after this bug (so up to Dec 22 included), the buttons on the right are from my current system: notice the position of the icon in the pushbutton is different.
Comment 12 Timothy Pearson 2014-03-02 18:06:44 CST
Comment on attachment 1950 [details]
icon bug screenshot (attachment corrupted)

Can you please resubmit this attachment?  It was corrupted in the Bugzilla upgrade.

Thanks!
Comment 13 Michele Calgaro 2014-03-02 22:13:37 CST
Created attachment 1970 [details]
icon position snapshot

Resubitting the snapshot. It only contains the image with the icon+text "centerer"
Comment 14 Michele Calgaro 2014-04-12 07:44:31 CDT
I am temporarily setting this bug back to NEW because bug 2016 has a bigger priority for me at the moment. I will come back to this bug at a later stage.
Comment 15 Timothy Pearson 2014-10-03 12:39:57 CDT
This was cause by a bit of an idiosyncrasy in how the TQPushButton class handles clearing icons.  In most other cases in TQt3/TDE a null object is used (e.g. in plugin_katetabbarextension.cpp line 193) to clear an icon, however, internally TQPushButton actually uses a pointer.  I had neglected to set a null icon in the style information transfer class when the pointer was null, hence causing the bug described in this bug report.

Fixed in GIT hashes 3a40adf (qt3) and 48f56c4 (tqt3).

Thanks for reporting, for such detailed reproduction instructions, and for tracking down the approximate time and location of the failure!
Comment 16 Darrell 2014-10-03 15:31:46 CDT
Looks good here. Thank you.
Comment 17 Michele Calgaro 2014-10-03 21:06:40 CDT
Looks good here as well. Thank you.