GNOME Bugzilla – Bug 340201
[patch] Enhancement of Wimp theme engine. (with patch files)
Last modified: 2006-09-13 18:43:15 UTC
Heres some patch files making the native look & feel of gtk+ win32 much better. msw_style.patch: Windows XP theme: 1. Draw prelight state of menu bar item. 2. Draw flat boder of popup menu with correct color. 3. Draw prelight state of notebook tabs. 4. Better looking toolbars and gripper handles. 5. Better looking push buttons. (Correctly draw default state) 7. Better size of the header of GtkTreeView. Windows classic theme (2000/ME/95/98): 1. Draw prelight state of menu bar item. (3D raised border) 2. Improve active state of menu bar item. (3D sunken border) 3. Draw 3D boder of popup menu with correct colors. 4. Better looking toolbars and gripper handles like the one owned by IE & Office 2000. 5. Better looking push buttons. Pixel by pixel looks totally the same with native one provided by Windows and cannot be distinguished by the users. 6. Better looking tool buttons look like the ones provided by IE & Office 2000. Toggled buttons have correct background. 7. Better looking and size of combo box. (Combo box looks "much better" than the original one) 8. Better looking scroll bar buttons. (looks totally the same with native one and cannot be distinguished by the users) 9. Much better size & apperance of the header of GtkTreeView. 10. Better looking check boxes and radio buttons in GtkTreeView. (GtkCellRendererToggle) Their colors should be always the same with the ones in normal state, regardless of the real state of the tree row. 11. Better looking expanders. (looks totally the same with the one provided by Windows) Common enhancement: 1. Treat flat push buttons as tool buttons, and make them flat because on windows, this kind of buttons often looks like toolbar buttons in other native apps. (This absolutely make gaim & gimp look much better) 2. Better focus painting. 3. Better looking horizontal and vertical separators. msw_theme_main.patch: Call msw_style_finalize to release any GDI resources cached by the theme engine. Screenshots of original Wimp engine: ftp://tw.blogdns.org/pub/screen.tgz Screenshots of my patched version: http://pcman.sayya.org/gtk_win32/
Created attachment 64569 [details] [review] Main patch.
Created attachment 64570 [details] [review] Do some cleanup on termination.
Some screenshots of original gtk+ win32 (for comparison): http://pcman.sayya.org/gtk_win32/screenshots/old/ (Previous link in my initial bug report is invalid)
Some features like "prelight state of menubar and tabs" are not available now, since this need the support of gtk+. The patch for gtk+ is here: http://bugzilla.gnome.org/show_bug.cgi?id=340203
This patch has several problems with it: 1) Open a file chooser. Note that there is an ugly black border drawn around the location button. 2) The black border around a button when it is pressed is too large 3) There is 1 pixel of dead space in GtkHandleBoxes between the handle and the rest of the toolbar I'll attach screenshots.
Created attachment 64613 [details] filechooser button problem
Created attachment 64614 [details] pressed button problem
Created attachment 64615 [details] GtkToolbar not etched in
Created attachment 64616 [details] handlebox gripper missing pixels
I appreciate this patch and will happily incorporate it once these issues are resolved. For future reference, it would make my life easier as a maintainer if each problem was addressed in its own patch, rather than having a 35kb patch to review which fixes multiple unrelated problems. That way, I could evaluate each patch's changes on its own merits, and pay more attention when doing code review. Thanks.
*** Bug 339882 has been marked as a duplicate of this bug. ***
(In reply to comment #8) > Created an attachment (id=64615) [edit] > GtkToolbar not etched in GtkToolbar is not etched in ATM (e.g. attachment #64368 [details]). Did you mean GtkMenuBar by any chance?
No, I mean that I have a patch in gtk-wimp's CVS that draws toolbars etched-in, and this patch undoes my patch.
Created attachment 66698 [details] [review] Main patch for msw_style.c. Fix all button-related issues told by Dom Lachowicz. Fix missing pixels of handle box. (Not perfect, but good enough) Add a raised border to menu bar in classic Windows theme (ie. Win 2000 like). :-( This looks different from most of the native Win32 applications, but I think adding this make it look better. Since Dom says we should make it "good enough", not "perfect", I think this is OK. :-) Add some patch for spin buttons in classic theme. (Spin button looks better under win 2000 theme now) Do some cleanup for the source code. Some notes: My development environment under Windows is in a mess now due to Windows dll hell. So some gtk+ apps on my system cannot be executed properly, and I didn't test the patch with every gtk+ apps installed. However, in gtk-demo and gnumeric, this patch absolutely looks great. Maybe Dom can do some more complete tests on this. :-)
This patch is much better and can almost be included. Gnumeric and gtk-demo look amazing. A few comments: 1) The "widget" parameter can be null sometimes. Please be a bit more defensive before doing a GTK_IS_XXX(widget) check. 2) Gimp 2.3.x crashes when the theme is enabled, and I haven't 3) Gaim's "Available/Away" combo box looks odd. This might be acceptable, however. #1 and #2 are show-stoppers. Nice work, Pcman.
GTK_IS_FOO should handle NULL just fine.
Sorry, I meant to say "and I haven't explored why it crashes." Also, Dia crashes.
Is there anything happening with these patches? Were they commited?
No, these weren't committed because at least Gimp and Dia crash when these patches are used.
Created attachment 72511 [details] [review] Fixed main patch for msw_style.c. (doesn't crash GIMP anymore) After large amount of testing, I've found the problem in previous patch. Guess what? Only one line need to be changed. It's cause by a pair of parentheses in wrong place. Anyway, it's fixed now. Cheers!
Thanks!
*** Bug 352430 has been marked as a duplicate of this bug. ***
*** Bug 352436 has been marked as a duplicate of this bug. ***
*** Bug 339804 has been marked as a duplicate of this bug. ***