Bug 141125

Summary: List of Bluecurve QT bugs and suggestions for improvements
Product: [Fedora] Fedora Reporter: Peter Backlund <peter.backlund>
Component: redhat-artworkAssignee: David Zeuthen <davidz>
Status: CLOSED CURRENTRELEASE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: 3CC: clee, harald, laroche, mattdm, mclasen, rdieter, than
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: 0.121-1 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2006-10-31 20:20:51 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
Patch to fix things listed in comment #1
none
New version or rh-aw patch, fixes menubar text spacing (needs QT patch)
none
Adds a GtkStyle to qnamespace.h for Gtk-specific drawing
none
Updated QT patch to draw sub-popupmenus more like Gtk
none
A few more details fixed, see screenshot mentioned in a later comment
none
More fixes
none
New version, with button fixes
none
Yet another version, with scrollbar and button fixes
none
New version none

Description Peter Backlund 2004-11-29 15:13:37 UTC
From Bugzilla Helper:
User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.5)
Gecko/20041114 Firefox/1.0

Description of problem:
I've been working on modifying the QT Bluecurve style to match the GTK
engine much closer. I was going to submit a patch against FC2
(rh-aw-0.97), but then I noticed that many of my fixes were already in
rh-aw-0.117. I'm attaching a small patch against
art/qt/Bluecurve/bluecurve.cpp that does the following:

- Corrects the drawing of the handle on the splitter widget
- Removes the bright line on top of the menubar
- Removes the thick border around the default menu button
- Adds one pixel to the vertical margin in the PopupMenu
- Sets the splitter width to 6 pixels

Also, in qtrc, the Midlight color should be changed from #fdfdfd to
#f5f5f5. That's as simple as :%s/fdfdfd/f5f5f5 in qtrc.

Here's a list of bugs (i.e. places where the QT style differs from the
GTK one) that I've observed:

- Space around text in menubar is too small (can only be fixed inside
QT - see below).

- SubPopupMenus pop up a bit "inside" the parent popup menu, but in
gtk they are aligned only 1 or 2 pixels from the border.

- The shading colors for the gradient box marking the active menu item
are slightly different (very strange - the rgb_to_hls/hls_to_rgb/shade
functions are identical, and the configuration file values are also
identical...)

- The notebook frame is broken (look at qtconfig). The frame around
the tabs i 3d-enabled, but the larger frame is dark grey only.

- The widget controlling a number with small arrow buttons up and down
look horrible (qtconfig->Interface tab->Double click interval for
example).

- The scrollbar should not draw the border that's next to the
Add-/SubtractPage buttons when it's in either of the extreme
positions. I've tried to fix this, but it doesn't quite work. The fix
looks like this:

          case SC_ScrollBarSlider:
+        
            if (scrollbar->orientation() == Qt::Horizontal)
-            ret.setRect(sliderstart, 0, sliderlen, sbextent);
+            if (scrollbar->value() == scrollbar->maxValue()) {
+                ret.setRect(sliderstart+1, 0, sliderlen+1, sbextent);
+            } else if (scrollbar->value() == scrollbar->minValue()) {
+                ret.setRect(sliderstart-1, 0, sliderlen+1, sbextent);
+            } else {
+                ret.setRect(sliderstart, 0, sliderlen, sbextent);
+            }
            else
-            ret.setRect(0, sliderstart, sbextent, sliderlen);
+            if (scrollbar->value() == scrollbar->maxValue()) {
+                ret.setRect(0, sliderstart+1, sbextent, sliderlen+1);
+            } else if (scrollbar->value() == scrollbar->minValue()) {
+                ret.setRect(0, sliderstart-1, sbextent, sliderlen+1);
+            } else {
+                ret.setRect(0, sliderstart, sbextent, sliderlen);
+            }
            break;

I think you get the idea. Just drag a scrollbar to the top/bottom
poistion in QT and GTK, and look at the difference.

- The colors on the diagonal lines (tha handle) on scrollbars are
different

- The arrow on the drop-down-menu widget is a few pixels too low in QT

- In KDE, if you enable icons on buttons, the text is left-aligned
against the pixmap, which is ugly. It would be better if the text was
centered in the space excluding the pixmap.

- KWin is, of course, far behind.

- There's no highlighting of the scrollbar of scrollbar
AddPage/Subtract/page buttons when hovering with the mouse

- The lower right dragging corner look quite different

- Inactive text is colored differently

- The dashed frame around the active widget is a bit off in the
corners. It's drawn by a standard X function in qwidget_x11.cpp, so
then you 'd need to patch QT to draw it like GTK  does, or possibly
override the drawing function somewhere in the style. 

