Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tooltips do not display new-line #382

Closed
teopost opened this issue Jul 24, 2023 · 2 comments
Closed

Tooltips do not display new-line #382

teopost opened this issue Jul 24, 2023 · 2 comments
Assignees
Labels
bug Something isn't working
Milestone

Comments

@teopost
Copy link

teopost commented Jul 24, 2023

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

@teopost teopost changed the title Render newline to tooltip Tooltips do not display new-line Jul 24, 2023
@melonamin melonamin added the bug Something isn't working label Jul 24, 2023
@melonamin
Copy link
Contributor

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 added a commit that referenced this issue Sep 23, 2023
Signed-off-by: Alex Mazanov <alexandr.mazanov@gmail.com>
@melonamin melonamin self-assigned this Sep 23, 2023
@melonamin melonamin added this to the 2.0 milestone Sep 23, 2023
@melonamin
Copy link
Contributor

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants