Commits

Ali Afshar committed ff628dd

fixed opening new tab while floating pane is open

Comments (0)

Files changed (2)

pida/ui/pygtkdock/multipane.py

     def _on_tab_clicked(self, button):
         self.emit('suggest-raise')
 
+    def _on_tab_button(self, tab_label, event):
+        print event.button
+        if event.button == 3:
+            return True
+        
+
     def _on_page_added(self, nb, child, pagenum):
         
         view = child.view
         b.page = child
 
         nb.set_tab_label(child, b)
+
+        b.connect('button-press-event', self._on_tab_button)
         #self.emit('suggest-raise')
 
         b = gtk.RadioButton(self._original_button)

pida/ui/pygtkdock/tray.py

         self.is_sticky = True
         self.is_visible = False
 
+        self.set_property('can-focus', True)
+
+
+    def _on_focus_out(self, bar, event):
+        print 'fp'
     # gtk.Container
     def do_set_focus_child(self, child):
         if child is self.buttons:
         """Add the bar widget to the pane"""
         self.bar = widget
         self.bar.connect('suggest-raise', self._on_bar_raise)
+        self.bar.add_events(gtk.gdk.FOCUS_CHANGE_MASK)
+        self.bar.connect('focus-out-event', self._on_focus_out)
         widget.set_parent(self)
 
     def _on_bar_raise(self, bar):
         if self.is_visible:
             l = self.orient.calculate_bar_position(alloc)
         else:
-            l = self.orient.calculate_bar_hidden(alloc, self.bar.size_request())
+            l = self.orient.calculate_bar_hidden(alloc, self.bar.books[0].tabs.size_request())
         self.bar_window.move_resize(*l)
         self.bar.size_allocate((0, 0, l[2], l[3]))
         self.bar_window.show()
         if self.is_sticky and self.is_visible:
             l = self.orient.calculate_main_sticky(alloc)
         else:
-            l = self.orient.calculate_main_unsticky(alloc, self.bar.size_request())
+            l = self.orient.calculate_main_unsticky(alloc, self.bar.books[0].tabs.size_request())
 
         self.main_window.move_resize(*l)
         self.main.size_allocate((0, 0, l[2], l[3]))