Make button show its toggle state

This commit is contained in:
Henrik Giesel 2021-01-09 23:16:01 +01:00
parent f5d429a5ca
commit ece753991e
2 changed files with 10 additions and 1 deletions

View File

@ -879,8 +879,10 @@ QTableView {{ gridline-color: {grid} }}
lambda _editor: self.onTogglePreview(),
"Preview Selected Card",
"Preview",
id="previewButton",
disables=False,
rightside=False,
toggleable=True,
))
gui_hooks.editor_did_init_left_buttons.append(add_preview_button)
@ -1579,6 +1581,7 @@ where id in %s"""
self._previewer.close()
def _on_preview_closed(self):
self.editor.web.eval("$('#previewButton').removeClass('highlighted')")
self._previewer = None
# Card deletion

View File

@ -73,7 +73,13 @@ button.linkb:disabled {
}
button.highlighted {
border-bottom: 3px solid #000;
#topbutsleft & {
box-shadow: inset 0px 0px 5px #222;
}
#topbutsright & {
border-bottom: 3px solid #000;
}
}
#fields {