Compare commits
3 Commits
DEBUG-scro
...
v20231105-
Author | SHA1 | Date | |
---|---|---|---|
cefa65eadf | |||
766d246f46 | |||
23f9c0cb68
|
1
.gitignore
vendored
1
.gitignore
vendored
@ -117,6 +117,7 @@ venv/
|
|||||||
ENV/
|
ENV/
|
||||||
env.bak/
|
env.bak/
|
||||||
venv.bak/
|
venv.bak/
|
||||||
|
.idea
|
||||||
|
|
||||||
# Spyder project settings
|
# Spyder project settings
|
||||||
.spyderproject
|
.spyderproject
|
||||||
|
@ -19,7 +19,10 @@ class EditorPreview(object):
|
|||||||
def __init__(self):
|
def __init__(self):
|
||||||
gui_hooks.editor_did_init.append(self.editor_init_hook)
|
gui_hooks.editor_did_init.append(self.editor_init_hook)
|
||||||
gui_hooks.editor_did_init_buttons.append(self.editor_init_button_hook)
|
gui_hooks.editor_did_init_buttons.append(self.editor_init_button_hook)
|
||||||
if int(buildinfo.version.split(".")[2]) < 45: # < 2.1.45
|
buildversion = buildinfo.version.split(".")
|
||||||
|
|
||||||
|
# Anki changed their versioning scheme in 2023 to year.month(.patch), causing things to explode here.
|
||||||
|
if not int(buildversion[0]) >= 23 and int(buildversion[2]) < 45: # < 2.1.45
|
||||||
self.js = [
|
self.js = [
|
||||||
"js/vendor/jquery.min.js",
|
"js/vendor/jquery.min.js",
|
||||||
"js/vendor/css_browser_selector.min.js",
|
"js/vendor/css_browser_selector.min.js",
|
||||||
@ -53,22 +56,22 @@ class EditorPreview(object):
|
|||||||
location = config["location"]
|
location = config["location"]
|
||||||
split = QSplitter()
|
split = QSplitter()
|
||||||
if location == "above":
|
if location == "above":
|
||||||
split.setOrientation(Qt.Vertical)
|
split.setOrientation(Qt.Orientation.Vertical)
|
||||||
split.addWidget(editor.editor_preview)
|
split.addWidget(editor.editor_preview)
|
||||||
split.addWidget(editor.web)
|
split.addWidget(editor.web)
|
||||||
sizes = [editorR, mainR]
|
sizes = [editorR, mainR]
|
||||||
elif location == "below":
|
elif location == "below":
|
||||||
split.setOrientation(Qt.Vertical)
|
split.setOrientation(Qt.Orientation.Vertical)
|
||||||
split.addWidget(editor.web)
|
split.addWidget(editor.web)
|
||||||
split.addWidget(editor.editor_preview)
|
split.addWidget(editor.editor_preview)
|
||||||
sizes = [mainR, editorR]
|
sizes = [mainR, editorR]
|
||||||
elif location == "left":
|
elif location == "left":
|
||||||
split.setOrientation(Qt.Horizontal)
|
split.setOrientation(Qt.Orientation.Horizontal)
|
||||||
split.addWidget(editor.editor_preview)
|
split.addWidget(editor.editor_preview)
|
||||||
split.addWidget(editor.web)
|
split.addWidget(editor.web)
|
||||||
sizes = [editorR, mainR]
|
sizes = [editorR, mainR]
|
||||||
elif location == "right":
|
elif location == "right":
|
||||||
split.setOrientation(Qt.Horizontal)
|
split.setOrientation(Qt.Orientation.Horizontal)
|
||||||
split.addWidget(editor.web)
|
split.addWidget(editor.web)
|
||||||
split.addWidget(editor.editor_preview)
|
split.addWidget(editor.editor_preview)
|
||||||
sizes = [mainR, editorR]
|
sizes = [mainR, editorR]
|
||||||
|
Reference in New Issue
Block a user