« Mac integration | Main | GTK+ Application bundles on Mac »

Native Mac theme

A frequent comment I get is that the GTK+ OS X screenshots look like... GTK+. As opposed to native Mac applications, of course. I started a native theme engine quite a while ago but got sidetracked with other things, so it's been sitting around in a git repo for some time now. It could be a fun hack if someone wants to get involved in GTK+ OS X hacking, and there is plenty of low hanging fruit to take care of. It's quite rewarding to play around with, as the result of the work is so immediately visible.

You can check it out here:

  svn co svn.gnome.org/svn/gtk-quartz-engine/trunk gtk-quartz-engine

Here's an example of what it looks like on 10.5:

Update

The repo was moved to GNOME subversion, I've updated the info above to reflect that.

Comments

I have a very stupid question, and I think I know the answer to it, but here goes: that can't be run on Linux, can it?

I am assuming that your engine somehow depends on quartz or something, so that probably wouldn't work... but it would be cool.

Impressive work! Nice to see GNOME apps getting beatiful on the mac. This will help introducing new people into the foss world.

Pretty awesome! I'm going to have to have a look soon at creating a Hotwire installer for OS X that bundles this stuff.

I always thought that if the native Windows GTK+ theme is WIMP then the native Mac GTK+ theme had to be WUSS, so please call the engine WUSS.

Because only *NIX user aren't wimps and wussys!

@Imos Anon: Mac OS X is a *NIX operating system

Where is the source?

Ioannus: That's correct, it only works on Macs.


Well yes, Mac OS X is technically a *NIX but so is BeOS/Haiku and I don't think of them as *NIX either. Without the Filesystem Hierarchy Standard, X and regular use of the command line its not really *NIX.

It looks very nice indeed, and much better than what Qt looks like on OS X for example. We would like to use it for Inkscape too.
autogen.sh does not run right now though. I made a patch[1] that got me past configure. It adds a check for automake-1.10 (current version in MacPorts) and uses glibtool instead of the system libtool. Indeed the system libtool does not have libtoolize and does not recognize the --version switch which is used to check its existence.
I still get an error at compile time but this will be solved later. Thanks for making it public. I look forward to seeing contributions to this.

[1] http://jo.irisson.free.fr/dropbox/autogen.patch

This looks great-- does it also work for those of us who prefer to use the Graphite Aqua appearance rather than the default Blue one, though...?

JiHO: Thanks! I'll apply your patch.

Calum: It just uses the native drawing APIs so the right color is automatically applied for things like focus and scrollbars etc. For some things we might have to do some manual syncing of colors between the system and gtk though.

Unless that was clear by the way, the theme is not ready for general use yet, many things are not implemented so there is plenty of opportunity to help out :)

Just installed on my G4 (Mac OS 10.4)...when trying to use with Emesene i get a few bugs (no scrolling bar, no checks for plugins and no arrows on preferences tabs). Is it an Emesene issue? Or do I need to update gtk+ to last svn?
Current installed is rev.19598.

On my blog you can see a screenshot...
Many thanks for your work!!

SpaDaRiO: It is not supposed to be usable yet, it's work in progress. Let me know if you want to help out, I already have received a couple of patches since I posted yesterday, fixing the scrollbar issue amongst other things :).

I just wanted to know if it was a problem on emesene or on your theme...

So...I'm waiting for a patched theme...

Thanks

(Edited a bit to make clearer)

JiHO: I applied the automake 1.10 part of your patch, thanks! The rest is not really correct imo. Using "which" breaks on tiger, because it always returns success, and in order to build the rest of the stack you have to have libtoolize without a g (normal upstream gnu libtool installed into your build prefix), so that part should probaby be a ports specific patch... To make things easier we could support using the LIBTOOLIZE env variable though.

but when can we hope for release of fully working gtk for mac?

I saw that scrollbar was fixed...now I hope that checks, tabs and many other things will be implemented soon :)

Keep up the good work
Greetings from Sicily, Italy

That's very nice!

Wow, saw this on Planet Gnome. Looks amazing!

How do I actually get this theme to load? I have been trying to mess around with my .gtkrc file and can't seem to get it to load.

John> Try to rename it to .gtkrc-2.0

John> Try to rename it to .gtkrc-2.0

John> Try .gtkrc-2.0

THANK YOU.

Thank you thank you thank you. This is awesome.

I absolutely love GTK+ and Glade and would like to use them for all my UI development, but getting reasonable looking applications on MacOS has been a big sticking point for a while. How long until this is production-quality? I can't *WAIT* to distribute my first PyGTK application to my Mac-using friends!!!

Glyph Lefkowitz: the mac port is already usable for many things, even if the native theme isn't. If you want to try things out and report any issues, things might move along quicker :)

There's something to be said for a visually distinct theme: It's not as if Clearlooks is unattractive.

GTK ain't aqua and It's probably unrealistic for you to change aspects of the port to work *exactly* as native controls do.

If widgets look native but behave "improperly" - that /may/ be problematic.

Honestly, it depends on the program and the magnitude of the differences, I suppose.

For something simple , no one's going to object and many will love a native appearance.

For something more... esoteric, with a lot of "weird" controls, a more consistent look across platforms might be preferable to the confusion of mixed widgets or widgets that act wonky.

Again - it's one of the central design issues of cross-platform GUIs... Just thinking out loud here.

Jeez...all i want to do is to get a mac theme for my Windows vista. I don't know how though...

The theme I'm working on is completely tied to Mac OS since it uses Mac APIs to do the drawing.

I just tried the theme with Gimp and it looks great. There are two minor glitches that I have found:
1) If you hover over a button with a tooltip, the button looses focus, as soon as the tooltip appears, which means you cannot click the button unless you move the mouse pointer to make the tooltip disappear and click very fast.
2) Gimp uses Images in select box labels. These images are misplaces when the select box is collapsed, but places correctly when the select box is expanded.

I am using gtk2 2.12.9 from Macports on Leopard.

Lars: the tooltip problem is fixed in svn I believe. I'm not sure I understand the second point, could you clarify it a bit or tell me in what dialog etc please?

I tried compiling this on Tiger. make fails saying "/usr/libexec/gcc/i686-apple-darwin8/4.0.1/ld: Undefined symbols:
_gdk_quartz_drawable_get_context". Is there a mailing list where you guys answer questions, or this blog is the only venue?

Ofey: Are you perhaps building against an X11 version of GTK+ on Mac? You need the quartz version. You could post in the forum at http://developer.imendio.com/forum/gtk-macosx if you have further questions.

Richard, I just updated from git and got following results:

http://www.youtube.com/watch?v=zk37GweB88M
http://www.youtube.com/watch?v=vtkycqix-e8

Note that I am clicking the button all the time in the first video, but the button has no focus, so it does not work.

Is there an issue tracker for this theme?

Lars, the tooltip/focus issue is not related to the theme, you need to get a newer version of GTK+ for that fix.

There is no tracker for the theme, but you can send me email or post to the forum at http://developer.imendio.com/forum/gtk-macosx if you want.

Richard, thank you for the help. I am using the latest stable release of GTK+, I will try using an unstable build when I find some time. Will there be updates to the stable branch of GTK+ or are all future improvements tied to the development branch.

That fix has been committed to the stable branch as well, so if there ever is a 2.12.10 release, it will have the fix.