From 583ea4214d62cb657c3745a77df41cc744999cc3 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 5 Mar 2007 12:00:51 +0100 Subject: [PATCH 1/4] Improve the demo entries --- services/datastore/demodata.py | 64 +++++++++++++++++++--------------- tools/build-snapshot.sh | 2 +- 2 files changed, 37 insertions(+), 29 deletions(-) diff --git a/services/datastore/demodata.py b/services/datastore/demodata.py index 61e6a40e..c5ff1360 100644 --- a/services/datastore/demodata.py +++ b/services/datastore/demodata.py @@ -8,8 +8,8 @@ def insert_demo_data(data_store): os.makedirs(journal_dir, 0755) data = [ - { 'file-path' : os.path.join(journal_dir, 'fishes_in_the_sea.rtf'), - 'object-type' : 'text', + { 'file-path' : os.path.join(journal_dir, 'fishes_in_the_sea.history'), + 'object-type' : 'link', 'date' : str(time.time() - 100000), 'title' : 'Fishes in the Sea', 'preview' : 'There are many fishes in the sea, and not only...', @@ -19,20 +19,22 @@ def insert_demo_data(data_store): 'buddies' : str([ { 'name' : 'Marco', 'color' : '#C2B00C,#785C78' }, { 'name' : 'Dan', - 'color' : '#75C228,#3A6E3A' } ]) + 'color' : '#75C228,#3A6E3A' }, + { 'name' : 'Blizzard', + 'color' : '#472E17,#AB3DAB' } ]) }, - { 'file-path' : os.path.join(journal_dir, 'my_cat_and_my_fishes.rtf'), - 'object-type' : 'text', + { 'file-path' : os.path.join(journal_dir, 'my_cat_and_my_fishes.jpeg'), + 'object-type' : 'picture', 'date' : str(time.time() - 200000), 'title' : 'My cat and my fishes', 'preview' : "Don't know why, but my cat looks to like my fishe...", 'icon' : 'theme:object-text', - 'icon-color' : '#C2B00C,#785C78', + 'icon-color' : '#472E17, #AB3DAB', 'keep' : '1', - 'buddies' : str([ { 'name' : 'Eben', - 'color' : '#C2B00C,#785C78' }, + 'buddies' : str([ { 'name' : 'Blizzard', + 'color' : '#472E17,#AB3DAB' }, { 'name' : 'Dan', - 'color' : '#75C228,#3A6E3A' } ]) + 'color' : '#75C228,#3A6E3A' } ]) }, { 'file-path' : os.path.join(journal_dir, 'cat_browsing.hist'), 'object-type' : 'link', @@ -40,11 +42,24 @@ def insert_demo_data(data_store): 'title' : 'About cats', 'preview' : "http://en.wikipedia.org/wiki/Cat", 'icon' : 'theme:object-link', - 'icon-color' : '#C2B00C,#785C78', + 'icon-color' : '#6E3D1E,#F8C2F8', 'keep' : '0', + 'buddies' : str([ { 'name' : 'Tomeu', + 'color' : '#6E3D1E,#F8C2F8' }, + { 'name' : 'Eben', + 'color' : '#193828,#216E21' }, + { 'name' : 'Dan', + 'color' : '#75C228,#3A6E3A' } ]) + }, + { 'file-path' : os.path.join(journal_dir, 'thai_story.hist'), + 'object-type' : 'link', + 'date' : str(time.time() - 450000), + 'title' : 'Thai history', + 'preview' : "The history of Thailand begins with the migration of the Thais from their ancestoral home in southern China into mainland southeast asia around the 10th century AD.", + 'icon' : 'theme:object-text', + 'icon-color' : '#75C228,#3A6E3A', + 'keep' : '1', 'buddies' : str([ { 'name' : 'Dan', - 'color' : '#C2B00C,#785C78' }, - { 'name' : 'Tomeu', 'color' : '#75C228,#3A6E3A' } ]) }, { 'file-path' : os.path.join(journal_dir, 'our_school.jpeg'), @@ -57,30 +72,23 @@ def insert_demo_data(data_store): 'keep' : '0', 'buddies' : str([ { 'name' : 'Marco', 'color' : '#C2B00C,#785C78' }, - { 'name' : 'Eben', + { 'name' : 'Dan', 'color' : '#75C228,#3A6E3A' } ]) }, - { 'file-path' : os.path.join(journal_dir, 'thai_story.abw'), - 'object-type' : 'text', - 'date' : str(time.time() - 450000), - 'title' : 'Thai history', - 'preview' : "The history of Thailand begins with the migration of the Thais from their ancestoral home in southern China into mainland southeast asia around the 10th century AD.", - 'icon' : 'theme:object-text', - 'icon-color' : '#C2B00C,#785C78', - 'keep' : '1', - 'buddies' : str([ { 'name' : 'Marco', - 'color' : '#C2B00C,#785C78' } ]) - }, { 'file-path' : os.path.join(journal_dir, 'thai_prince.abw'), - 'object-type' : 'text', - 'date' : str(time.time() - 450000), + 'object-type' : 'link', + 'date' : str(time.time() - 450000), 'title' : 'The Thai Prince', 'preview' : "Prince Dipangkara Rasmijoti of Thailand, (born 29 April 2005), is a member of the Thailand Royal Family, a grandson of King Bhumibol Adulyadej (Rama IX) of Thailand is the fifth son of Maha Vajiralongkorn, Crown Prince of Thailand.", 'icon' : 'theme:object-text', - 'icon-color' : '#C2B00C,#785C78', + 'icon-color' : '#193828,#216E21', 'keep' : '0', 'buddies' : str([ { 'name' : 'Eben', - 'color' : '#75C228,#3A6E3A' } ]) + 'color' : '#193828,#216E21' }, + { 'name' : 'Dan', + 'color' : '#75C228,#3A6E3A' }, + { 'name' : 'Blizzard', + 'color' : '#472E17,#AB3DAB' } ]) } ] for obj in data: diff --git a/tools/build-snapshot.sh b/tools/build-snapshot.sh index c4cce41a..637773ef 100755 --- a/tools/build-snapshot.sh +++ b/tools/build-snapshot.sh @@ -1,6 +1,6 @@ VERSION=0.63 DATE=`date +%Y%m%d` -RELEASE=2.36 +RELEASE=2.38 TARBALL=sugar-$VERSION-$RELEASE.${DATE}git.tar.bz2 rm sugar-$VERSION.tar.bz2 From 52ca451a05ab7ec0856ba8fa193f0265d0c0debf Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 5 Mar 2007 12:05:13 +0100 Subject: [PATCH 2/4] More fake entries improvements --- services/datastore/demodata.py | 36 +++++++++++++++++----------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/services/datastore/demodata.py b/services/datastore/demodata.py index c5ff1360..07b64d20 100644 --- a/services/datastore/demodata.py +++ b/services/datastore/demodata.py @@ -8,27 +8,12 @@ def insert_demo_data(data_store): os.makedirs(journal_dir, 0755) data = [ - { 'file-path' : os.path.join(journal_dir, 'fishes_in_the_sea.history'), - 'object-type' : 'link', - 'date' : str(time.time() - 100000), - 'title' : 'Fishes in the Sea', - 'preview' : 'There are many fishes in the sea, and not only...', - 'icon' : 'theme:object-text', - 'icon-color' : '#C2B00C,#785C78', - 'keep' : '0', - 'buddies' : str([ { 'name' : 'Marco', - 'color' : '#C2B00C,#785C78' }, - { 'name' : 'Dan', - 'color' : '#75C228,#3A6E3A' }, - { 'name' : 'Blizzard', - 'color' : '#472E17,#AB3DAB' } ]) - }, { 'file-path' : os.path.join(journal_dir, 'my_cat_and_my_fishes.jpeg'), 'object-type' : 'picture', 'date' : str(time.time() - 200000), 'title' : 'My cat and my fishes', 'preview' : "Don't know why, but my cat looks to like my fishe...", - 'icon' : 'theme:object-text', + 'icon' : 'theme:object-image', 'icon-color' : '#472E17, #AB3DAB', 'keep' : '1', 'buddies' : str([ { 'name' : 'Blizzard', @@ -56,7 +41,7 @@ def insert_demo_data(data_store): 'date' : str(time.time() - 450000), 'title' : 'Thai history', 'preview' : "The history of Thailand begins with the migration of the Thais from their ancestoral home in southern China into mainland southeast asia around the 10th century AD.", - 'icon' : 'theme:object-text', + 'icon' : 'theme:object-link', 'icon-color' : '#75C228,#3A6E3A', 'keep' : '1', 'buddies' : str([ { 'name' : 'Dan', @@ -80,7 +65,7 @@ def insert_demo_data(data_store): 'date' : str(time.time() - 450000), 'title' : 'The Thai Prince', 'preview' : "Prince Dipangkara Rasmijoti of Thailand, (born 29 April 2005), is a member of the Thailand Royal Family, a grandson of King Bhumibol Adulyadej (Rama IX) of Thailand is the fifth son of Maha Vajiralongkorn, Crown Prince of Thailand.", - 'icon' : 'theme:object-text', + 'icon' : 'theme:object-link', 'icon-color' : '#193828,#216E21', 'keep' : '0', 'buddies' : str([ { 'name' : 'Eben', @@ -89,6 +74,21 @@ def insert_demo_data(data_store): 'color' : '#75C228,#3A6E3A' }, { 'name' : 'Blizzard', 'color' : '#472E17,#AB3DAB' } ]) + }, + { 'file-path' : os.path.join(journal_dir, 'fishes_in_the_sea.history'), + 'object-type' : 'picture', + 'date' : str(time.time() - 100000), + 'title' : 'Fishes in the Sea', + 'preview' : 'There are many fishes in the sea, and not only...', + 'icon' : 'theme:object-image', + 'icon-color' : '#C2B00C,#785C78', + 'keep' : '0', + 'buddies' : str([ { 'name' : 'Marco', + 'color' : '#C2B00C,#785C78' }, + { 'name' : 'Dan', + 'color' : '#75C228,#3A6E3A' }, + { 'name' : 'Blizzard', + 'color' : '#472E17,#AB3DAB' } ]) } ] for obj in data: From 5ae521be777cec863fcd5e2e838a3e41daa4c7af Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 5 Mar 2007 12:29:52 +0100 Subject: [PATCH 3/4] Fix aligment of menu icons --- sugar/graphics/menu.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sugar/graphics/menu.py b/sugar/graphics/menu.py index 0fd99495..adafd533 100644 --- a/sugar/graphics/menu.py +++ b/sugar/graphics/menu.py @@ -42,11 +42,11 @@ class MenuItem(hippo.CanvasBox): self._action_id = action_id self.props.padding = 5 - self.props.spacing = 5 if icon_name: icon = CanvasIcon(icon_name=icon_name, - scale=units.SMALL_ICON_SCALE) + scale=units.SMALL_ICON_SCALE, + box_width=units.microgrid_to_pixels(3)) if icon_color: icon.props.xo_color = icon_color self.append(icon) From 5cc06cb5ebaba91a272b34082de21166809cf742 Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Mon, 5 Mar 2007 12:43:32 +0100 Subject: [PATCH 4/4] Tweak optionmenu and entry paddings --- sugar/graphics/entry.py | 1 + sugar/graphics/optionmenu.py | 2 +- sugar/graphics/roundbox.py | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/sugar/graphics/entry.py b/sugar/graphics/entry.py index 40604bb4..ad92d0f6 100644 --- a/sugar/graphics/entry.py +++ b/sugar/graphics/entry.py @@ -58,6 +58,7 @@ class Entry(hippo.CanvasBox, hippo.CanvasItem): self._round_box = RoundBox() self._round_box.props.border_color = color.FRAME_BORDER.get_int() + self._round_box.props.padding = units.points_to_pixels(2) self.append(self._round_box, hippo.PACK_EXPAND) self._canvas_widget = hippo.CanvasWidget() diff --git a/sugar/graphics/optionmenu.py b/sugar/graphics/optionmenu.py index 335956e9..3ffaf4af 100644 --- a/sugar/graphics/optionmenu.py +++ b/sugar/graphics/optionmenu.py @@ -66,7 +66,7 @@ class OptionMenu(hippo.CanvasBox, hippo.CanvasItem): self._round_box = RoundBox() self._round_box.props.border_color = color.FRAME_BORDER.get_int() self._round_box.props.spacing = units.points_to_pixels(3) - self._round_box.props.padding = units.points_to_pixels(1) + self._round_box.props.padding = units.points_to_pixels(3) self.append(self._round_box, hippo.PACK_EXPAND) self._canvas_text = hippo.CanvasText(text=_('No options'), diff --git a/sugar/graphics/roundbox.py b/sugar/graphics/roundbox.py index 160bccb6..f638a442 100644 --- a/sugar/graphics/roundbox.py +++ b/sugar/graphics/roundbox.py @@ -25,7 +25,7 @@ from sugar.graphics import color class RoundBox(hippo.CanvasBox, hippo.CanvasItem): __gtype_name__ = 'SugarRoundBox' - _BORDER_DEFAULT = 2.0 + _BORDER_DEFAULT = units.points_to_pixels(1.0) def __init__(self, **kwargs): hippo.CanvasBox.__init__(self, **kwargs)