diff -up gnome-applets-2.21.4/invest-applet/invest/applet.py.vertical gnome-applets-2.21.4/invest-applet/invest/applet.py --- gnome-applets-2.21.4/invest-applet/invest/applet.py.vertical 2008-01-21 23:24:51.000000000 -0500 +++ gnome-applets-2.21.4/invest-applet/invest/applet.py 2008-01-21 23:24:55.000000000 -0500 @@ -45,8 +45,15 @@ class InvestApplet: self.investwidget.connect('row-activated', lambda treeview, path, view_column: self.tb.set_active(False)) get_quotes_updater().connect('quotes-updated', self._on_quotes_updated) - - box = gtk.HBox() + + applet.connect('change-orient', self._on_orient_changed) + + orient = applet.get_orient() + if orient == gnomeapplet.ORIENT_RIGHT or orient == gnomeapplet.ORIENT_LEFT: + box = gtk.VBox() + else: + box = gtk.HBox() + box.add(self.tb) box.add(self.investticker) @@ -68,6 +75,22 @@ class InvestApplet: def on_refresh(self, component, verb): get_quotes_updater().refresh() + def _on_orient_changed(self, applet, orient): + if orient == gnomeapplet.ORIENT_RIGHT or orient == gnomeapplet.ORIENT_LEFT: + box = gtk.VBox() + else: + box = gtk.HBox() + + oldbox = self.investticker.parent + self.investticker.reparent(box) + self.tb = ToggleButton(applet, self.pw) + box.add(self.tb) + + box.show_all() + self.applet.remove(oldbox) + self.applet.add(box) + + def _on_quotes_updated(self, updater): pass #invest.dbusnotification.notify( @@ -93,10 +116,13 @@ class ToggleButton(gtk.ToggleButton): except Exception, msg: image.set_from_icon_name("stock_chart", gtk.ICON_SIZE_BUTTON) - hbox = gtk.HBox() - hbox.pack_start(image) - orient = applet.get_orient() + if orient == gnomeapplet.ORIENT_RIGHT or orient == gnomeapplet.ORIENT_LEFT: + box = gtk.VBox() + else: + box = gtk.HBox() + + box.pack_start(image) arrow_dir = gtk.ARROW_DOWN if orient == gnomeapplet.ORIENT_RIGHT: arrow_dir = gtk.ARROW_RIGHT @@ -107,9 +133,9 @@ class ToggleButton(gtk.ToggleButton): elif orient == gnomeapplet.ORIENT_UP: arrow_dir = gtk.ARROW_UP - hbox.pack_start(gtk.Arrow(arrow_dir, gtk.SHADOW_NONE)) + box.pack_start(gtk.Arrow(arrow_dir, gtk.SHADOW_NONE)) - self.add(hbox) + self.add(box) def toggled(self, togglebutton): if togglebutton.get_active():