fix about dialog collapsed on qt 5.11/12
the new approach doesn't seem to work properly on qt 5.9, so just revert to a static size on that platform
This commit is contained in:
parent
1490dc7390
commit
edb3b176a8
19
aqt/about.py
19
aqt/about.py
@ -24,7 +24,9 @@ def show(mw):
|
|||||||
mw.setupDialogGC(dialog)
|
mw.setupDialogGC(dialog)
|
||||||
abt = aqt.forms.about.Ui_About()
|
abt = aqt.forms.about.Ui_About()
|
||||||
abt.setupUi(dialog)
|
abt.setupUi(dialog)
|
||||||
abouttext = "<center><img src='/_anki/imgs/anki-logo-thin.png'></center>"
|
abouttext = "<style>body { margin: 0 }\n.outer { padding: 2em; }</style>"
|
||||||
|
abouttext += "<div class=outer>"
|
||||||
|
abouttext += "<center><img src='/_anki/imgs/anki-logo-thin.png'></center>"
|
||||||
abouttext += '<p>' + _("Anki is a friendly, intelligent spaced learning \
|
abouttext += '<p>' + _("Anki is a friendly, intelligent spaced learning \
|
||||||
system. It's free and open source.")
|
system. It's free and open source.")
|
||||||
abouttext += "<p>"+_("Anki is licensed under the AGPL3 license. Please see "
|
abouttext += "<p>"+_("Anki is licensed under the AGPL3 license. Please see "
|
||||||
@ -125,9 +127,14 @@ system. It's free and open source.")
|
|||||||
please get in touch.")
|
please get in touch.")
|
||||||
abouttext += '<p>' + _("A big thanks to all the people who have provided \
|
abouttext += '<p>' + _("A big thanks to all the people who have provided \
|
||||||
suggestions, bug reports and donations.")
|
suggestions, bug reports and donations.")
|
||||||
abt.label.stdHtml(abouttext, js=" ")
|
abouttext += "</div>"
|
||||||
def resizeAndShow(arg):
|
dialog.show()
|
||||||
dialog.adjustSize()
|
dialog.setMinimumWidth(800)
|
||||||
dialog.show()
|
abt.label.stdHtml(abouttext)
|
||||||
abt.label.evalWithCallback("1", resizeAndShow)
|
if qtminor >= 11:
|
||||||
|
abt.label.adjustHeightToFit()
|
||||||
|
# after the height is adjusted, adjust the dialog size
|
||||||
|
abt.label.evalWithCallback("1", lambda _: dialog.adjustSize())
|
||||||
|
else:
|
||||||
|
dialog.setMinimumHeight(600)
|
||||||
return dialog
|
return dialog
|
||||||
|
Loading…
Reference in New Issue
Block a user