wl-kbptr icon indicating copy to clipboard operation
wl-kbptr copied to clipboard

Add ability to configure label font size for floating mode

Open 3333juul opened this issue 9 months ago • 5 comments

that's how it currently looks on my desktop:

Image

as you can see, labels are really small.

3333juul avatar Apr 07 '25 10:04 3333juul

This and also: sometimes label text is longer than the colored background and the text is actually unreadable.

abenz1267 avatar Apr 08 '25 05:04 abenz1267

It's interesting how small the font is here @3333juul. You seem to have a low display output scaling and compensate with bigger font size. Though, it really doesn't matter how you end-up with this, you should be able to set the font size regardless.

I'm thinking about adding a font_size setting that would take a curve based on the area height. It would look like this:

font_size=10px [h:5px], 14px [h:16px], 30px [h:60px]

Meaning: if the area is less or equal to 5px tall, the font size will be 10px, else if between 5 and 16px interpolate from 10 to 14px, etc.

Another simpler way would be to just have the min and max font size with the ratio with the area height. E.g:

font_size=10px 90% 30px

These are two ideas. If you have another feel free to share.

@abenz1267, that's indeed an issue. I'm not sure it's better to make the area bigger so I decided to have the text overflow. One solution would be to render shadows or a box around the text that's independent from the area.

moverest avatar Apr 09 '25 20:04 moverest

I don't know if I have some unusual scaling of my monitor. I have a 23' monitor with a resolution of 1920x1080 and I use the default scale of 1.0 set in Hyprland. Seems pretty standard to me. My bar is quite small, which might suggest a small scale, but that's just my preference.

But anyway, I really like your ideas, choose the one you think will work best.

3333juul avatar Apr 10 '25 10:04 3333juul

Indeed, a scaling of 1x on a 23" monitor at 1920x1080px looks about right. I guess you like your font big which is perfectly fine.

moverest avatar Apr 10 '25 11:04 moverest

For what it's worth, I've noticed that making unselectable_bg_color more opaque does wonders to the readability of the text. It's a good workaround until font size can be larger.

matejdro avatar Apr 29 '25 05:04 matejdro

Implemented in f28295d14059b01f5816df19523c67d8439864eb.

moverest avatar Jun 06 '25 00:06 moverest