GNOME Bugzilla – Bug 695689
Allow rubberband to use the desktop average color
Last modified: 2013-06-10 14:52:19 UTC
The rubber band is currently based on the GTK theme, but depending on your background this can be a bad color. Instead it should be based on the average color of the background so that it always shows up.
Thanks for sharing the idea. The average color could be too low contrast, though. No contrast at all if the background is a single color, which is an option provided directly in the Settings.
Sure, but that's what the actual band does in that case. It has a slightly different color so people will still see the box, but not the overlay of blank space. They'll still see the overlay when it overlaps icons. In the more usual case, where backgrounds have texture, the flattening of it is very natural. To be clear, this problem still exists if you were to set the background color to the same as the GTK theme setting for the color.
Created attachment 238964 [details] [review] suggested patch from Ted Gould Ted, not sure why you didn't put the launchpad patch in there, I'm assuming it's an overlook and adding it
Sorry, yes. I thought that I had. Thank you for fixing that Seb.
Review of attachment 238964 [details] [review]: [ Patch should be updated to git master - the file is called nautilus-canvas-container.c now ] Thanks for the patch! Generally I like the idea; it's unfortunate this patch came the Friday before hard code freeze though. It will have to wait post-3.8. Code looks almost good, comments below are mostly stylistic. ::: nautilus-3.5.90.really.3.4.2/libnautilus-private/nautilus-icon-container.c @@ +2611,2 @@ static void +get_rubber_color (GdkRGBA * bgcolor, GdkRGBA * bordercolor, GtkWidget * container) Coding style: no space between * and the name of the variable. I'd also rather have the GtkWidget *container in parameter before the other out parameters. </nitpick> @@ +2621,3 @@ + Display* display; + + gulong items_read = 0; Use nautilus_canvas_container_get_is_desktop() @@ +2638,3 @@ + &items_left, + (guchar **) &colors); + display = gdk_x11_display_get_xdisplay (gdk_display_get_default ()); This flush shouldn't be needed with GDK 3. @@ +2647,3 @@ + */ + GdkRGBA read; + representative_colors_atom, Missing space before arguments (also in a few other places below). @@ +2655,3 @@ + /* Border */ + GtkSymbolicColor * sym_border = gtk_symbolic_color_new_shade(sym_read, read.green < 0.5 ? 1.1 : 0.9); + XA_STRING, You should be able to pass NULL here and below instead of creating the empty GtkStyleProperties object. @@ +2679,3 @@ + } + + * select the first colour in the list. This is redundant.
Created attachment 242828 [details] [review] Shade rubberbands on the desktop by the wallpaper Use the _GNOME_BACKGROUND_REPRESENTATIVE_COLORS X atom to decide how to shade the rubberband when selecting icons on the desktop. I rebased the code to apply to current master and fixed things up according to your suggestions. I also removed the use of the (now-deprecated) GtkSymbolicColor for favour of direct manipulation of the colours (as suggested by Benjamin).
Review of attachment 242828 [details] [review]: Looks good to me, with this little nitpick fixed ::: libnautilus-private/nautilus-canvas-container.c @@ +2428,3 @@ &band_info->start_x, &band_info->start_y); + get_rubber_color(container, &bg_color, &border_color); Missing space here
Attachment 242828 [details] pushed as d532ab4 - Shade rubberbands on the desktop by the wallpaper Hah. Totally didn't notice that you ACKed this almost immediately. Fixed and pushed now.