Hide back/forward widget when there's no text
This commit is contained in:
parent
0e8175b8eb
commit
5fb6cb713b
@ -39,3 +39,4 @@ class Backforward(textbase.TextBase):
|
|||||||
if text:
|
if text:
|
||||||
text = '[' + text + ']'
|
text = '[' + text + ']'
|
||||||
self.setText(text)
|
self.setText(text)
|
||||||
|
self.setVisible(bool(text))
|
||||||
|
@ -47,6 +47,7 @@ def test_backforward_widget(backforward_widget, stubs,
|
|||||||
tabbed_browser.tabs = [tab]
|
tabbed_browser.tabs = [tab]
|
||||||
backforward_widget.on_tab_cur_url_changed(tabbed_browser)
|
backforward_widget.on_tab_cur_url_changed(tabbed_browser)
|
||||||
assert backforward_widget.text() == expected_text
|
assert backforward_widget.text() == expected_text
|
||||||
|
assert backforward_widget.isVisible() == bool(expected_text)
|
||||||
|
|
||||||
# Check that the widget gets reset if empty.
|
# Check that the widget gets reset if empty.
|
||||||
if can_go_back and can_go_forward:
|
if can_go_back and can_go_forward:
|
||||||
@ -54,3 +55,4 @@ def test_backforward_widget(backforward_widget, stubs,
|
|||||||
tabbed_browser.tabs = [tab]
|
tabbed_browser.tabs = [tab]
|
||||||
backforward_widget.on_tab_cur_url_changed(tabbed_browser)
|
backforward_widget.on_tab_cur_url_changed(tabbed_browser)
|
||||||
assert backforward_widget.text() == ''
|
assert backforward_widget.text() == ''
|
||||||
|
assert not backforward_widget.isVisible()
|
||||||
|
Loading…
Reference in New Issue
Block a user