From 0ef5c4b8917bade623681cf8fa5ff040aca12279 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 24 Sep 2007 20:04:45 +0000 Subject: Add arrows on the homepage to hint about frame activation. --- diff --git a/NEWS b/NEWS index 9aa7c52..47c999a 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,4 @@ +* #2674 Add arrows to hint about the frame corner activation (marco) * #2665 Re-arrange device icons in a line at the bottom (marco) * #3378 Support changes in activity scope (incomplete!) (smcv, marco) * #3081, #3497, #3485 Fix palette sizing and widget placement (benzea) diff --git a/configure.ac b/configure.ac index 5b4f366..fc80886 100644 --- a/configure.ac +++ b/configure.ac @@ -50,6 +50,7 @@ AC_OUTPUT([ Makefile bin/Makefile data/Makefile +data/icons/Makefile lib/Makefile lib/ui/Makefile services/Makefile diff --git a/data/Makefile.am b/data/Makefile.am index addfb59..400186e 100644 --- a/data/Makefile.am +++ b/data/Makefile.am @@ -1,3 +1,5 @@ +SUBDIRS = icons + sugar.gtkrc: gtkrc.em $(srcdir)/em.py -D theme=\'sugar\' $(srcdir)/gtkrc.em > \ $(top_builddir)/data/sugar.gtkrc diff --git a/data/icons/Makefile.am b/data/icons/Makefile.am new file mode 100644 index 0000000..87d79b0 --- /dev/null +++ b/data/icons/Makefile.am @@ -0,0 +1,6 @@ +iconsdir = $(pkgdatadir)/data/icons +icons_DATA = \ + arrow_NE.svg \ + arrow_NW.svg \ + arrow_SE.svg \ + arrow_SW.svg diff --git a/data/icons/arrow_NE.svg b/data/icons/arrow_NE.svg new file mode 100644 index 0000000..e06363d --- /dev/null +++ b/data/icons/arrow_NE.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/data/icons/arrow_NW.svg b/data/icons/arrow_NW.svg new file mode 100644 index 0000000..d02978a --- /dev/null +++ b/data/icons/arrow_NW.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/data/icons/arrow_SE.svg b/data/icons/arrow_SE.svg new file mode 100644 index 0000000..0a5d024 --- /dev/null +++ b/data/icons/arrow_SE.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/data/icons/arrow_SW.svg b/data/icons/arrow_SW.svg new file mode 100644 index 0000000..5e712e2 --- /dev/null +++ b/data/icons/arrow_SW.svg @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/shell/sugar-shell b/shell/sugar-shell index 63225fc..0ecc4eb 100755 --- a/shell/sugar-shell +++ b/shell/sugar-shell @@ -101,6 +101,9 @@ def main(): _start_matchbox() _setup_translations() + icons_path = env.get_data_path('icons') + gtk.icon_theme_get_default().append_search_path(icons_path) + # Do initial setup if needed if not get_profile().is_valid(): win = intro.IntroWindow() diff --git a/shell/view/home/HomeBox.py b/shell/view/home/HomeBox.py index 79628ba..69a277b 100644 --- a/shell/view/home/HomeBox.py +++ b/shell/view/home/HomeBox.py @@ -28,6 +28,7 @@ from hardware import hardwaremanager from sugar.graphics import style from sugar.graphics.xocolor import XoColor from sugar.graphics.palette import Palette, CanvasInvoker +from sugar.graphics.icon import CanvasIcon from sugar import profile from sugar import env @@ -46,24 +47,55 @@ class HomeBox(hippo.CanvasBox, hippo.CanvasItem): shell_model = shell.get_model() - top_box = hippo.CanvasBox(box_height=style.GRID_CELL_SIZE) + top_box = hippo.CanvasBox(yalign=hippo.ALIGNMENT_START, + box_height=style.GRID_CELL_SIZE, + orientation=hippo.ORIENTATION_HORIZONTAL) self.append(top_box, hippo.PACK_EXPAND) + nw_arrow = CanvasIcon(icon_name='arrow_NW', + xalign=hippo.ALIGNMENT_START) + top_box.append(nw_arrow) + + arrows_separator = hippo.CanvasBox() + top_box.append(arrows_separator, hippo.PACK_EXPAND) + + ne_arrow = CanvasIcon(icon_name='arrow_NE', + xalign=hippo.ALIGNMENT_END) + top_box.append(ne_arrow) + self._donut = ActivitiesDonut(shell) self.append(self._donut) bottom_box = hippo.CanvasBox(yalign=hippo.ALIGNMENT_END, - box_height=style.GRID_CELL_SIZE) + box_height=style.GRID_CELL_SIZE, + orientation=hippo.ORIENTATION_HORIZONTAL) self.append(bottom_box, hippo.PACK_EXPAND) self._my_icon = _MyIcon(shell, style.XLARGE_ICON_SIZE) self.append(self._my_icon, hippo.PACK_FIXED) + sw_arrow = CanvasIcon(icon_name='arrow_SW', + xalign=hippo.ALIGNMENT_START) + bottom_box.append(sw_arrow) + devices_box = _DevicesBox(shell_model.get_devices()) - bottom_box.append(devices_box) + bottom_box.append(devices_box, hippo.PACK_EXPAND) + + se_arrow = CanvasIcon(icon_name='arrow_SE', + xalign=hippo.ALIGNMENT_END) + bottom_box.append(se_arrow) + + self._arrows = [ nw_arrow, ne_arrow, sw_arrow, se_arrow ] shell_model.connect('notify::state', self._shell_state_changed_cb) + shell_model.connect('notify::zoom-level', + self._shell_zoom_level_changed_cb) + + def _shell_zoom_level_changed_cb(self, model, pspec): + for arrow in self._arrows: + arrow.destroy() + self._arrows = [] def _shell_state_changed_cb(self, model, pspec): # FIXME implement this -- cgit v0.9.1