Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/webactivity.py
diff options
context:
space:
mode:
authorManuel Kaufmann <humitos@gmail.com>2012-10-16 12:21:59 (GMT)
committer Manuel QuiƱones <manuq@laptop.org>2012-10-20 18:13:59 (GMT)
commitc9975a7c356b6c7d81473560cd7d5d611c82bfcb (patch)
tree9c1090e7fd2bfd9e5e7fe4e87dd0a135ed7fed9f /webactivity.py
parent62163497b21abfe89632df6e05ef01fe9902b016 (diff)
Touch: Get out of activity fullscreen mode SL #4013
Show the Unfullscreen button (with a timeout to hide it) when the user clicks over the canvas. Signed-off-by: Manuel Kaufmann <humitos@gmail.com> Acked-by: Manuel QuiƱones <manuq@laptop.org>
Diffstat (limited to 'webactivity.py')
-rw-r--r--webactivity.py18
1 files changed, 18 insertions, 0 deletions
diff --git a/webactivity.py b/webactivity.py
index 0fbf858..81ec4fd 100644
--- a/webactivity.py
+++ b/webactivity.py
@@ -54,6 +54,7 @@ from sugar3.graphics.icon import Icon
from sugar3 import mime
from sugar3.graphics.toolbarbox import ToolbarButton
+from sugar3.graphics.window import _UNFULLSCREEN_BUTTON_VISIBILITY_TIMEOUT
PROFILE_VERSION = 2
@@ -207,6 +208,9 @@ class WebActivity(activity.Activity):
self.model = Model()
self.model.connect('add_link', self._add_link_model_cb)
+ self.set_events(Gdk.EventMask.TOUCH_MASK)
+ self.connect('event', self.__event_cb)
+
# HACK to allow Escape key stop loading on fullscreen mode
# http://bugs.sugarlabs.org/ticket/1434
self.disconnect_by_func(self._Window__key_press_cb)
@@ -431,6 +435,20 @@ class WebActivity(activity.Activity):
def _go_home_button_cb(self, button):
self._tabbed_view.load_homepage()
+ def __event_cb(self, widget, event):
+ if self._is_fullscreen and event.type == Gdk.EventType.TOUCH_END:
+ # Show Unfullscreen button when the user clicks over the canvas
+ self._unfullscreen_button.show()
+
+ if self._unfullscreen_button_timeout_id is not None:
+ GObject.source_remove(self._unfullscreen_button_timeout_id)
+ self._unfullscreen_button_timeout_id = None
+
+ self._unfullscreen_button_timeout_id = \
+ GObject.timeout_add_seconds( \
+ _UNFULLSCREEN_BUTTON_VISIBILITY_TIMEOUT, \
+ self._Window__unfullscreen_button_timeout_cb)
+
def _key_press_cb(self, widget, event):
# HACK: this is the hacked version of
# sugar3.graphics.Window.__key_press_cb function to allow stop