mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 15:32:23 -04:00
Merge pull request #275 from glutanimate/editor-addbutton-qrc-support
Add support for button icons stored in Qt resource system
This commit is contained in:
commit
c8b5ce1b66
1 changed files with 3 additions and 1 deletions
|
@ -145,7 +145,9 @@ class Editor:
|
||||||
def _addButton(self, icon, cmd, tip="", label="", id=None, toggleable=False,
|
def _addButton(self, icon, cmd, tip="", label="", id=None, toggleable=False,
|
||||||
disables=True):
|
disables=True):
|
||||||
if icon:
|
if icon:
|
||||||
if os.path.isabs(icon):
|
if icon.startswith("qrc:/"):
|
||||||
|
iconstr = icon
|
||||||
|
elif os.path.isabs(icon):
|
||||||
iconstr = self.resourceToData(icon)
|
iconstr = self.resourceToData(icon)
|
||||||
else:
|
else:
|
||||||
iconstr = "/_anki/imgs/{}.png".format(icon)
|
iconstr = "/_anki/imgs/{}.png".format(icon)
|
||||||
|
|
Loading…
Reference in a new issue