Created attachment 1832 patch for xfdesktop Hello, I changed xfdesktop a bit to make it show transparent labels only for icons in GTK_STATE_NORMAL state, while keeping the labels visible for selected ones. And I also added a text shadow for such "normal" icons when their labels are totally transparent. It is possible to choose the shadow color. The new values can be set in the gtkrc file with the variables active-label-alpha and label-shadow-color. The desktop looks fine and in case this change is considered interesting I could also add some options to the setup dialog.
Created attachment 1833 fixed patch #1 sorry man, I had messed the memory and xfdesktop used to crash whenever I changed the style. Now it just works :)
Created attachment 1834 fixed patch #2 Memory leak fixed, now it should be fine. The way it works is explained by this picture: http://img232.imageshack.us/img232/6176/patchedxfdesktopxa5.jpg I'm wondering if it could be useful to have three distinct options to hide the label backgrounds in GTK_STATE_NORMAL, GTK_STATE_ACTIVE and GTK_STATE_SELECTED and maybe have the possibility to add the text shadows in the same way too. I'm already thinking about the GUI thing :)
Ok, I'd like to see this done a little bit differently so it's completely configurable. You should add a style prop called 'label-shadow-offset' which sets the amount of the x/y coords you add when painting the shadow. A value of 0 for label-shadow-offset disables the shadow. The default should be 0. 'active-label-alpha' should be called 'selected-label-alpha' since that matches with the gtk state type. (In gtk parlance, "active" means you're currently holding the mouse button down on top of something.) The default should be the same value for 'label-alpha'. 'label-shadow-color' should not be g_param_spec_string, but should be g_param_spec_boxed with type GDK_TYPE_COLOR. It should have a smarter default if none is provided in gtkrc: you should take the inverse color (just XOR each color component with 0xffff) of the text color for the current state type and use that as the default shadow color. All this introduces a little problem, though. On the good side, it makes the shadow setting independent of the label-alpha setting. So you can have a label background *and* have the shadow if you want. On the downside, this means you have to choose a label-shadow-color that works with both the normal text color and selected text color. And that also means you can't enable the shadow for normal icons but not for selected icons. So I guess we could also add selected-label-shadow-offset and selected-label-shadow-color, but I'm not sure if that's overkill or not, but it would fix the downsides in my last paragraph. What do you think?
Created attachment 1837 fixed patch #3 I like the idea and I already updated the patch. Now all the points are done :) I added label alpha and shadow color and offset for both alpha and selected states. I also changed the color string to a GDK_TYPE_COLOR, and the shadow color defaults to the inverse of the color used for the text. The offset has a x and y values so it is possible to set the shadow direction too. When both are set to 0 the shadow is disabled. Still about the offset though, I had to restrict the value between -3 and 3 because of a redraw problem. Otherwise, for greater values, if an icon passes from a state with a text shadow to another without shadow and with a visible label, the old shadow won't go. These are the new gtkrc variables: normal-label-alpha selected-label-alpha normal-text-shadow-offset-x normal-text-shadow-offset-y selected-text-shadow-offset-x selected-text-shadow-offset-y normal-text-shadow-color selected-text-shadow-color The internal variables that store those values are organized in arrays, so that it is possible to easily extend the customizability to other states too in the future.
For the GUI I thought about something like this: http://img257.imageshack.us/img257/2160/newiconsettingsln5.jpg What do you think? Btw do you use xfconf to make the dialog communicate with xfdesktop?
prolly better this that uses a table: http://img363.imageshack.us/img363/1645/newsettingsxg0.jpg
Created attachment 1884 fixed patch #4 Updated patch (for gtkrc config only) Cleaner code, array weirdness dropped, and a couple of leaks fixed.
Patch checked in with a few minor modifications. Yay!
w00t! :)
Created attachment 1896 fix for the GdkGC mess this fixes the problem with the GdkGC object allocation/deallocation for each icon
(In reply to comment #10) > Created an attachment (id=1896) [details] > fix for the GdkGC mess > > this fixes the problem with the GdkGC object allocation/deallocation for each > icon I don't like static globals in general. They should go in the XfdesktopIconView struct, and be initialized/updated in style-set, and unreffed in unrealize.
Created attachment 1898 fix for the GdkGC mess #2 ok no static.