Chicago95 icon indicating copy to clipboard operation
Chicago95 copied to clipboard

GTK hack to draw the background of desktop item names more like the original

Open nullnothing opened this issue 3 years ago • 3 comments

Currently, the background of desktop item names are drawn with a lot of extra padding.

However, using the background-image property with a single color -gtk-gradient, we can reposition & resize the background to trim off some of this padding & make the rendering appear closer to the original.

This is untested on high-DPI, so if anyone has a high-DPI system to test this with, please let me know how it goes.

Thank you for your time!

nullnothing avatar Jul 23 '22 07:07 nullnothing

@EMH-Mark-I have you had a chance to take a look? I'm happy to accept this change.

grassmunk avatar Jul 25 '22 16:07 grassmunk

Tried without composition, no weird black borders or something. Though I would raise the padding by one pixel on all sides, I think that might just get a liiiittle closer to the original.

Fierelier avatar Jul 27 '22 02:07 Fierelier

I just wanted to check in with a note for the future (for when XFCE makes the move to GTK4): -gtk-gradient has been replaced with linear-gradient in GTK4.

I played around with the GTK interactive debugger attached to gtk4-demo-application, and I can verify that the underlying hack (using gradients to create a resizable background rect) still works in GTK4 with linear-gradient, so when the time for GTK4 rolls around, all that needs to be done here is replacing -gtk-gradient with linear-gradient.

(BTW @Fierelier: I'll try to take a look at improving the appearance & accuracy sometime later on today, thank you for your feedback!)

ghost avatar Jul 28 '22 06:07 ghost