swiftbar / SwiftBar

Powerful macOS menu bar customization tool
https://swiftbar.app
MIT License
2.95k stars 92 forks source link

Tooltips do not display new-line #382

Closed teopost closed 1 year ago

teopost commented 1 year ago

I have a text with some newlines that I want to display in the tooltip. The '\n' character is not being converted into a newline. How can I do that?

This line

    def format_tooltip(self, text):

        if text is not None:
            retval = '"' + text.replace('\n', '\\n').replace('\r', ' ') + '"'
        else:
            retval = ''
        return(retval)

produce this:

image

melonamin commented 1 year ago

My gut reaction - it is not possible to have a multiline tooltip. But I checked - you definetly can.

You're correct that currently SwiftBar doesn't render '\n' properly in this case and I'm not sure why, needs some digging.

melonamin commented 1 year ago

@teopost Try the beta build please 2.0.0-beta-1