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:
Created attachment 107535 [details] Patch to fix things listed in comment #1
Created attachment 107575 [details] New version or rh-aw patch, fixes menubar text spacing (needs QT patch)
Created attachment 107576 [details] Adds a GtkStyle to qnamespace.h for Gtk-specific drawing
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.
Created attachment 107914 [details] Updated QT patch to draw sub-popupmenus more like Gtk
Created attachment 107915 [details] A few more details fixed, see screenshot mentioned in a later comment
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.
Taking this bug as my own.
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.
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
Ehum, that should be "compatibility" of course...
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
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.
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
More convenient to look at: http://petrix.se/fedora/kde_buttons.html
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.
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.
Peter, thanks for your great work here. Chris how can i get access to your cvs?
Awesome! Thank you very much Peter!
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?
Peter, new redhat-artworks will be built in fc4 tree today, your fix is included in this release. Thanks for your patch.
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?
the gtkstyle patch is included in qt-3.3.4-10.
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!
Considering that both of the patches were applied in time for FC4, I'm closing this. Thanks for your help, Peter!