This patch makes a few cosmetic tweaks to the autocompletion popup in
Browse. First, it adjusts the size/position of the window to make it
appear as though it is connected to the bottom of the entry. Second,
it places more emphasis on the page title, which is more "kid
friendly", by putting them on the left. Ideally, a future version
will actually put two lines per entry, with the page title and the URL
both getting the full width of the window to be shown.
- Eben
From 14bb435a35a387cf86035667bc575fbef70161eb Mon Sep 17 00:00:00 2001
From: Eben Eliason <[EMAIL PROTECTED](none)>
Date: Mon, 16 Jun 2008 18:05:18 -0400
Subject: [PATCH] Clean up URI autocompletion popup
---
webtoolbar.py | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diff --git a/webtoolbar.py b/webtoolbar.py
index cb40ddf..e647c9d 100755
--- a/webtoolbar.py
+++ b/webtoolbar.py
@@ -23,6 +23,7 @@ import pango
from xpcom.components import interfaces
from xpcom import components
+from sugar.graphics import style
from sugar.graphics.toolbutton import ToolButton
from sugar.graphics.menuitem import MenuItem
from sugar._sugarext import AddressEntry
@@ -94,18 +95,18 @@ class WebEntry(AddressEntry):
cell = gtk.CellRendererText()
cell.props.ellipsize = pango.ELLIPSIZE_END
cell.props.ellipsize_set = True
+ cell.props.font = 'Bold'
column.pack_start(cell, True)
- column.set_attributes(cell, text=self._COL_ADDRESS)
+ column.set_attributes(cell, text=self._COL_TITLE)
cell = gtk.CellRendererText()
cell.props.ellipsize = pango.ELLIPSIZE_END
cell.props.ellipsize_set = True
cell.props.alignment = pango.ALIGN_LEFT
- cell.props.font = 'Bold'
column.pack_start(cell)
- column.set_attributes(cell, text=self._COL_TITLE)
+ column.set_attributes(cell, text=self._COL_ADDRESS)
return view
@@ -123,16 +124,15 @@ class WebEntry(AddressEntry):
entry_x, entry_y = self.window.get_origin()
entry_w, entry_h = self.size_request()
- x = entry_x
+ x = entry_x + entry_h / 2
y = entry_y + entry_h
- width = self.allocation.width
- height = gtk.gdk.screen_height() / 3
+ width = self.allocation.width - entry_h
i = self._search_view.get_model().get_iter_first()
self._search_view.get_selection().select_iter(i)
self._search_window.move(x, y)
- self._search_window.resize(width, height)
+ self._search_window.resize(width, 1)
self._search_window.show()
def _search_popdown(self):
--
1.5.4.3
_______________________________________________
Sugar mailing list
[email protected]
http://lists.laptop.org/listinfo/sugar