Add arrows on the homepage to hint about frame activation.

This commit is contained in:
Marco Pesenti Gritti 2007-09-24 22:04:45 +02:00
parent a8969d776f
commit 0ef5c4b891
10 changed files with 76 additions and 3 deletions

1
NEWS
View File

@ -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)

View File

@ -50,6 +50,7 @@ AC_OUTPUT([
Makefile
bin/Makefile
data/Makefile
data/icons/Makefile
lib/Makefile
lib/ui/Makefile
services/Makefile

View File

@ -1,3 +1,5 @@
SUBDIRS = icons
sugar.gtkrc: gtkrc.em
$(srcdir)/em.py -D theme=\'sugar\' $(srcdir)/gtkrc.em > \
$(top_builddir)/data/sugar.gtkrc

6
data/icons/Makefile.am Normal file
View File

@ -0,0 +1,6 @@
iconsdir = $(pkgdatadir)/data/icons
icons_DATA = \
arrow_NE.svg \
arrow_NW.svg \
arrow_SE.svg \
arrow_SW.svg

7
data/icons/arrow_NE.svg Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg enable-background="new 0 0 55 55" height="55px" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px"><g display="block" id="arrow_x5F_NE">
<g display="inline">
<g>
<path d="M20.154,15.718c-0.896,0-1.794,0.344-2.481,1.028c-1.373,1.372-1.373,3.598,0,4.969c0.686,0.686,1.585,1.026,2.481,1.026 h7.137L16.745,33.29c-0.633,0.635-1.026,1.514-1.029,2.482c0.003,1.939,1.576,3.512,3.514,3.512c0.972,0,1.848-0.395,2.483-1.028 l10.546-10.545v7.136c0,0.898,0.342,1.799,1.029,2.482c1.369,1.373,3.595,1.371,4.965,0c0.687-0.686,1.028-1.588,1.031-2.482 V15.716L20.154,15.718z"/>
</g>
</g>
</g></svg>

After

Width:  |  Height:  |  Size: 839 B

7
data/icons/arrow_NW.svg Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg enable-background="new 0 0 55 55" height="55px" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px"><g display="block" id="arrow_x5F_NW">
<g display="inline">
<g>
<path d="M38.255,33.287L27.71,22.741h7.136c0.898,0,1.799-0.342,2.482-1.029c1.373-1.369,1.371-3.595,0-4.965 c-0.686-0.687-1.588-1.029-2.482-1.031H15.715l0.002,19.13c0,0.896,0.344,1.794,1.028,2.481c1.372,1.373,3.598,1.373,4.969,0 c0.686-0.686,1.026-1.585,1.026-2.481v-7.137L33.29,38.255c0.635,0.633,1.514,1.026,2.482,1.029 c1.939-0.003,3.512-1.576,3.512-3.514C39.284,34.799,38.889,33.923,38.255,33.287z"/>
</g>
</g>
</g></svg>

After

Width:  |  Height:  |  Size: 845 B

7
data/icons/arrow_SE.svg Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg enable-background="new 0 0 55 55" height="55px" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px"><g display="block" id="arrow_x5F_SE">
<g display="inline">
<g>
<path d="M39.282,20.154c0-0.896-0.344-1.794-1.028-2.481c-1.372-1.373-3.598-1.373-4.969,0c-0.686,0.686-1.026,1.585-1.026,2.481 v7.137L21.709,16.745c-0.635-0.633-1.514-1.026-2.482-1.029c-1.939,0.003-3.512,1.576-3.512,3.514 c0,0.972,0.395,1.848,1.028,2.483l10.545,10.546h-7.136c-0.898,0-1.799,0.342-2.482,1.029c-1.373,1.369-1.371,3.595,0,4.965 c0.686,0.687,1.588,1.028,2.482,1.031h19.131L39.282,20.154z"/>
</g>
</g>
</g></svg>

After

Width:  |  Height:  |  Size: 844 B

7
data/icons/arrow_SW.svg Normal file
View File

@ -0,0 +1,7 @@
<?xml version="1.0" ?><!DOCTYPE svg PUBLIC '-//W3C//DTD SVG 1.1//EN' 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd'><svg enable-background="new 0 0 55 55" height="55px" version="1.1" viewBox="0 0 55 55" width="55px" x="0px" xml:space="preserve" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" y="0px"><g display="block" id="arrow_x5F_SW">
<g>
<g>
<path d="M34.845,32.259h-7.137L38.254,21.71c0.633-0.635,1.026-1.514,1.029-2.482c-0.003-1.939-1.576-3.512-3.514-3.512 c-0.972,0-1.848,0.395-2.483,1.028L22.741,27.289v-7.136c0-0.898-0.342-1.799-1.029-2.482c-1.369-1.373-3.595-1.371-4.965,0 c-0.687,0.686-1.029,1.588-1.031,2.482v19.131l19.13-0.002c0.896,0,1.794-0.344,2.481-1.028c1.373-1.372,1.373-3.598,0-4.969 C36.641,32.6,35.742,32.259,34.845,32.259z"/>
</g>
</g>
</g></svg>

After

Width:  |  Height:  |  Size: 827 B

View File

@ -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()

View File

@ -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