Waybar icon indicating copy to clipboard operation
Waybar copied to clipboard

Tooltip calendar text overflows

Open FilippoBonazziSUSE opened this issue 2 years ago • 14 comments

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?

FilippoBonazziSUSE avatar Jun 16 '23 17:06 FilippoBonazziSUSE

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

LukashonakV avatar Jun 16 '23 18:06 LukashonakV

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 avatar Jun 17 '23 07:06 LukashonakV

Upstream issue raised: GTK Label Tooltip

LukashonakV avatar Jun 17 '23 13:06 LukashonakV

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?

FilippoBonazziSUSE avatar Jun 19 '23 06:06 FilippoBonazziSUSE

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 avatar Sep 03 '23 10:09 saltasatelites

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

saltasatelites avatar Sep 15 '23 12:09 saltasatelites

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

FilippoBonazziSUSE avatar Jan 12 '24 16:01 FilippoBonazziSUSE

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

LukashonakV avatar Feb 18 '24 14:02 LukashonakV

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 avatar Apr 18 '24 14:04 BrianCArnold

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

BrianCArnold avatar Apr 18 '24 15:04 BrianCArnold

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 avatar May 17 '24 10:05 LukashonakV

Finally according this discussion

Gnome discussion

solution is found and #3255 is ready to merge

LukashonakV avatar May 17 '24 17:05 LukashonakV

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

saltasatelites avatar May 17 '24 17:05 saltasatelites

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

LukashonakV avatar May 17 '24 17:05 LukashonakV