Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarco Pesenti Gritti <marco@localhost.localdomain>2008-06-17 07:52:25 (GMT)
committer Marco Pesenti Gritti <marco@localhost.localdomain>2008-06-17 07:52:25 (GMT)
commitb585089188d8aa912ada094d298228d298b2733b (patch)
treedb41720e70773db0f32e7afc6657ec06959e9aec
parente151eafd75adf7ed2c5d771d02d07d5a17841234 (diff)
parent5ff37788bdce825d8ce10f8c81828bb9e36c52ce (diff)
Merge branch 'master' of git+ssh://dev.laptop.org/git/web-activity
-rwxr-xr-xwebtoolbar.py20
1 files changed, 15 insertions, 5 deletions
diff --git a/webtoolbar.py b/webtoolbar.py
index f3f8ccb..b79cfc6 100755
--- a/webtoolbar.py
+++ b/webtoolbar.py
@@ -52,6 +52,8 @@ class WebEntry(AddressEntry):
self.connect('focus-in-event', self.__focus_in_event_cb)
self.connect('populate-popup', self.__populate_popup_cb)
self.connect('key-press-event', self.__key_press_event_cb)
+ self.connect('enter-notify-event', self.__enter_notify_event_cb)
+ self.connect('leave-notify-event', self.__leave_notify_event_cb)
self._focus_out_hid = self.connect(
'focus-out-event', self.__focus_out_event_cb)
self._change_hid = self.connect('changed', self.__changed_cb)
@@ -92,18 +94,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
@@ -121,9 +123,9 @@ 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
+ width = self.allocation.width - entry_h
height = gtk.gdk.screen_height() / 3
i = self._search_view.get_model().get_iter_first()
@@ -144,6 +146,14 @@ class WebEntry(AddressEntry):
self._set_text(self._title)
self._search_popdown()
+ def __enter_notify_event_cb(self, entry, event):
+ if not entry.props.has_focus:
+ self._set_text(self._address)
+
+ def __leave_notify_event_cb(self, entry, event):
+ if not entry.props.has_focus:
+ self._set_text(self._title)
+
def __view_button_press_event_cb(self, view, event):
model = view.get_model()