Ticket #3968: 0001-Do-not-show-clear-url-icon-when-there-is-not-text-SL.patch

File 0001-Do-not-show-clear-url-icon-when-there-is-not-text-SL.patch, 2.0 KB (added by humitos, 12 years ago)
  • webtoolbar.py

    From 5be512df169239d4c082052555ea80f45fd179e0 Mon Sep 17 00:00:00 2001
    From: Manuel Kaufmann <humitos@gmail.com>
    Date: Tue, 2 Oct 2012 10:02:30 -0300
    Subject: [PATCH Browse] Do not show clear url icon when there is not text SL
     #3968
    
    Hide the clear url icon when the user clicks over it or text entry is
    empty.
    
    Signed-off-by: Manuel Kaufmann <humitos@gmail.com>
    ---
     webtoolbar.py | 12 +++++++++---
     1 file changed, 9 insertions(+), 3 deletions(-)
    
    diff --git a/webtoolbar.py b/webtoolbar.py
    index 6350dfb..b7df0bf 100644
    a b class PrimaryToolbar(ToolbarBase): 
    348348            self.entry.props.address = uri
    349349
    350350    def __focus_in_event_cb(self, entry, event):
    351         if not self._tabbed_view.is_current_page_pdf():
     351        if not self._tabbed_view.is_current_page_pdf() and \
     352                self.entry.props.text != '':
    352353            self.entry.set_icon_from_name(iconentry.ICON_ENTRY_SECONDARY,
    353354                                          'dialog-cancel')
    354355
    355356    def __focus_out_event_cb(self, entry, event):
    356         if self._loading:
     357        if self.entry.props.text == '':
     358            self._show_no_icon()
     359        elif self._loading:
    357360            self._show_stop_icon()
    358361        else:
    359362            if not self._tabbed_view.is_current_page_pdf():
    class PrimaryToolbar(ToolbarBase): 
    409412        if entry.has_focus() and \
    410413                not self._tabbed_view.is_current_page_pdf():
    411414            entry.set_text('')
     415            self._show_no_icon()
    412416        else:
    413417            self._browser.reload()
    414418            if self._loading:
    class PrimaryToolbar(ToolbarBase): 
    419423    def _set_loading(self, loading):
    420424        self._loading = loading
    421425
    422         if self._loading:
     426        if self.entry.props.text == '':
     427            self._show_no_icon()
     428        elif self._loading:
    423429            self._show_stop_icon()
    424430        else:
    425431            if not self._tabbed_view.is_current_page_pdf():