Now, about the QT modifications, I'm suggesting adding a GtkStyle to
the GUIStyle enum in qt/src/kernel/qnamespace.h.
Bluecurve::styleHint() would return GtkStyle, and you could modify for
example qmenubar.cpp to set the height and frame widths to
Gtk-compatible values. This would be equivalent to setting the 

static const in motif* 

values in qmenubar.cpp to 

static const int motifBarHMargin    = 0;    
static const int motifBarVMargin    = 0;    
static const int motifItemFrame     = 0;    
static const int motifItemHMargin   = 8;    
static const int motifItemVMargin   = 8;

You could also adapt the alignment of the SubPopupMenus by this mechanism.

Version-Release number of selected component (if applicable):
0.117-1

How reproducible:
Always

Steps to Reproduce:
1. Run arbitrary QT/KDE application with Bluecurve style enabled.
2. Compare said widgets to the Gtk equivalents.
3.
    

Actual Results:  Some differences

Expected Results:  No differences

Additional info:

Comment 1 Peter Backlund 2004-11-29 15:14:45 UTC
Created attachment 107535 [details]
Patch to fix things listed in comment #1

Comment 2 Peter Backlund 2004-11-29 21:21:29 UTC
Created attachment 107575 [details]
New version or rh-aw patch, fixes menubar text spacing (needs QT patch)

Comment 3 Peter Backlund 2004-11-29 21:22:11 UTC
Created attachment 107576 [details]
Adds a GtkStyle to qnamespace.h for Gtk-specific drawing

Comment 4 Peter Backlund 2004-11-29 21:25:45 UTC
I've submitted two patches to enable the QT menubar to be drawn
exactly like the Gtk one. Look at 

http://mozer.nailed.org/misc/both.png

Old QT (rh-aw 0.97) on the left, QT with these patches in the middle,
and Gtk on the right. 

Also, I've found two more differences:

- The checkmark pixmap has i slightly "rounded" right leg in Gtk, but
it's completely straight in QT (minor detail though)
- The checkmark turns white when item is hovered in Gtk, but stays
black in QT.

Comment 5 Peter Backlund 2004-12-05 22:29:37 UTC
Created attachment 107914 [details]
Updated QT patch to draw sub-popupmenus more like Gtk

Comment 6 Peter Backlund 2004-12-05 22:32:23 UTC
Created attachment 107915 [details]
A few more details fixed, see screenshot mentioned in a later comment

Comment 7 Peter Backlund 2004-12-05 22:38:52 UTC
I've submitted new versions of the patches today, which fixes 4 things that you
can see in this screenshot:

http://mozer.nailed.org/misc/qt.png

1. No double line between up-arrow button and scrollbar slider, and the colors
on the slider handle are corrected.

2. The color of the separator and the margin to the edges is corrected.

3. The sub-popupmenu "overlap" has been reduced, and the right-arrows are in the
 correct place. The overlap is still not exactly like Gtk, but it's the best I
could do with a non-invasive patch to QT.

4. Nearly correct checkmarks and checkmark margins, including highlighting on
mouseover. The checkmarks probably need to be masked somehow, I still haven't
figured out exactly how.



Comment 8 Chris Lee 2004-12-06 00:54:17 UTC
Taking this bug as my own.

Comment 9 Chris Lee 2004-12-06 00:59:41 UTC
Thanks a lot, Peter, for your work as well as for the detailed analyis.

I'll test the Bluecurve changes and probably roll them into my own branch as
soon as I can. I have to admit that patching Qt (even just to change the static
const int declarations) doesn't seem very good to me. It'd be nice if the QStyle
API allowed us to customize the QMenuBar more. Hopefully, in Qt4...

Have you done any work on the KWin theme yet? I haven't tackled that one yet myself.

Comment 10 Peter Backlund 2004-12-06 10:55:56 UTC
Hi.

The changes to Qt are not really changes, but additions. The modifications will
_only_ affect those styles that return GtkStyle when asked about SH_GUIStyle,
which at this point only includes Bluecurve. Existing styles won't notice any
difference. That kind of "loophole" would be useful for all sorts of
Gtk-compability rendering inside Qt, the same way MotifStyle and WindowsStyle is
used now. I know that Novell are working on a QIndustrial style, which would
benefit from this as well.

About KWin: no, I haven't looked at it at all yet. Maybe later.

The scrollbar code is not very good right now, and has some weird bugs in
certain situations, but I included it anyway just to get an idea of what it
should look like.

