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): |
348 | 348 | self.entry.props.address = uri |
349 | 349 | |
350 | 350 | 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 != '': |
352 | 353 | self.entry.set_icon_from_name(iconentry.ICON_ENTRY_SECONDARY, |
353 | 354 | 'dialog-cancel') |
354 | 355 | |
355 | 356 | 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: |
357 | 360 | self._show_stop_icon() |
358 | 361 | else: |
359 | 362 | if not self._tabbed_view.is_current_page_pdf(): |
… |
… |
class PrimaryToolbar(ToolbarBase): |
409 | 412 | if entry.has_focus() and \ |
410 | 413 | not self._tabbed_view.is_current_page_pdf(): |
411 | 414 | entry.set_text('') |
| 415 | self._show_no_icon() |
412 | 416 | else: |
413 | 417 | self._browser.reload() |
414 | 418 | if self._loading: |
… |
… |
class PrimaryToolbar(ToolbarBase): |
419 | 423 | def _set_loading(self, loading): |
420 | 424 | self._loading = loading |
421 | 425 | |
422 | | if self._loading: |
| 426 | if self.entry.props.text == '': |
| 427 | self._show_no_icon() |
| 428 | elif self._loading: |
423 | 429 | self._show_stop_icon() |
424 | 430 | else: |
425 | 431 | if not self._tabbed_view.is_current_page_pdf(): |