Use Viewport in candidate window.
authorHuang Peng <shawn.p.huang@gmail.com>
Mon, 11 Aug 2008 09:06:54 +0000 (17:06 +0800)
committerHuang Peng <shawn.p.huang@gmail.com>
Mon, 11 Aug 2008 09:06:54 +0000 (17:06 +0800)
panel/candidatepanel.py

index e26667ee05b8728dbc9c151a94b0b7d52cb7c1c8..09aa7bcc85c05de7e30712b9e9abfc9b4b86a765 100644 (file)
@@ -133,7 +133,10 @@ class CandidatePanel(gtk.VBox):
         self.__tooltips = gtk.Tooltips()
 
         self.__toplevel = gtk.Window(gtk.WINDOW_POPUP)
-        self.__toplevel.add(self)
+        self.__viewport = gtk.Viewport()
+        self.__viewport.set_shadow_type(gtk.SHADOW_IN)
+        self.__toplevel.add(self.__viewport)
+        self.__viewport.add(self)
         self.__toplevel.add_events(
             gdk.BUTTON_PRESS_MASK | \
             gdk.BUTTON_RELEASE_MASK | \
@@ -392,17 +395,17 @@ class CandidatePanel(gtk.VBox):
         else:
             return gtk.DrawingArea.do_get_property(property)
 
-    def do_expose_event(self, event):
-        self.style.paint_box(self.window,
-                    gtk.STATE_NORMAL,
-                    gtk.SHADOW_IN,
-                    event.area,
-                    self,
-                    "menu",
-                    self.allocation.x, self.allocation.y,
-                    self.allocation.width, self.allocation.height)
-
-        gtk.VBox.do_expose_event(self, event)
+    def do_expose_event(self, event):
+        self.style.paint_box(self.window,
+                    gtk.STATE_NORMAL,
+                    gtk.SHADOW_IN,
+                    event.area,
+                    self,
+    #                 "panel",
+                    self.allocation.x, self.allocation.y,
+                    self.allocation.width, self.allocation.height)
+
+        gtk.VBox.do_expose_event(self, event)
 
     def do_size_request(self, requisition):
         gtk.VBox.do_size_request(self, requisition)