deskbar-applet r2096 - in branches/gnome-2-22: . deskbar/ui



Author: sebp
Date: Fri Apr 11 11:12:11 2008
New Revision: 2096
URL: http://svn.gnome.org/viewvc/deskbar-applet?rev=2096&view=rev

Log:
Fixed bug #520278: Window in sticky mode too small


Modified:
   branches/gnome-2-22/ChangeLog
   branches/gnome-2-22/deskbar/ui/CuemiacAlignedView.py

Modified: branches/gnome-2-22/deskbar/ui/CuemiacAlignedView.py
==============================================================================
--- branches/gnome-2-22/deskbar/ui/CuemiacAlignedView.py	(original)
+++ branches/gnome-2-22/deskbar/ui/CuemiacAlignedView.py	Fri Apr 11 11:12:11 2008
@@ -22,6 +22,9 @@
     results window is aligned to the gnome panel.
     """
     
+    VBOX_MAIN_SPACING = 12
+    VBOX_MAIN_BORDER_WIDTH = 6
+    
     def __init__(self, controller, model, widget, applet):
         deskbar.interfaces.View.__init__(self, controller, model)
         CuemiacAlignedWindow.__init__(self, widget, applet)
@@ -53,8 +56,8 @@
         self._model.connect("query-ready", lambda s,m: gobject.idle_add(self.append_matches, s, m))
         
         # VBox 
-        self.vbox_main = gtk.VBox(spacing=12)
-        self.vbox_main.set_border_width(6)
+        self.vbox_main = gtk.VBox(spacing=self.VBOX_MAIN_SPACING)
+        self.vbox_main.set_border_width(self.VBOX_MAIN_BORDER_WIDTH)
         self.add(self.vbox_main)
         self.vbox_main.show()
         
@@ -228,7 +231,8 @@
             # Display default icon in entry
             self.update_entry_icon()
         self.treeview_model.append (matches, self.entry.get_text())
-        self.__adjust_popup_size ()
+        # Wait a little bit to resize, otherwise we get a size that's too small
+        gobject.timeout_add(200, self.__adjust_popup_size)
         
     def set_sensitive (self, active):
         """
@@ -281,11 +285,19 @@
         """adjust window size to the size of the children"""
         # FIXME: Should we handle width intelligently also?
         w, h = self.cview.size_request ()
-        h = h + self.header.allocation.height + 2 # To ensure we don't always show scrollbars
+        # To ensure we don't always show scrollbars
+        h += self.header.allocation.height + self.history_box.allocation.height
+        # Spacing between header and history_box and between history_box and results_box
+        h += 2*self.VBOX_MAIN_SPACING
+        # Border at the top and the bottom
+        h += 2*self.VBOX_MAIN_BORDER_WIDTH
+        # Some additional space
+        h += 5 
         h = min (h, self._max_window_height)
         w = min (w, self._max_window_width)
         if w > 0 and h > 0:
             self.resize (w, h)
+        return False
     
     def __set_layout_by_orientation (self, orient):
         """



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]