Posts Tagged ‘windows’

Discussing the shortcomings of OpenERP Client themes on various platforms with Fabrice, we found out that it was in fact quite simple to switch to a different GTK theme on Windows as well. It works fine with the All-In-One installation of OpenERP, so that’s an easy way of customizing the looks of the OpenERP GTK Client.

GTK is the framework on top of which the OpenERP desktop client is built, and GTK supports themes. The runtime library also ships with a handy theme selector application, to write the appropriate magic in the .gtkrc-2.0 file in your home directory. So with the All-In-One you can just go into wherever you installed OpenERP, then down into “OpenERP AllInOne\Client\GTK\bin\” and start gtkthemeselector.exe.

Of course on Ubuntu you can easily change your GTK theme through System/Preferences/Appearance.

With the GTK runtime on Windows you get only a few themes. The default one is Wimp and is usually labelled “MS-Windows”. What Wimp does is reuse the default Windows look, for maximum coherence. This means that you will get different results on XP, Vista, Seven, as well as if you change to the Windows Classic theme (the latter specifically gives an ugly result with Wimp).

Adding themes on Windows is easy as well, you only need to:

  • find a suitable GTK theme online, and download the Windows build (the engine needs to be built as a Windows DLL)
  • add the theme definition in the GTK\share\themes directory (inside OpenERP Client), next to the existing ones
  • put the engine (named libsomething.dll) in GTK\lib\gtk-2.0\2.10.0\engines, next to the others
  • start the theme selector to switch to the chosen theme
  • restart your GTK application, in this case your OpenERP client

You can find a lot of GTK themes for Windows in the Windows GTK theme selector that goes with the GTK Windows Runtime. Grab the zip version as you just want the source of the themes. You’ll find them in the lib and share subdirectories after unzipping.

However, I think Wimp is not a bad theme, and after all if you’re using a specific Windows theme, it may be that you like it. It’s just that it has some shortcomings, wastes space everywhere (other themes too), and does not have alternating row colors in lists.

The space-waste problem is common to many GTK themes and is addressed by Martin Ankerl‘s compact themes, improving classical GTK themes such as Clearlooks Compact and Human Compact. This is an area where users of all platforms can benefit! The compact theme reusing the original engines, they’re cross-platform but your need to install the original ones (which are included in the Windows GTK themes archive)

Both Clearlooks and Human themes do have alternating row colors, which is not the case by default in Wimp. To fix it, you can simply patch the existing Wimp definition by editing the GTK\share\themes\MS-Windows\gtk-2.0\gtkrc file in your OpenERP Client (with your favorite code editor, or Wordpad) and change the following line:

GtkTreeView::allow-rules = 1  # Changed to 1 to allow alternating row colors

Looking at other themes is a nice source of inspiration for other tweaks… and there’s always the GTK documentation.

Read Full Post »