Skip to content

Commit 7d469db

Browse files
committed
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
1 parent 3107512 commit 7d469db

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

python/plugins/plugin_installer/installer_gui.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -485,7 +485,16 @@ def addItem(p):
485485
a.setText(2,ver)
486486
a.setToolTip(2,verTip)
487487
a.setText(3,desc)
488-
a.setToolTip(3,descTip)
488+
# split the tooltip into multiple lines when they are too long
489+
tmp = ""
490+
splitTip = ""
491+
for word in descTip.split(" "):
492+
if len(tmp + word) < 80:
493+
tmp = tmp + " " + word
494+
else:
495+
splitTip += tmp + "\n"
496+
tmp = word
497+
a.setToolTip(3, splitTip+tmp)
489498
a.setText(4,p["author"])
490499
if p["homepage"]:
491500
a.setToolTip(4,p["homepage"])

0 commit comments

Comments
 (0)