Fix list view in look & feel tab not being updated if the initially shown sub tab is changed

This commit is contained in:
Kovid Goyal 2022-09-10 06:53:16 +05:30
parent ea873e7c1c
commit 3d82d3f70d
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
3 changed files with 13 additions and 0 deletions

View File

@ -91,6 +91,12 @@ class ConfigWidgetInterface:
''' '''
pass pass
def initial_tab_changed(self):
'''
Called if the initially displayed tab is changed before the widget is shown, but after it is initialized.
'''
pass
class Setting: class Setting:

View File

@ -774,6 +774,9 @@ class ConfigWidget(ConfigWidgetBase, Ui_Form):
self.tabWidget.currentWidget().setFocus(Qt.FocusReason.OtherFocusReason) self.tabWidget.currentWidget().setFocus(Qt.FocusReason.OtherFocusReason)
self.opt_ui_style.currentIndexChanged.connect(self.update_color_palette_state) self.opt_ui_style.currentIndexChanged.connect(self.update_color_palette_state)
def initial_tab_changed(self):
self.sections_view.setCurrentRow(self.tabWidget.currentIndex())
def fill_tb_search_order_box(self): def fill_tb_search_order_box(self):
# The tb_search_order is a directed graph of nodes with an arc to the next # The tb_search_order is a directed graph of nodes with an arc to the next
# node in the sequence. Node 0 (zero) is the start node with the last node # node in the sequence. Node 0 (zero) is the start node with the last node

View File

@ -282,6 +282,10 @@ class Preferences(QDialog):
idx = c.indexOf(w) idx = c.indexOf(w)
if idx > -1: if idx > -1:
c.setCurrentIndex(idx) c.setCurrentIndex(idx)
try:
self.showing_widget.initial_tab_changed()
except Exception:
pass
break break
else: else:
self.hide_plugin() self.hide_plugin()