Ticket #4049: 0001-Make-the-autocomplete-list-touch-friendly-SL-4049.patch

File 0001-Make-the-autocomplete-list-touch-friendly-SL-4049.patch, 2.1 KB (added by manuq, 12 years ago)

Candidate patch.

  • places.py

    From 9c120d63889fb8e52f108656eeeb66d1e6dbc507 Mon Sep 17 00:00:00 2001
    From: =?UTF-8?q?Manuel=20Qui=C3=B1ones?= <manuq@laptop.org>
    Date: Mon, 22 Oct 2012 15:26:25 -0300
    Subject: [PATCH browse] Make the autocomplete list touch-friendly - SL #4049
    MIME-Version: 1.0
    Content-Type: text/plain; charset=UTF-8
    Content-Transfer-Encoding: 8bit
    Mail-Followup-To: <sugar-devel@lists.sugarlabs.org>
    
    - limit the number of matches so the list doesn't interfere with the OSK
    
    - enlarge the rows height to the size of an icon of standard size, so
      the rows are as touchable as Sugar icons
    
    - make the list of alternate colors to distinguish the
      clickable/touchable area
    
    Signed-off-by: Manuel Quiñones <manuq@laptop.org>
    ---
     places.py     | 2 +-
     webtoolbar.py | 3 +++
     2 files changed, 4 insertions(+), 1 deletion(-)
    
    diff --git a/places.py b/places.py
    index 5001b43..36da8b7 100644
    a b class Place(object): 
    3434
    3535
    3636class SqliteStore(object):
    37     MAX_SEARCH_MATCHES = 20
     37    MAX_SEARCH_MATCHES = 7
    3838    EXPIRE_DAYS = 30
    3939
    4040    def __init__(self):
  • webtoolbar.py

    diff --git a/webtoolbar.py b/webtoolbar.py
    index 29c036b..d99919d 100644
    a b from gi.repository import WebKit 
    2727from sugar3.graphics.toolbutton import ToolButton
    2828from sugar3.graphics import iconentry
    2929from sugar3.graphics.toolbarbox import ToolbarBox as ToolbarBase
     30from sugar3.graphics.style import STANDARD_ICON_SIZE
    3031from sugar3.activity.widgets import ActivityToolbarButton
    3132from sugar3.activity.widgets import StopButton
    3233
    class WebEntry(iconentry.IconEntry): 
    8485    def _search_create_view(self):
    8586        view = Gtk.TreeView()
    8687        view.props.headers_visible = False
     88        view.props.rules_hint = True
    8789
    8890        view.connect('button-press-event', self.__view_button_press_event_cb)
    8991
    class WebEntry(iconentry.IconEntry): 
    9395        cell = Gtk.CellRendererText()
    9496        cell.props.ellipsize = Pango.EllipsizeMode.END
    9597        cell.props.ellipsize_set = True
     98        cell.props.height = STANDARD_ICON_SIZE
    9699        cell.props.font = 'Bold'
    97100        column.pack_start(cell, True)
    98101