Browse files

Sane layout on the vertical panel

  • Loading branch information...
1 parent 8d49c8b commit 3bc1fa10d31cc563cacfa00abfc37954956fc099 @rainwoodman rainwoodman committed Apr 8, 2009
Showing with 27 additions and 2 deletions.
  1. +5 −1 applet/applet.vala
  2. +22 −1 libgnomenu/menubarbox.vala
View
6 applet/applet.vala
@@ -116,18 +116,22 @@ public class Applet : Panel.Applet {
case AppletOrient.UP:
menubars.gravity = Gravity.DOWN;
menubars.pack_direction = PackDirection.LTR;
+ menubars.child_pack_direction = PackDirection.LTR;
break;
case AppletOrient.DOWN:
menubars.gravity = Gravity.DOWN;
menubars.pack_direction = PackDirection.LTR;
+ menubars.child_pack_direction = PackDirection.LTR;
break;
case AppletOrient.LEFT:
menubars.gravity = Gravity.LEFT;
menubars.pack_direction = PackDirection.TTB;
+ menubars.child_pack_direction = PackDirection.TTB;
break;
case AppletOrient.RIGHT:
menubars.gravity = Gravity.RIGHT;
- menubars.pack_direction = PackDirection.BTT;
+ menubars.pack_direction = PackDirection.TTB;
+ menubars.child_pack_direction = PackDirection.TTB;
break;
}
}
View
23 libgnomenu/menubarbox.vala
@@ -19,19 +19,39 @@ public class MenuBarBox: Gtk.Container {
));
}
public PackDirection pack_direction {
+ /* The child menubar's child pack direction is the same
+ * as this menubox's pack direction,
+ * whilst the child menubar's pack direction is the same
+ * as this menubox's child pack direction.
+ *
+ * This is to provide a sane layout for the vertical left
+ * panel*/
get {
return _pack_direction;
}
set {
foreach(Gnomenu.MenuBar menubar in children) {
- menubar.pack_direction = value;
menubar.child_pack_direction = value;
}
if(_pack_direction == value) return;
_pack_direction = value;
queue_resize();
}
}
+ public PackDirection child_pack_direction {
+ get {
+ return _child_pack_direction;
+ }
+ set {
+ foreach(Gnomenu.MenuBar menubar in children) {
+ menubar.pack_direction = value;
+ }
+ if(_child_pack_direction == value) return;
+ _child_pack_direction = value;
+ queue_resize();
+ }
+ }
+
public Gnomenu.Gravity gravity {
get {
return _gravity;
@@ -65,6 +85,7 @@ public class MenuBarBox: Gtk.Container {
private HashTable<weak Widget, ChildPropBag*> props;
private PackDirection _pack_direction;
+ private PackDirection _child_pack_direction;
private Gnomenu.Gravity _gravity;
private List<weak Gnomenu.MenuBar> children;

0 comments on commit 3bc1fa1

Please sign in to comment.