mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 22:12:21 -04:00
convert about to webview so we can scroll if too small
This commit is contained in:
parent
ebba215a9a
commit
61f69fd346
2 changed files with 42 additions and 30 deletions
12
aqt/about.py
12
aqt/about.py
|
@ -5,15 +5,23 @@
|
|||
from aqt.qt import *
|
||||
import aqt.forms
|
||||
from aqt import appVersion
|
||||
from aqt.utils import openLink
|
||||
|
||||
def show(parent):
|
||||
dialog = QDialog(parent)
|
||||
abt = aqt.forms.about.Ui_About()
|
||||
abt.setupUi(dialog)
|
||||
abouttext = "<center><img src=':/icons/anki-logo-thin.png'></center>"
|
||||
abt.label.page().setLinkDelegationPolicy(QWebPage.DelegateAllLinks)
|
||||
def onLink(url):
|
||||
openLink(url.toString())
|
||||
parent.connect(abt.label,
|
||||
SIGNAL("linkClicked(QUrl)"),
|
||||
onLink)
|
||||
abouttext = "<center><img src='qrc:/icons/anki-logo-thin.png'></center>"
|
||||
abouttext += '<p>' + _("Anki is a friendly, intelligent spaced learning \
|
||||
system. It's free and open source.")
|
||||
abouttext += '<p>' + _("Version %s") % appVersion + '<br>'
|
||||
abouttext += ("Qt %s PyQt %s<br>") % (QT_VERSION_STR, PYQT_VERSION_STR)
|
||||
abouttext += (_("<a href='%s'>Visit website</a>") % aqt.appWebsite) + \
|
||||
"</span>"
|
||||
abouttext += '<p>' + _("Written by Damien Elmes, with patches, translation,\
|
||||
|
@ -38,7 +46,7 @@ for credits.""")
|
|||
please get in touch.")
|
||||
abouttext += '<p>' + _("A big thanks to all the people who have provided \
|
||||
suggestions, bug reports and donations.")
|
||||
abt.label.setText(abouttext)
|
||||
abt.label.setHtml(abouttext)
|
||||
dialog.adjustSize()
|
||||
dialog.show()
|
||||
dialog.exec_()
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>About</class>
|
||||
<widget class="QDialog" name="About">
|
||||
|
@ -6,11 +7,11 @@
|
|||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>410</width>
|
||||
<height>447</height>
|
||||
<height>664</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy vsizetype="Minimum" hsizetype="Preferred" >
|
||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
|
@ -19,19 +20,15 @@
|
|||
<string>About Anki</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<property name="margin">
|
||||
<number>0</number>
|
||||
</property>
|
||||
<item>
|
||||
<widget class="QLabel" name="label" >
|
||||
<property name="text" >
|
||||
<string/>
|
||||
</property>
|
||||
<property name="alignment" >
|
||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||
</property>
|
||||
<property name="wordWrap" >
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="openExternalLinks" >
|
||||
<bool>true</bool>
|
||||
<widget class="QWebView" name="label">
|
||||
<property name="url">
|
||||
<url>
|
||||
<string>about:blank</string>
|
||||
</url>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
|
@ -47,8 +44,15 @@
|
|||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>QWebView</class>
|
||||
<extends>QWidget</extends>
|
||||
<header>QtWebKit/QWebView</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="../icons.qrc" />
|
||||
<include location="icons.qrc"/>
|
||||
</resources>
|
||||
<connections>
|
||||
<connection>
|
||||
|
|
Loading…
Reference in a new issue