[Sugar-devel] [PATCH 1/2] Words: UI improvements
Rafael Ortiz
rafael at activitycentral.com
Thu Aug 25 14:43:03 EDT 2011
On Thu, Aug 25, 2011 at 12:33 PM, Manuel Quiñones <manuq at laptop.org> wrote:
> * changed "speak" strings with mouth icon
> * added scrolling to the lists of words
>
> Signed-off-by: Manuel Quiñones <manuq at laptop.org>
> ---
> pippy_app.py | 20 ++++++++++++++++----
> 1 files changed, 16 insertions(+), 4 deletions(-)
>
> diff --git a/pippy_app.py b/pippy_app.py
> index 25651f4..52750c2 100644
> --- a/pippy_app.py
> +++ b/pippy_app.py
> @@ -32,6 +32,8 @@ from activity import ViewSourceActivity
> from sugar.activity.activity import ActivityToolbox, \
> get_bundle_path, get_bundle_name
>
> +from sugar.graphics.toolbutton import ToolButton
> +
> # logging
> logger = logging.getLogger('Words')
>
> @@ -126,9 +128,13 @@ class WordsActivity(ViewSourceActivity):
> self.translated.modify_font(pango.FontDescription("Sans 14"))
>
> # Speak buttons.
> - speak1 = gtk.Button("Speak")
> + speak1 = gtk.ToolButton()
> + speak_icon1 = Icon(icon_name='microphone')
> + speak1.set_icon_widget(speak_icon1)
> speak1.connect("clicked", self.speak1_cb)
> - speak2 = gtk.Button("Speak")
> + speak2 = gtk.ToolButton()
> + speak_icon2 = Icon(icon_name='microphone')
> + speak2.set_icon_widget(speak_icon2)
> speak2.connect("clicked", self.speak2_cb)
>
> transbox.attach(label1, 0, 1, 0, 1, xoptions=gtk.FILL)
> @@ -164,6 +170,9 @@ class WordsActivity(ViewSourceActivity):
> lang1treecol = gtk.TreeViewColumn("", lang1cell, text=0)
> lang1view.get_selection().connect("changed", self.lang1sel_cb)
> lang1view.append_column(lang1treecol)
> + lang1scroll = gtk.ScrolledWindow(hadjustment=None,
> vadjustment=None)
> + lang1scroll.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
> + lang1scroll.add(lang1view)
>
> # The "lang2" box
> self.lang2model = gtk.ListStore(str)
> @@ -173,14 +182,17 @@ class WordsActivity(ViewSourceActivity):
> lang2treecol = gtk.TreeViewColumn("", lang2cell, text=0)
> lang2view.get_selection().connect("changed", self.lang2sel_cb)
> lang2view.append_column(lang2treecol)
> + lang2scroll = gtk.ScrolledWindow(hadjustment=None,
> vadjustment=None)
> + lang2scroll.set_policy(gtk.POLICY_NEVER, gtk.POLICY_AUTOMATIC)
> + lang2scroll.add(lang2view)
>
> lang1_vbox = gtk.VBox(spacing=8)
> lang1_vbox.pack_start(self.lang1combo, expand=False)
> - lang1_vbox.pack_start(lang1view)
> + lang1_vbox.pack_start(lang1scroll)
>
> lang2_vbox = gtk.VBox(spacing=8)
> lang2_vbox.pack_start(self.lang2combo, expand=False)
> - lang2_vbox.pack_start(lang2view)
> + lang2_vbox.pack_start(lang2scroll)
>
> hbox.pack_start(lang1_vbox)
> hbox.pack_start(lang2_vbox)
> --
> 1.7.4.4
>
>
Applied as
http://git.sugarlabs.org/words-activity/words-activity/commit/9262d94e1718d7c21576588fbeacb258f75b0ed7
Nice mouths!.
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110825/13a2b6d1/attachment.html>
More information about the Sugar-devel
mailing list