From b585089188d8aa912ada094d298228d298b2733b Mon Sep 17 00:00:00 2001 From: Marco Pesenti Gritti Date: Tue, 17 Jun 2008 07:52:25 +0000 Subject: Merge branch 'master' of git+ssh://dev.laptop.org/git/web-activity --- 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() -- cgit v0.9.1