After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 695689 - Allow rubberband to use the desktop average color
Allow rubberband to use the desktop average color
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: Desktop
unspecified
Other Linux
: Normal enhancement
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks:
 
 
Reported: 2013-03-12 10:07 UTC by Ted Gould
Modified: 2013-06-10 14:52 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
suggested patch from Ted Gould (4.25 KB, patch)
2013-03-15 08:59 UTC, Sebastien Bacher
needs-work Details | Review
Shade rubberbands on the desktop by the wallpaper (4.33 KB, patch)
2013-04-29 17:50 UTC, Allison Karlitskaya (desrt)
committed Details | Review

Description Ted Gould 2013-03-12 10:07:31 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.
Comment 1 António Fernandes 2013-03-13 15:24:25 UTC
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.
Comment 2 Ted Gould 2013-03-13 15:31:20 UTC
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.
Comment 3 Sebastien Bacher 2013-03-15 08:59:54 UTC
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
Comment 4 Ted Gould 2013-03-15 10:20:30 UTC
Sorry, yes.  I thought that I had.  Thank you for fixing that Seb.
Comment 5 Cosimo Cecchi 2013-03-18 22:23:10 UTC
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.
Comment 6 Allison Karlitskaya (desrt) 2013-04-29 17:50:30 UTC
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).
Comment 7 Cosimo Cecchi 2013-04-29 18:32:04 UTC
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
Comment 8 Allison Karlitskaya (desrt) 2013-06-10 14:52:15 UTC
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.