Merge remote-tracking branch 'origin/pr/4296'
This commit is contained in:
commit
4b76dc56e1
@ -225,8 +225,8 @@ class TabWidget(QTabWidget):
|
|||||||
non-visible. To avoid flickering, disable repaint updates whlie we
|
non-visible. To avoid flickering, disable repaint updates whlie we
|
||||||
work.
|
work.
|
||||||
"""
|
"""
|
||||||
toggle = self.count() > 10
|
|
||||||
bar = self.tabBar()
|
bar = self.tabBar()
|
||||||
|
toggle = self.count() > 10 and bar.isVisible()
|
||||||
if toggle:
|
if toggle:
|
||||||
bar.setUpdatesEnabled(False)
|
bar.setUpdatesEnabled(False)
|
||||||
bar.setVisible(False)
|
bar.setVisible(False)
|
||||||
|
@ -134,6 +134,14 @@ class TestTabWidget:
|
|||||||
config_stub.val.tabs.max_width = max_size
|
config_stub.val.tabs.max_width = max_size
|
||||||
assert widget.tabBar().tabRect(0).width() == max_size
|
assert widget.tabBar().tabRect(0).width() == max_size
|
||||||
|
|
||||||
|
def test_tab_stays_hidden(self, widget, fake_web_tab, config_stub):
|
||||||
|
assert widget.tabBar().isVisible()
|
||||||
|
config_stub.val.tabs.show = "never"
|
||||||
|
assert not widget.tabBar().isVisible()
|
||||||
|
for i in range(12):
|
||||||
|
widget.addTab(fake_web_tab(), 'foobar' + str(i))
|
||||||
|
assert not widget.tabBar().isVisible()
|
||||||
|
|
||||||
@pytest.mark.parametrize("num_tabs", [4, 100])
|
@pytest.mark.parametrize("num_tabs", [4, 100])
|
||||||
@pytest.mark.parametrize("rev", [True, False])
|
@pytest.mark.parametrize("rev", [True, False])
|
||||||
def test_add_remove_tab_benchmark(self, benchmark, widget,
|
def test_add_remove_tab_benchmark(self, benchmark, widget,
|
||||||
|
Loading…
Reference in New Issue
Block a user