mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
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:
parent
31075129d7
commit
7d469dbf37
@ -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"])
|
||||
|
Loading…
x
Reference in New Issue
Block a user