Bug 152327 - Arrow buttons on tab bar are incorrectly drawn
Summary: Arrow buttons on tab bar are incorrectly drawn
Status: RESOLVED WORKSFORME
Alias: None
Product: Oxygen
Classification: Plasma
Component: style (show other bugs)
Version: 4.0
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Camilla Boemann
URL:
Keywords:
: 163621 (view as bug list)
Depends on:
Blocks:
 
Reported: 2007-11-15 01:09 UTC by FiNeX
Modified: 2008-12-26 21:46 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
tabs problem (35.28 KB, image/jpeg)
2007-11-15 01:11 UTC, FiNeX
Details
same behavior in konqueror (22.33 KB, image/jpeg)
2007-11-15 01:12 UTC, FiNeX
Details
The arrow bug in Konqueror (11.06 KB, image/png)
2008-01-10 09:39 UTC, András Manţia
Details
The black line bug in Konqueror (12.46 KB, image/png)
2008-01-10 09:39 UTC, András Manţia
Details
Tabwidget arrows in Plastique (11.06 KB, image/png)
2008-01-13 12:13 UTC, András Manţia
Details
Ignore, wrong upload... (11.06 KB, text/plain)
2008-01-19 12:50 UTC, András Manţia
Details
Patch that makes the tab scroll buttons cover the tabs completely (438 bytes, patch)
2008-01-19 12:50 UTC, András Manţia
Details
this patch should make the background render correctly (3.07 KB, patch)
2008-04-29 18:33 UTC, Huynh Huu Long
Details
background rendered correctly (3.85 KB, image/png)
2008-04-29 18:35 UTC, Huynh Huu Long
Details
this patch should make the background render correctly V2 (2.93 KB, patch)
2008-04-29 18:59 UTC, Huynh Huu Long
Details
The problem as of 1st of June (3.00 KB, image/png)
2008-06-01 10:41 UTC, András Manţia
Details
correct tab arrows on r889158 (5.38 KB, image/png)
2008-11-26 11:33 UTC, FiNeX
Details
Arrows as of 25/11/2008 (3.54 KB, image/png)
2008-11-26 11:42 UTC, András Manţia
Details

Note You need to log in before you can comment on or make changes to this bug.
Description FiNeX 2007-11-15 01:09:23 UTC
Version:            (using KDE Devel)
Installed from:    Compiled sources
OS:                Linux

The "edit identity" dialog window has a problem on the tabs: if the window is at a small size and the tabs are too wide, there appear tho small buttons "<" and ">" for navigate through the tabs, but this two buttons are over the latest tab label. See the screenshot for an example.
Comment 1 FiNeX 2007-11-15 01:11:21 UTC
Created attachment 22065 [details]
tabs problem
Comment 2 FiNeX 2007-11-15 01:12:33 UTC
Created attachment 22066 [details]
same behavior in konqueror

