mirror of
https://github.com/mupen64plus/mupen64plus-ui-python.git
synced 2025-04-02 10:51:53 -04:00
format tooltip
This commit is contained in:
parent
365268c52d
commit
e8546b4a76
1 changed files with 10 additions and 0 deletions
|
@ -58,6 +58,16 @@ def sl(mot):
|
||||||
((mot & 0x00FF0000) >> 8) |\
|
((mot & 0x00FF0000) >> 8) |\
|
||||||
((mot & 0xFF000000) >> 24)
|
((mot & 0xFF000000) >> 24)
|
||||||
|
|
||||||
|
def format_tooltip(tooltip):
|
||||||
|
if len(tooltip) > 80:
|
||||||
|
lines = tooltip.split(". ")
|
||||||
|
tooltip = ""
|
||||||
|
for line in lines:
|
||||||
|
tooltip += "%s. " % line.lstrip()
|
||||||
|
if len(line) > 40:
|
||||||
|
tooltip += "\n"
|
||||||
|
return tooltip
|
||||||
|
|
||||||
def format_label(label):
|
def format_label(label):
|
||||||
words = label.split("_")
|
words = label.split("_")
|
||||||
if len(words) > 1:
|
if len(words) > 1:
|
||||||
|
|
Loading…
Add table
Reference in a new issue