Bug 141125 - List of Bluecurve QT bugs and suggestions for improvements
List of Bluecurve QT bugs and suggestions for improvements
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: redhat-artwork (Show other bugs)
3
All Linux
medium Severity medium
: ---
: ---
Assigned To: David Zeuthen
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2004-11-29 10:13 EST by Peter Backlund
Modified: 2013-03-05 22:42 EST (History)
7 users (show)

See Also:
Fixed In Version: 0.121-1
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2006-10-31 15:20:51 EST
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)
Patch to fix things listed in comment #1 (1.79 KB, patch)
2004-11-29 10:14 EST, Peter Backlund
no flags Details | Diff
New version or rh-aw patch, fixes menubar text spacing (needs QT patch) (2.29 KB, patch)
2004-11-29 16:21 EST, Peter Backlund
no flags Details | Diff
Adds a GtkStyle to qnamespace.h for Gtk-specific drawing (2.77 KB, patch)
2004-11-29 16:22 EST, Peter Backlund
no flags Details | Diff
Updated QT patch to draw sub-popupmenus more like Gtk (4.19 KB, patch)
2004-12-05 17:29 EST, Peter Backlund
no flags Details | Diff
A few more details fixed, see screenshot mentioned in a later comment (5.36 KB, patch)
2004-12-05 17:32 EST, Peter Backlund
no flags Details | Diff
More fixes (16.60 KB, patch)
2005-01-18 10:59 EST, Peter Backlund
no flags Details | Diff
New version, with button fixes (17.52 KB, patch)
2005-01-21 15:45 EST, Peter Backlund
no flags Details | Diff
Yet another version, with scrollbar and button fixes (30.71 KB, patch)
2005-01-22 15:13 EST, Peter Backlund
no flags Details | Diff
New version (33.60 KB, patch)
2005-01-27 05:17 EST, Peter Backlund
no flags Details | Diff

  None (edit)
Description Peter Backlund 2004-11-29 10:13:37 EST
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 10:14:45 EST
Created attachment 107535 [details]
Patch to fix things listed in comment #1
Comment 2 Peter Backlund 2004-11-29 16:21:29 EST
Created attachment 107575 [details]
New version or rh-aw patch, fixes menubar text spacing (needs QT patch)
Comment 3 Peter Backlund 2004-11-29 16:22:11 EST
Created attachment 107576 [details]
Adds a GtkStyle to qnamespace.h for Gtk-specific drawing
Comment 4 Peter Backlund 2004-11-29 16:25:45 EST
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 17:29:37 EST
Created attachment 107914 [details]
Updated QT patch to draw sub-popupmenus more like Gtk
Comment 6 Peter Backlund 2004-12-05 17:32:23 EST
Created attachment 107915 [details]
A few more details fixed, see screenshot mentioned in a later comment
Comment 7 Peter Backlund 2004-12-05 17:38:52 EST
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-05 19:54:17 EST
Taking this bug as my own.
Comment 9 Chris Lee 2004-12-05 19:59:41 EST
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 05:55:56 EST
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 05:59:13 EST
Ehum, that should be "compatibility" of course...
Comment 12 Peter Backlund 2005-01-18 10:59:25 EST
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 11:06:40 EST
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 15:45:42 EST
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 15:52:18 EST
More convenient to look at:

http://petrix.se/fedora/kde_buttons.html
Comment 16 Peter Backlund 2005-01-22 15:13:02 EST
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 05:17:50 EST
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 Ngo Than 2005-01-27 06:59:17 EST
Peter, thanks for your great work here.

Chris how can i get access to your cvs? 
Comment 19 Harald Hoyer 2005-01-27 08:43:21 EST
Awesome! Thank you very much Peter!
Comment 20 Peter Backlund 2005-03-22 05:16:59 EST
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 Ngo Than 2005-03-23 08:13:09 EST
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 13:04:25 EST
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 Ngo Than 2005-03-23 13:12:52 EST
the gtkstyle patch is included in qt-3.3.4-10.
Comment 24 Matthew Miller 2006-07-10 17:29:29 EDT
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 15:20:51 EST
Considering that both of the patches were applied in time for FC4, I'm closing
this.  Thanks for your help, Peter!

Note You need to log in before you can comment on or make changes to this bug.