mirror of
https://github.com/olivierkes/manuskript.git
synced 2024-05-18 11:52:25 +12:00
Fix inconsistency of button states when searching in metadata
Signed-off-by: TheJackiMonster <thejackimonster@gmail.com>
This commit is contained in:
parent
3ac87d9125
commit
eeb98a8ccd
|
@ -93,6 +93,11 @@ class collapsibleDockWidgets(QToolBar):
|
||||||
# btn.defaultAction().setChecked(event.type() == QEvent.Show)
|
# btn.defaultAction().setChecked(event.type() == QEvent.Show)
|
||||||
# return False
|
# 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):
|
def setCurrentGroup(self, group):
|
||||||
self.currentGroup = group
|
self.currentGroup = group
|
||||||
for btn, action, widget, grp in self.otherWidgets:
|
for btn, action, widget, grp in self.otherWidgets:
|
||||||
|
|
|
@ -38,8 +38,7 @@ class outlineSearchResultHighlighter(abstractSearchResultHighlighter):
|
||||||
# Metadata columns are inside a splitter widget that my be hidden, so we show them.
|
# Metadata columns are inside a splitter widget that my be hidden, so we show them.
|
||||||
if parentName:
|
if parentName:
|
||||||
metadataViewWidget = mainWindow().findChild(metadataView, "redacMetadata")
|
metadataViewWidget = mainWindow().findChild(metadataView, "redacMetadata")
|
||||||
metadataViewWidget.show()
|
mainWindow().toolbar.switchActionByWidget(metadataViewWidget)
|
||||||
metadataViewWidget.findChild(collapsibleGroupBox2, parentName).button.setChecked(True)
|
|
||||||
widget = metadataViewWidget.findChild(editorClass, editorName)
|
widget = metadataViewWidget.findChild(editorClass, editorName)
|
||||||
else:
|
else:
|
||||||
widget = mainWindow().mainEditor.currentEditor().findChild(editorClass, editorName)
|
widget = mainWindow().mainEditor.currentEditor().findChild(editorClass, editorName)
|
||||||
|
|
Loading…
Reference in a new issue