/Peter   

Comment 11 Peter Backlund 2004-12-06 10:59:13 UTC
Ehum, that should be "compatibility" of course...

Comment 12 Peter Backlund 2005-01-18 15:59:25 UTC
Created attachment 109927 [details]
More fixes

This patch fixes QSpinWidget, QComboBox and QWidgetStack. Look at 
http://petrix.se/fedora/qtconfig.png

1. Black and white frame.
2. Up and down arrows are correct size and position.
3. Down arrow button is correct size, and arrow is correctly positioned.

Compare this to 
http://petrix.se/fedora/qtconfig_fc3.png

Comment 13 Peter Backlund 2005-01-18 16:06:40 UTC
Also, three more things: 

1. A pushed button now has the normal background color #e6e6e6,
instead of the earlier Qt style where it had a highlighted color. This
is however different from the Gtk style, where the button background
is darked than normal. I'd like to propose that the Gtk style adapts
this look for the pushed button, since it makes the 3d effect symmetrical.

2. Qt has support for Gtk style ComboBox popups, but there is a bug in
Qt where the combo box button is disabled if you click outside the
popup menu. I'll look into this if I have the time. You can try by
un-commenting "case SH_ComboBox_Popup:" on line 2611.

3. I've added a special checkmark pixel array in bits.cpp, to make it
look like the Gtk checkmark (in a PopupmenuItem, not checkbox). It's
not perfect yet, though.     

Comment 14 Peter Backlund 2005-01-21 20:45:42 UTC
Created attachment 110073 [details]
New version, with button fixes

Fixed text and pixmap positioning on buttons, and button size.

Old look: http://petrix.se/fedora/old_kde_buttons.png

New look: http://petrix.se/fedora/new_kde_buttons.png

Comment 15 Peter Backlund 2005-01-21 20:52:18 UTC
More convenient to look at:

http://petrix.se/fedora/kde_buttons.html

Comment 16 Peter Backlund 2005-01-22 20:13:02 UTC
Created attachment 110094 [details]
Yet another version, with scrollbar and button fixes

This patch fixes highlighting on mouseover on scrollbars, and eliminates a
double line between the slider and the up/down button when the slider is in
either extreme position. 

The pixmap/text positioning has been slightly improved as well, and is now
completely symmetrical. 

I'll post new screenshots with complete coverage soon.

Comment 17 Peter Backlund 2005-01-27 10:17:50 UTC
Created attachment 110285 [details]
New version

Even more fixes, and an overview page with screenshots:

http://petrix.se/fedora/bluecurve

Chris, is there a cvs snapshot of Qt Bluecurve with any of my fixes in it, so
that I can start patching against something newer?

Current TODO list:

- The KDE Midlight and Dark colors are different from Qt's, making mouseover
highlihgt and pressed buttons look bad. 
- The lower right corner grab is different.
- No mouseover highlight of the splitter bar.
- The menutiem checkmark isn't perfect either.

And a few minor things.

Comment 18 Than Ngo 2005-01-27 11:59:17 UTC
Peter, thanks for your great work here.

Chris how can i get access to your cvs? 


Comment 19 Harald Hoyer 2005-01-27 13:43:21 UTC
Awesome! Thank you very much Peter!

Comment 20 Peter Backlund 2005-03-22 10:16:59 UTC
No sighting of any of this in Rawhide yet? I have a few small additions, such as
the pushed scollbar arrow buttons. Any CVS snapshot available?

Comment 21 Than Ngo 2005-03-23 13:13:09 UTC
Peter, new redhat-artworks will be built in fc4 tree today, your fix is included
in this release. Thanks for your patch.


Comment 22 Peter Backlund 2005-03-23 18:04:25 UTC
That's good to hear, I'll open a new bug and submit patches against that build
then. Any news on getting a Gtk mode into Qt 3.4, for the suggested Qt changes?

Comment 23 Than Ngo 2005-03-23 18:12:52 UTC
the gtkstyle patch is included in qt-3.3.4-10.

Comment 24 Matthew Miller 2006-07-10 21:29:29 UTC
Fedora Core 3 is now maintained by the Fedora Legacy project for security
updates only. If this problem is a security issue, please reopen and
reassign to the Fedora Legacy product. If it is not a security issue and
hasn't been resolved in the current FC5 updates or in the FC6 test
release, reopen and change the version to match.

Thank you!


Comment 25 John Thacker 2006-10-31 20:20:51 UTC
Considering that both of the patches were applied in time for FC4, I'm closing
this.  Thanks for your help, Peter!