After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 340201 - [patch] Enhancement of Wimp theme engine. (with patch files)
[patch] Enhancement of Wimp theme engine. (with patch files)
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Backend: Win32
2.8.x
Other All
: Normal enhancement
: ---
Assigned To: gtk-win32 maintainers
gtk-bugs
: 339804 339882 352430 352436 (view as bug list)
Depends on: 34204 340203
Blocks:
 
 
Reported: 2006-04-30 15:18 UTC by Hong Jen Yee
Modified: 2006-09-13 18:43 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Main patch. (39.23 KB, patch)
2006-04-30 15:18 UTC, Hong Jen Yee
needs-work Details | Review
Do some cleanup on termination. (555 bytes, patch)
2006-04-30 15:19 UTC, Hong Jen Yee
committed Details | Review
filechooser button problem (34.88 KB, image/png)
2006-05-01 14:42 UTC, Dominic Lachowicz
  Details
pressed button problem (72.73 KB, image/png)
2006-05-01 14:43 UTC, Dominic Lachowicz
  Details
GtkToolbar not etched in (6.24 KB, image/png)
2006-05-01 14:43 UTC, Dominic Lachowicz
  Details
handlebox gripper missing pixels (15.00 KB, image/png)
2006-05-01 14:44 UTC, Dominic Lachowicz
  Details
Main patch for msw_style.c. (43.32 KB, patch)
2006-06-03 09:57 UTC, Hong Jen Yee
none Details | Review
Fixed main patch for msw_style.c. (doesn't crash GIMP anymore) (44.02 KB, patch)
2006-09-10 18:40 UTC, Hong Jen Yee
committed Details | Review

Description Hong Jen Yee 2006-04-30 15:18:05 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/
Comment 1 Hong Jen Yee 2006-04-30 15:18:53 UTC
Created attachment 64569 [details] [review]
Main patch.
Comment 2 Hong Jen Yee 2006-04-30 15:19:27 UTC
Created attachment 64570 [details] [review]
Do some cleanup on termination.
Comment 3 Hong Jen Yee 2006-04-30 15:33:30 UTC
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)
Comment 4 Hong Jen Yee 2006-04-30 15:47:28 UTC
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
Comment 5 Dominic Lachowicz 2006-05-01 14:30:13 UTC
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.
Comment 6 Dominic Lachowicz 2006-05-01 14:42:37 UTC
Created attachment 64613 [details]
filechooser button problem
Comment 7 Dominic Lachowicz 2006-05-01 14:43:11 UTC
Created attachment 64614 [details]
pressed button problem
Comment 8 Dominic Lachowicz 2006-05-01 14:43:33 UTC
Created attachment 64615 [details]
GtkToolbar not etched in
Comment 9 Dominic Lachowicz 2006-05-01 14:44:38 UTC
Created attachment 64616 [details]
handlebox gripper missing pixels
Comment 10 Dominic Lachowicz 2006-05-01 14:46:51 UTC
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.
Comment 11 Rob Staudinger 2006-05-11 07:22:46 UTC
*** Bug 339882 has been marked as a duplicate of this bug. ***
Comment 12 Rob Staudinger 2006-05-11 07:28:00 UTC
(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?
Comment 13 Dominic Lachowicz 2006-05-11 12:23:44 UTC
No, I mean that I have a patch in gtk-wimp's CVS that draws toolbars etched-in, and this patch undoes my patch.
Comment 14 Hong Jen Yee 2006-06-03 09:57:09 UTC
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.   :-)
Comment 15 Dominic Lachowicz 2006-06-05 15:42:27 UTC
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.
Comment 16 Matthias Clasen 2006-06-05 15:45:23 UTC
GTK_IS_FOO should handle NULL just fine.
Comment 17 Dominic Lachowicz 2006-06-05 15:51:54 UTC
Sorry, I meant to say "and I haven't explored why it crashes." Also, Dia crashes. 
Comment 18 Maciej Katafiasz 2006-07-15 10:05:43 UTC
Is there anything happening with these patches? Were they commited?
Comment 19 Dominic Lachowicz 2006-07-15 12:47:03 UTC
No, these weren't committed because at least Gimp and Dia crash when these patches are used.
Comment 20 Hong Jen Yee 2006-09-10 18:40:31 UTC
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!
Comment 21 Dominic Lachowicz 2006-09-12 09:44:51 UTC
Thanks!
Comment 22 Dominic Lachowicz 2006-09-13 18:37:51 UTC
*** Bug 352430 has been marked as a duplicate of this bug. ***
Comment 23 Dominic Lachowicz 2006-09-13 18:40:00 UTC
*** Bug 352436 has been marked as a duplicate of this bug. ***
Comment 24 Dominic Lachowicz 2006-09-13 18:43:15 UTC
*** Bug 339804 has been marked as a duplicate of this bug. ***