[Sugar-devel] [PATCH] When a object is removed from the clipboard try, select the last available - SL #1266

godiard at sugarlabs.org godiard at sugarlabs.org
Thu Apr 19 10:27:01 EDT 2012


From: Gonzalo Odiard <godiard at gmail.com>

Signed-off-by: Gonzalo Odiard <gonzalo at laptop.org>
---
 src/jarabe/frame/clipboardtray.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/jarabe/frame/clipboardtray.py b/src/jarabe/frame/clipboardtray.py
index e78ef4a..b1426c4 100644
--- a/src/jarabe/frame/clipboardtray.py
+++ b/src/jarabe/frame/clipboardtray.py
@@ -124,6 +124,11 @@ class ClipboardTray(tray.VTray):
         icon = self._icons[object_id]
         self.remove_item(icon)
         del self._icons[object_id]
+        # select the last available icon
+        if len(self._icons) > 0:
+            n_icons = len(self.get_children())
+            last_icon = self.get_children()[n_icons - 1]
+            last_icon.props.active = True
         logging.debug('ClipboardTray: %r was deleted', object_id)
 
     def _object_selected_cb(self, cb_service, object_id):
-- 
1.7.7.6



More information about the Sugar-devel mailing list