diff options
Diffstat (limited to 'tray.py')
-rw-r--r-- | tray.py | 46 |
1 files changed, 25 insertions, 21 deletions
@@ -48,7 +48,8 @@ class _TrayViewport(Gtk.Viewport): self.add(self.traybar) self.traybar.show() - self.connect('size_allocate', self._size_allocate_cb) + # FIXME: It is necessary to re implement + #self.connect('size_allocate', self._size_allocate_cb) def scroll(self, direction): @@ -92,37 +93,39 @@ class _TrayViewport(Gtk.Viewport): adj = self.get_vadjustment() new_value = adj.get_value() - self.allocation.height adj.set_value(max(adj.get_lower(), new_value)) - - def _size_allocate_cb(self, widget, requisition): + + # FIXME: It is necessary to re implement + #def _size_allocate_cb(self, widget, requisition): - child_requisition = self.get_child().size_request() + # child_requisition = self.get_child().size_request() - if self.orientation == Gtk.Orientation.HORIZONTAL: - requisition.width = 0 - requisition.height = child_requisition.height + # if self.orientation == Gtk.Orientation.HORIZONTAL: + # requisition.width = 0 + # requisition.height = child_requisition.height - else: - requisition.width = child_requisition.width - requisition.height = 0 + # else: + # requisition.width = child_requisition.width + # requisition.height = 0 def do_get_property(self, pspec): if pspec.name == 'can-scroll': return self._can_scroll - - def do_size_allocate(self, allocation): + + # FIXME: It is necessary to re implement + # def do_size_allocate(self, allocation): - bar_requisition = self.traybar.get_child_requisition() + # bar_requisition = self.traybar.get_child_requisition() - if self.orientation == Gtk.Orientation.HORIZONTAL: - can_scroll = bar_requisition.width > allocation.width + # if self.orientation == Gtk.Orientation.HORIZONTAL: + # can_scroll = bar_requisition.width > allocation.width - else: - can_scroll = bar_requisition.height > allocation.height + # else: + # can_scroll = bar_requisition.height > allocation.height - if can_scroll != self._can_scroll: - self._can_scroll = can_scroll - self.notify('can-scroll') + # if can_scroll != self._can_scroll: + # self._can_scroll = can_scroll + # self.notify('can-scroll') class _TrayScrollButton(Gtk.Button): @@ -216,7 +219,8 @@ class HTray(Gtk.Box): def remove_item(self, item): - self._viewport.traybar.remove(item) + # self._viewport.traybar.remove(item) If the widget is destroyed it is not necessary. + item.destroy() def get_item_index(self, item): |