PDA

View Full Version : Mac-style Menu Bar for GTK and Java/Swing applications!



AqD
August 23rd, 2006, 10:19 AM
re-post from arch linux forum, because there're more people ;)
-------------------------------------------------------------------
Hi all!

I hacked gtk2 to use mac-style menubars, the pkgbuild is here => http://aur.archlinux.org/packages.php?do_Details=1&ID=6447, the patch is here => gtkmenubar.diff (http://aur.archlinux.org/packages/gtk2-aqd/gtk2-aqd/gtkmenubar.diff)
INSTALL
0.Get gtk+ 2.10.2 (other versions may also work)
1.cd ....../gtk+-2.10.2/
2.patch -p0 < ...../gtkmenubar.diff
3.configure and make & install

It's tested working with compiz-quinn and blackbox, and tested apps including epiphany, nautilus, gimp, abiword, vmware, etc. SWT-based apps may have a few minor problem with compiz. Firefox/OpenOffice are not supported.

Screenshots:
http://static.flickr.com/97/220802752_834ce2f17a_m.jpg (http://static.flickr.com/97/220802752_834ce2f17a_o.png) http://static.flickr.com/87/220842399_a0b0ccfa2d_m.jpg (http://static.flickr.com/87/220842399_a0b0ccfa2d_o.png) http://static.flickr.com/66/220802753_5d912d3a16_m.jpg (http://static.flickr.com/66/220802753_5d912d3a16_o.png)

Cheers!

PS: my modifed GT4_white theme => http://aquila.deus.googlepages.com/GT4_white-aqd.tar.gz

------------------------------------------------------------------
Java/Swing mac menubar
Similar to the GTK one, but the quality is not very good due to Swing's limitations.

http://static.flickr.com/59/222214833_5f81725552_m.jpg (http://static.flickr.com/59/222214833_5f81725552_o.png) http://static.flickr.com/66/222214834_5c5275f4be_m.jpg (http://static.flickr.com/66/222214834_5c5275f4be_o.png)

INSTALL:
0.Need Java 1.5.0_07 (for other versions, use the patch)
1.Download my patched JRootPane.java (http://aquila.deus.googlepages.com/JRootPane.java)
2.Create a dir some_dir/javax/swing and move JRootPane.java to there.
3.Chdir to some_dir (NOT javax/swing)
4.Run javac javax/swing/JRootPane.java
5.Swich to root and make a backup of /opt/java/jre/lib/rt.jar
6.Run zip -ur /opt/java/jre/lib/rt.jar javax -x "*.java"
7.Run java -Xshare:dump to re-generate shared cache.
8.Use MToolkit for AWT. Since compiz doesn't work with the new (and default) XToolkit in java 1.5, there is no need to support it. export AWT_TOOLKIT=MToolkit

The patch: http://aquila.deus.googlepages.com/JRootPane.patch

Problems:
- Some menubar parts (not menu) may be not repainted well
- Mouse movement on menubar can't activate other menus, you have to click or use the old x-window/mac style (press button until you select the target item)
- When you move mouse pointer to menus, it's treated as the mouse has left menubar. No way to solve this, swing sucks...
- You can always move/resize the menubar by Alt+mouse buttons.....

-------------------------------------------------------------------
Original post => http://bbs.archlinux.org/viewtopic.php?t=24289
I also posted to the HOWTO forum, but it seems to be rejected....

slimdog360
August 23rd, 2006, 10:43 AM
looks quite nice, Im going to have to give this a go when I get the time.

banjobacon
August 27th, 2006, 12:47 AM
So, how ugly is the hack? Is there any chance of this ever being officially worked into GTK? Making this an option in Gnome, as it is in KDE, would be great.

dabear
August 27th, 2006, 01:10 AM
Nice, but I would love having distrubutor logo to the left (with options to update, reboot, shudown the system) and deskbar to the right!

4KvRMU7Nnv
January 10th, 2007, 10:07 PM
can't figure out how to patch the GTK2 I'm a noob at that. What is it exactly I have to do??? I think I have the applet, but all i see is the program running, no file, edit, options stuff. Plz help.

mostwanted
January 10th, 2007, 10:29 PM
can't figure out how to patch the GTK2 I'm a noob at that. What is it exactly I have to do??? I think I have the applet, but all i see is the program running, no file, edit, options stuff. Plz help.

You need to get the source code for a version of Gtk+ which is already outdated in Edgy and tinker with it so you probably don't want to do that yourself.