gimmie r669 - in trunk: . gimmie



Author: orph
Date: Mon Feb 11 10:15:31 2008
New Revision: 669
URL: http://svn.gnome.org/viewvc/gimmie?rev=669&view=rev

Log:
2008-02-11  Alex Graveley  <alex beatniksoftware com>

	* gimmie/gimmie_awn.py: Use Awn to draw pretty title bars.
	Clicking the icon while topic window is open toggles visibility.
	Respond to icon-size changes, so the icon shrinks when many things
	are running.  Adjust border spacing a bit, and put toolbars on the
	bottom for bottom-oriented Awn.  Disable window resizing for now,
	to avoid annoying flicker.



Modified:
   trunk/ChangeLog
   trunk/gimmie/gimmie_awn.py

Modified: trunk/gimmie/gimmie_awn.py
==============================================================================
--- trunk/gimmie/gimmie_awn.py	(original)
+++ trunk/gimmie/gimmie_awn.py	Mon Feb 11 10:15:31 2008
@@ -24,10 +24,13 @@
         awn.AppletDialog.__init__(self, applet)
         TopicView.__init__(self, topic)
 
+        # Tell Awn to draw a pretty titlebar
+        self.set_title(topic.get_name())
+
         self.grab_helper = GrabOnShowHelper(self)
 
         # Contains the visual frame, giving it some space
-        self._content = gtk.VBox(False, 0)
+        self._content = gtk.VBox(False, 6)
         self._content.set_border_width(0)
         self._content.show()
         self.add(self._content)
@@ -36,8 +39,8 @@
         self._content.pack_start(self.toolbar, False, False, 0)
 
         # Hbox containing the sidebar buttons and the toolbar/iconview
-        body = gtk.HBox(False, 12)
-        body.set_border_width(12)
+        body = gtk.HBox(False, 6)
+        body.set_border_width(0)
         body.show()
         self._content.pack_start(body, True, True, 0)
 
@@ -66,7 +69,7 @@
         body.pack_start(self.content_frame, True, True, 0)
 
         # Bound the height request of the scrolled window and icon view
-        self.scroll.connect("size-request", self._scroll_get_best_size)
+        #self.scroll.connect("size-request", self._scroll_get_best_size)
         self.scroll.get_vadjustment().connect("changed",
                                               lambda adj: self.scroll.queue_resize_no_redraw())
 
@@ -142,8 +145,8 @@
         vadj.set_property("upper", 0)
 
         ### NOTE: Awn applet isn't a toplevel, it's embedded in an AppletDialog
-        w, h = self.child.size_request()
-        self.resize(w, h)
+        #w, h = self.child.size_request()
+        #self.resize(w, h)
 
     def load_items(self, items, ondone_cb = None):
         '''
@@ -242,20 +245,31 @@
         self.topic = topic
         self.topic_win = None
 
-        self.set_icon(topic.get_icon(height))
+        self.connect("height_changed", self.height_changed)
+        self.height_changed(height)
 
         self.title = awn.awn_title_get_default()
-        self.connect("button-press-event", self.button_press)
         self.connect("enter-notify-event", self.enter_notify)
         self.connect("leave-notify-event", self.leave_notify)
 
+        self.connect("button-press-event", self.button_press)
+
+    def height_changed(self, height):
+        self.set_icon(self.topic.get_icon(height))
+
     def button_press(self, widget, event):
         if not self.topic_win:
             self.topic_win = TopicBox(self, self.topic)
             self.topic.set_topic_window(self.topic_win)
-        self.title.hide(self)
-        self.topic_win.search_tool_item.entry.grab_focus()
-        self.topic_win.show_all()
+            if self.get_orientation() == 0: # bottom
+                self.topic_win.set_gravity(gtk.gdk.GRAVITY_SOUTH)
+
+        if self.topic_win.get_property("visible"):
+            self.topic_win.hide()
+        else:
+            self.title.hide(self)
+            self.topic_win.search_tool_item.entry.grab_focus()
+            self.topic_win.show_all()
 
     def enter_notify(self, widget, event):
         self.title.show(self, self.topic.get_name())



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