Use ibus.ORIENTATION_* in panel.py
authorPeng Huang <shawn.p.huang@gmail.com>
Fri, 1 Jan 2010 11:25:54 +0000 (19:25 +0800)
committerPeng Huang <shawn.p.huang@gmail.com>
Fri, 1 Jan 2010 11:25:54 +0000 (19:25 +0800)
ui/gtk/panel.py

index 555960f..2632545 100644 (file)
@@ -256,12 +256,11 @@ class Panel(ibus.PanelBase):
 
     def __config_load_lookup_table_orientation(self):
         value = self.__config.get_value("panel", "lookup_table_orientation", 0)
-        if value != 0 and value != 1:
-            value = 0
-        if value == 0:
-            self.__candidate_panel.set_orientation(gtk.ORIENTATION_HORIZONTAL)
+        if value in (ibus.ORIENTATION_HORIZONTAL, ibus.ORIENTATION_VERTICAL):
+            orientation = value
         else:
-            self.__candidate_panel.set_orientation(gtk.ORIENTATION_VERTICAL)
+            orientation = ibus.ORIENTATION_HORIZONTAL
+        self.__candidate_panel.set_orientation(orientation)
 
     def __config_load_show(self):
         show = self.__config.get_value("panel", "show", 1)