plugin installer: split the description tooltip into multiple lines as needed

some plugins have so long descriptions, a single line tooltip doesn't fit
 on my 1366px screen. Would be even worse on mobile devices if they had
 the notion of mouse over tooltips. :I Example: MultiEdit
This commit is contained in:
Jaka Kranjc 2012-06-24 14:17:25 +02:00
parent 31075129d7
commit 7d469dbf37

View File

@ -485,7 +485,16 @@ class QgsPluginInstallerDialog(QDialog, Ui_QgsPluginInstallerDialogBase):
a.setText(2,ver)
a.setToolTip(2,verTip)
a.setText(3,desc)
a.setToolTip(3,descTip)
# split the tooltip into multiple lines when they are too long
tmp = ""
splitTip = ""
for word in descTip.split(" "):
if len(tmp + word) < 80:
tmp = tmp + " " + word
else:
splitTip += tmp + "\n"
tmp = word
a.setToolTip(3, splitTip+tmp)
a.setText(4,p["author"])
if p["homepage"]:
a.setToolTip(4,p["homepage"])