[Sugar-devel] [DESIGN] [PATCH sugar] Speaker frame device: pop up palette on left-click instead of toggling mute

Sascha Silbe silbe at activitycentral.com
Sat Feb 12 13:27:37 EST 2011


Reports from the field indicate that users accidently left-click the Speaker
icon and don't realise it got muted. By popping up the palette we enable them
to explicitly choose the mute action without instead of surprising them by
automatically executing one of the secondary actions (there is no primary
action).

Signed-off-by: Sascha Silbe <silbe at activitycentral.com>
---
 extensions/deviceicon/speaker.py |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/extensions/deviceicon/speaker.py b/extensions/deviceicon/speaker.py
index b6e33d8..d396bfb 100644
--- a/extensions/deviceicon/speaker.py
+++ b/extensions/deviceicon/speaker.py
@@ -76,12 +76,12 @@ class DeviceView(TrayIcon):
         self.icon.props.xo_color = xo_color

     def __button_release_event_cb(self, widget, event):
-        if event.button == 1:
-            self._model.props.muted = not self._model.props.muted
-            return True
-        else:
+        if event.button != 1:
             return False

+        self.palette_invoker.notify_right_click()
+        return True
+
     def __expose_event_cb(self, *args):
         self._update_info()

--
1.7.2.3



More information about the Sugar-devel mailing list