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

Tooltip calendar text overflows #2240

Closed
FilippoBonazziSUSE opened this issue Jun 16, 2023 · 16 comments
Closed

Tooltip calendar text overflows #2240

FilippoBonazziSUSE opened this issue Jun 16, 2023 · 16 comments

Comments

@FilippoBonazziSUSE
Copy link

Hi, after fixing my calendar configuration that was broken with version 0.9.18, I configured the year/month toggleable calendar - very useful.

However, the year calendar has some unexpected text overflow which breaks the formatting. This is how it looks on openSUSE Tumbleweed:
20230616_19h45m29s_grim

This is the configuration that results in the above screenshot:

     "clock#date": {
        "format": "{:%F %a}",
        "smooth-scrolling-threshold": 4,
        "tooltip-format": "<span color='#35b9ab'><tt><small>{calendar}</small></tt></span>",
        "calendar": {
            "mode-mon-col"      : 4,
            "weeks-pos"         : "left",
            "on-scroll"         : 1,
            "on-click-right"    : "mode",
            "format": {
                "months":    "<span color='#35b9ab'><b>{}</b></span>",
                "weeks":    "<span color='#73ba25'><b>{}</b></span>",
                "weekdays": "<span color='#21a4df'><b>{}</b></span>",
                "today":    "<span color='#35b9ab' background='#173f4f'><b>{}</b></span>"
            }
        },
        "actions": {
            "on-click-right"    : "mode",
            "on-scroll-up"      : "shift_up",
            "on-scroll-down"    : "shift_down"
        },
        "tooltip": true
    },

Is there something wrong with the configuration here or the css? Or is there a problem in the calendar with how text is split into a new line?

@LukashonakV
Copy link
Contributor

Try to reduce mode-mon-col or, for test purposes, move clock to the center of waybar just to check

@LukashonakV
Copy link
Contributor

LukashonakV commented Jun 17, 2023

The issue seems to me here with GTK Label Tooltip. I didn't find any API's which can help to increase the tooltip width.
I'll create an issue to upstream once I have time .

FYI: Calendar scrolling works for both modes: moth/year.

Upd: @FilippoBonazziSUSE here is new cava module you might be interested in. See an example

@LukashonakV
Copy link
Contributor

Upstream issue raised: GTK Label Tooltip

@FilippoBonazziSUSE
Copy link
Author

Thanks for raising the upstream issue.

Upd: @FilippoBonazziSUSE here is new cava module you might be interested in. See an example

How is this related?

@saltasatelites
Copy link

saltasatelites commented Sep 3, 2023

I've waybar running on Arch Linux but installed directly from github, no pacman, except dependencies.
My calendar window continues misconfigured. Has anyone found how to solve that issue?
I am not sure if it has any kind of relationship with the fonts, becouase it doesn't recognize the calendar icon, but all other icons of the other modules.
Thanks in advance.

@saltasatelites
Copy link

Change the columns to 2 in "mode-mon-col" solves the issue, but it looks very small

@FilippoBonazziSUSE
Copy link
Author

Hi, this is still broken, any chance this can be fixed?

@LukashonakV
Copy link
Contributor

Hi @FilippoBonazziSUSE , unfortunately not any news from the gtk upstream GTK3. Label tooltip shifted text

@BrianCArnold
Copy link

I have had some luck hacking a workaround by specifying the sizing in the pango markup in a very weird way, I set the font-size larger than I want, then set the size as "x-small" in the pango markup. See attached screenshot of 3-month wide example:
image

@BrianCArnold
Copy link

BrianCArnold commented Apr 18, 2024

Okay, so, this is a very simple hack, but it works pretty well, and doesn't require font sizing shenanigans:

        "clock#date": {
            "rotate": 0,
            "format-alt": "{:%Y/%m/%d}",
            "format": "{:%b %d, %Y}",
            // To set calendar width, write out the entire length of an entire line in the calendar:
            // `10 11 12 13 14 15 16 W00   10 11 12 13 14 15 16 W00   10 11 12 13 14 15 16 W00   10 11 12 13 14 15 16 W00`
            // Then replace every character in that line with a space:
            // `                                                                                                         `
            // Then take that space, and put it before or after (or both) of `{calendar}` with a newline (`\n`) between that empty line and the `{calendar}`.
            // For best results, probably both? Then also limit the amount of padding-top and/or padding-bottom in the `tooltip label` css.
            // Example:            10 11 12 13 14 15 16 W00   10 11 12 13 14 15 16 W00   10 11 12 13 14 15 16 W00   10 11 12 13 14 15 16 W00
            "tooltip-format": "<tt>                                                                                                         \n{calendar}</tt>",
            "calendar": {
              "mode"          : "year",
              "mode-mon-col"  : 4,
              "weeks-pos": "right",
              "on-scroll"     : 1,
              "format": {
                "months":     "<span color='#ffead3'><b>{}</b></span>",
                "days":       "<span color='#ecc6d9'><b>{}</b></span>",
                "weeks":      "<span color='#99ffdd'><b>W{}</b></span>",
                "weekdays":   "<span color='#ffcc66'><b>{}</b></span>",
                "today":      "<span color='#ff6699'><b><u>{}</u></b></span>"
              }
            },
            "interval": 1
        },

Untitled

@LukashonakV
Copy link
Contributor

Hi there. there is merge request which should solve an issue. In the same time it created an issue and discussion in Gnome comunity:

  1. Gnome Issue#5900
  2. Gnome discussion

@LukashonakV
Copy link
Contributor

LukashonakV commented May 17, 2024

Finally according this discussion

Gnome discussion

solution is found and #3255 is ready to merge

@saltasatelites
Copy link

saltasatelites commented May 17, 2024

In my case the problem was solved by installing ttf-font-awesome-4.tar.gz from AUR

@LukashonakV
Copy link
Contributor

LukashonakV commented May 17, 2024

According to the gtk maintainer's mention tooltip for GtkLabel has limitations. So, this MR fixes the issue without any additional actions from the user side. And works well for me l

Alexays added a commit that referenced this issue May 28, 2024
Fix Clock. Tooltip calendar text overflows(#2240)
@LukashonakV
Copy link
Contributor

Hi @FilippoBonazziSUSE,
Can you please check the issue once again in new 0.10.4 Waybar ?

@FilippoBonazziSUSE
Copy link
Author

I haven't followed these developments in depth, sorry. I checked now on my desktop and it looks fine in version 0.10.4 though! Thank you very much

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants