Fix inconsistency of button states when searching in metadata

Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
This commit is contained in:
TheJackiMonster 2023-02-10 22:21:22 +01:00
parent 3ac87d9125
commit eeb98a8ccd
No known key found for this signature in database
GPG key ID: D850A5F772E880F9
2 changed files with 6 additions and 2 deletions

View file

@ -93,6 +93,11 @@ class collapsibleDockWidgets(QToolBar):
# btn.defaultAction().setChecked(event.type() == QEvent.Show)
# return False
def switchActionByWidget(self, widget, visibility=True):
for _btn, _action, _widget, _grp in self.otherWidgets:
if widget == _widget:
_btn.setChecked(visibility)
def setCurrentGroup(self, group):
self.currentGroup = group
for btn, action, widget, grp in self.otherWidgets:

View file

@ -38,8 +38,7 @@ class outlineSearchResultHighlighter(abstractSearchResultHighlighter):
# Metadata columns are inside a splitter widget that my be hidden, so we show them.
if parentName:
metadataViewWidget = mainWindow().findChild(metadataView, "redacMetadata")
metadataViewWidget.show()
metadataViewWidget.findChild(collapsibleGroupBox2, parentName).button.setChecked(True)
mainWindow().toolbar.switchActionByWidget(metadataViewWidget)
widget = metadataViewWidget.findChild(editorClass, editorName)
else:
widget = mainWindow().mainEditor.currentEditor().findChild(editorClass, editorName)