Open PedroCI opened 1 year ago
I would like to know that too
It appears Anki 2.1.57 implemented new code for the Top toolbar. I installed 2.1.56 and got the toolbar back. Unfortunately it isn't a pretty toolbar, but I have addons that break further back I go.
I'm not super savvy with Python, but I do know deck_browser.py
has a <nav>
tag with the %s in question. If we could extract {toolbar_content} into it I think it might work?
I should note that toolbar_content is def
in Anki's toolbar.py
in the draw function
Commit dif between 2.1.57 and 2.1.56
line 344 -> beautify-anki/deck_browser.py
I can confirm that the toolbar is missing on my version of Anki as well
has anyone tried it with the new version of anki?
hey, I updated to Anki version 2.1.63 Qt6 and ran into this issue as well. starting based on @Barthol-io's findings, I think I managed to fix it, albeit in a spaghetti code style, since my experience with Python is almost non-existent.
Toolbar._body = """
<div style="font-size: 12px; text-align: {THEME[topbar-position]}; background-color: {THEME[topbar-color]}" width="100%">
""".format(THEME=THEME)
toolbar_content = "<div>{toolbar_content}</div>"
end_div = "</div>"
Toolbar._body = Toolbar._body + toolbar_content + end_div
in my extension files, this was on line 340
from beautify-anki/deck_browser.py
.
so if anyone wants to try it out, just replace the 2nd snippet from Barthol with the stuff above.
for context, I ended up splitting the div because if I tried to apply the .format() to everything, including the {toolbar_content}, it would throw some error about the toolbar not being loaded yet, and I don't know what sort of callback/conditional would be needed to only run this code after the toolbar_content was actually available. tried to mess a bit with the __init__.py
file as well, but that didn't go anywhere, so I figure this fix will have to suffice for now.
lastly, seeing how this repo has stopped being updated, did anyone else make a different one that's maintained so we could make a PR?
hey, I updated to Anki version 2.1.63 Qt6 and ran into this issue as well. starting based on @Barthol-io's findings, I think I managed to fix it, albeit in a spaghetti code style, since my experience with Python is almost non-existent.
Toolbar._body = """ <div style="font-size: 12px; text-align: {THEME[topbar-position]}; background-color: {THEME[topbar-color]}" width="100%"> """.format(THEME=THEME) toolbar_content = "<div>{toolbar_content}</div>" end_div = "</div>" Toolbar._body = Toolbar._body + toolbar_content + end_div
in my extension files, this was on
line 340
frombeautify-anki/deck_browser.py
.so if anyone wants to try it out, just replace the 2nd snippet from Barthol with the stuff above.
for context, I ended up splitting the div because if I tried to apply the .format() to everything, including the {toolbar_content}, it would throw some error about the toolbar not being loaded yet, and I don't know what sort of callback/conditional would be needed to only run this code after the toolbar_content was actually available. tried to mess a bit with the
__init__.py
file as well, but that didn't go anywhere, so I figure this fix will have to suffice for now.lastly, seeing how this repo has stopped being updated, did anyone else make a different one that's maintained so we could make a PR?
Thank you, it worked! Is there a way to get rid of that white line?
glad to hear that!
I have the white line too, it was reported in issue #66 and it was supposed to be fixed in PR #69, but since the project is not being updated, the PR was closed.
I tried to copy the changed file from that PR (user_files/assets/css/bootstrap.min.css), and it did fix the white line, but it also changed some other things regarding the formatting, which I didn't like, so I didn't keep the changes. if you wanna try it out, I'd recommend keeping a backup of your current file.
Someone else took care of this addon and it solved all the above problems. https://ankiweb.net/shared/info/1116770498 Is it related to this? https://github.com/ShoroukAziz/Beautify-Anki/pull/69
oh right, I saw the new addon at some point, but I didn't test it out yet.
and yeah, the white line issue is related to #69.
@ROOMBON thanks bro for the information
Before posting, please verify that you've done the following
Describe the bug The top bar where browse, stats, etc; are supposed to be only shows %s.
Screenshots
Contex (please complete the following information):
Additional context In your Anki go to help > About > Copy Debug Log and paste it between the following backticks