Maybe it is not a kmail bug? There is the same behavior in konqueror :-(
Comment 3 Thomas McGuire 2007-11-15 01:33:26 UTC
This bug is indeed not KMail specific, it seems to be an oxygen bug.
Reassigning to kdelibs (what is the correct place for oxygen bugs?) and adding Casper to the CC list.
Comment 4 Camilla Boemann 2007-11-15 19:44:26 UTC
known bug actually
Comment 5 FiNeX 2007-12-13 12:37:29 UTC
On the latest revision the arrows are going better. The "button" style is ok.
Comment 6 András Manţia 2008-01-10 09:38:37 UTC
The bug is there as of today. See screenshot. Furthermore if you scroll the tabs to right, a black line will appear on the left.
Comment 7 András Manţia 2008-01-10 09:39:10 UTC
Created attachment 22931 [details]
The arrow bug in Konqueror
Comment 8 András Manţia 2008-01-10 09:39:33 UTC
Created attachment 22932 [details]
The black line bug in Konqueror
Comment 9 FiNeX 2008-01-10 10:19:08 UTC
The black line is already reported. The "buttons" over the tab are the fix against the original bug report.
Comment 10 FiNeX 2008-01-10 10:19:19 UTC
*** Bug has been marked as fixed ***.
Comment 11 András Manţia 2008-01-10 13:28:05 UTC
And do you think the current way of drawing is good?? 
Comment 12 András Manţia 2008-01-13 12:12:53 UTC
I don't like to play ping-pong with the reports, but the current way of drawing the arrows is simply wrong. See the Konqueror screenshot and compare with the one using the Plastique style.
Comment 13 András Manţia 2008-01-13 12:13:39 UTC
Created attachment 22989 [details]
Tabwidget arrows in Plastique
Comment 14 András Manţia 2008-01-15 14:17:19 UTC
I think the problem is how Oxygen draws the QToolButtons, namely it 
draws a *smaller* rectangle for their background then it is requested. 

void OxygenStyleHelper::fillSlab(QPainter &p, const QRect &rect, int 
size)

is the place where the rectangle is drawn. The size argument is never 
used, but it defaults to 7 and it shrinks the rectangle with 

s = double(size) * (3.6 + (0.5 * _slabThickness)) / 7.0;

If I calculate correctly this is 3.825 . This is why there is a gab 
between the two arrows as the two arrows are actually two QToolButtons 
with half size.
Not doing this shrinking fixes the problem and I didn't see other 
artifacts (actually there shouldn't be any if one draws the rectangle on 
the size it was requested.

Anyway, one who know why that was there should review it, but this 
proves that the problem is in this case in the style itself.
Comment 15 Camilla Boemann 2008-01-19 02:40:53 UTC
Well how we draw buttons shouldn't (ideally) affect how this looks

Also you have gone too far down into the code, but still yeah the reason it looks as it does is because we draw less than the size.

It does have artifacts (no focus or hover being drawn on any button) so changing this is not an option.

I maintain it's a qt problem.
Comment 16 András Manţia 2008-01-19 09:48:49 UTC
If you draw a button smaller than it should, that *is* a problem. Why 
should be this a Qt issue (and what would be the problem with Qt in this 
case)?
  Qt (or KDE, whatever) requests to draw two button, let's say one from 
position 0,0 until 16, 16, the other one from 16,16 to 32, 32, and you 
draw one from 2,2 to 14, 14 and from 18,18 to 30,30. At least the area 
where you don't draw needs to be cleared.
 I also get focus effect on hover on buttons with this patch.

I don't understand your comment that I've gone too far down in code... 
When you try to find the reason of a bug, you do that, right? And I did 
so I can find what can be the problem with QToolBar, KToolBar, QStyle, 
KStyle or the Oxygen style. And it turned out that only Oxygen style has 
this bug, because of the above.
Comment 17 FiNeX 2008-01-19 12:42:26 UTC
Andràs, would you write a small patch with your idea so I can test it?
I don't know if this is a Qt bug or a KDE one, but fixing it is a good idea.

An initial fix could be the Andràs patch, and a furter step could be check who should manage correctly this type of buttons (Qt or KDE?).

Anyway, the problem occours only with oxygen so this is more probabily a oxygen style bug, not a Qt one. But I'm not so expert to decide this.


Thanks.
Comment 18 András Manţia 2008-01-19 12:49:08 UTC
I wouldn't call a good patch, but I attached what I was talking about, in regards of the code. Just apply it to kdebase/runtime/kstyles/oxygen, and restart your KDE. Let us know if you see artifacts or other issues.
I'm running it since I found the reason, and I see no problems.
Comment 19 András Manţia 2008-01-19 12:50:08 UTC
Created attachment 23133 [details]
Ignore, wrong upload...
Comment 20 András Manţia 2008-01-19 12:50:18 UTC
Created attachment 23134 [details]
Patch that makes the tab scroll buttons cover the tabs completely
Comment 21 Camilla Boemann 2008-01-24 08:26:23 UTC
Ok the patch is wrong in that it paints outside the button, where we want the background to shine through.

And herein lies what is wrong with qt, as they don't make sure that the background looks nice, assuming that the button will cover it all

One workaround would be to make the buttons larger as a special case in the tabbar. We would loose glow though.
Comment 22 Huynh Huu Long 2008-04-29 18:33:14 UTC
Created attachment 24560 [details]
this patch should make the background render correctly
Comment 23 Huynh Huu Long 2008-04-29 18:35:12 UTC
Created attachment 24561 [details]
background rendered correctly
Comment 24 Huynh Huu Long 2008-04-29 18:59:54 UTC
Created attachment 24562 [details]
this patch should make the background render correctly V2
Comment 25 Huynh Huu Long 2008-04-30 09:57:09 UTC
Comment on attachment 24562 [details]
this patch should make the background render correctly V2

sent all my patches to boemann :)
Comment 26 Camilla Boemann 2008-05-18 15:47:21 UTC
commited
Comment 27 András Manţia 2008-06-01 10:39:26 UTC
Sorry, this is not fixed. See screenshot from today's trunk.
Comment 28 András Manţia 2008-06-01 10:41:42 UTC
Created attachment 25037 [details]
The problem as of 1st of June
Comment 29 András Manţia 2008-06-01 13:09:26 UTC
Hm, probably the libs were not reloaded, now after a reboot it works. 
Comment 30 Pino Toscano 2008-06-10 10:53:44 UTC
*** Bug 163621 has been marked as a duplicate of this bug. ***
Comment 31 András Manţia 2008-11-26 09:56:10 UTC
Bug is present in trunk. :( No need for a new screenshot, it is like in the last one.
Comment 32 FiNeX 2008-11-26 11:33:13 UTC
Created attachment 28834 [details]
correct tab arrows on r889158

@Andras: which revision are you using? Are you really sure that you've compiled and installed correctly? This is a screenshot using r889158.
Comment 33 András Manţia 2008-11-26 11:39:10 UTC
Revision: 888742 and I have no reason thinking it is not installed correctly.
Current screenshot follows.
Comment 34 András Manţia 2008-11-26 11:42:03 UTC
Created attachment 28835 [details]
Arrows as of 25/11/2008
Comment 35 FiNeX 2008-11-26 13:31:47 UTC
Very strange, I hope devs could help us!
Comment 36 Camilla Boemann 2008-11-26 15:30:44 UTC
I can't confirm either. It looks like Finix' screenshot here as well.

I'll let you close the bug again
Comment 37 FiNeX 2008-12-26 21:46:40 UTC
It still works for me to.