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 113859 - Nautilus should use gnome icon theme for the spinner animation
Nautilus should use gnome icon theme for the spinner animation
Status: RESOLVED FIXED
Product: nautilus
Classification: Core
Component: general
0.x.x [obsolete]
Other Linux
: Normal normal
: ---
Assigned To: Nautilus Maintainers
Nautilus Maintainers
Depends on:
Blocks: 113161
 
 
Reported: 2003-05-27 20:41 UTC by Marco Pesenti Gritti
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Nautilus throbber patch (10.37 KB, patch)
2003-05-27 20:42 UTC, Marco Pesenti Gritti
none Details | Review
gnome-icon-theme patch (977 bytes, patch)
2003-05-27 20:43 UTC, Marco Pesenti Gritti
none Details | Review
Png that should go in gnome-icon-theme/36x36/apps (24.38 KB, image/png)
2003-05-27 20:44 UTC, Marco Pesenti Gritti
  Details
Makefile.am should go in gnome-icon-theme/36x36/apps (164 bytes, patch)
2003-05-27 20:45 UTC, Marco Pesenti Gritti
none Details | Review
Updated nautilus patch. (Fix a bug on size_request and cleanup some unnecessary changes) (10.65 KB, patch)
2003-05-28 10:29 UTC, Marco Pesenti Gritti
none Details | Review
Nautilus patch (8.26 KB, patch)
2003-05-28 23:38 UTC, Marco Pesenti Gritti
none Details | Review
Gnome icon theme patch (1.28 KB, patch)
2003-05-28 23:39 UTC, Marco Pesenti Gritti
none Details | Review
Yeah another nautilus patch update (9.24 KB, patch)
2003-05-29 08:00 UTC, Marco Pesenti Gritti
none Details | Review

Description Marco Pesenti Gritti 2003-05-27 20:41:39 UTC
I'm going to attach a patch that loads the spinner frames from a single png
(with a grid of images) and use gnome_icon_theme to retrieve the image path.
I'll post here also the gnome-icon-theme patch because I dont see a module
for it in bugzilla.
Comment 1 Marco Pesenti Gritti 2003-05-27 20:42:18 UTC
Created attachment 16885 [details] [review]
Nautilus throbber patch
Comment 2 Marco Pesenti Gritti 2003-05-27 20:43:10 UTC
Created attachment 16886 [details] [review]
gnome-icon-theme patch
Comment 3 Marco Pesenti Gritti 2003-05-27 20:44:13 UTC
Created attachment 16887 [details]
Png that should go in gnome-icon-theme/36x36/apps
Comment 4 Marco Pesenti Gritti 2003-05-27 20:45:37 UTC
Created attachment 16888 [details] [review]
Makefile.am should go in gnome-icon-theme/36x36/apps
Comment 5 Marco Pesenti Gritti 2003-05-28 10:29:05 UTC
Created attachment 16902 [details] [review]
Updated nautilus patch. (Fix a bug on size_request and cleanup some unnecessary changes)
Comment 6 Alexander Larsson 2003-05-28 13:37:34 UTC
I think we should handle the first image differently, like the
"throbber/rest" icon was handled before. You might not always want to
include the no-activity image in the set of throb-icons.

+	icon = gnome_icon_theme_lookup_icon (throbber->details->icon_theme,
+					     "gnome-spinner", -1, NULL, &size);
+	g_return_if_fail (icon != NULL);
Can't use g_return_if_fail here. We must be able to handle no icon ok,
and return_if_fail can be compiled out if you're disabling debug. Just
make it g_warn and return.

+	}
+	else {
+		element = g_list_nth (throbber->details->image_list,
throbber->details->current_frame);

and

+	if (throbber->details->current_frame > throbber->details->max_frame - 1)
+	{

Are not in the nautilus coding style. See docs/style-guide.html.
Comment 7 Marco Pesenti Gritti 2003-05-28 23:38:41 UTC
Created attachment 16926 [details] [review]
Nautilus patch
Comment 8 Marco Pesenti Gritti 2003-05-28 23:39:49 UTC
Created attachment 16927 [details] [review]
Gnome icon theme patch
Comment 9 Marco Pesenti Gritti 2003-05-28 23:46:54 UTC
Alex, thanks for the quick review.

- I got back quiescent_pixbuf and added a gnome-spinner-rest icon to
fill it. That seem to be cleaner than hardcoding a position in the
grid to be rest.
- I used g_warning instead of g_return_if_fail
- The code with styles problems is no more in the patch (because of
quiescient_pixbuf changes)
Comment 10 Marco Pesenti Gritti 2003-05-29 08:00:42 UTC
Created attachment 16936 [details] [review]
Yeah another nautilus patch update
Comment 11 Marco Pesenti Gritti 2003-05-29 08:02:26 UTC
Changes:
- Do not copy the image when there is no need to scale it, it's enough
to ref it, in fact subpixbuf keep a ref on the grid pixbuf.
- Do not go through all the list of animation images when calculating
dimensions, in the grid they are forced to be all the same size
Comment 12 Alexander Larsson 2003-05-30 09:30:18 UTC
scale_to_real_size() has a coding style issue:
	if (throbber->details->small_mode) {
		result = gdk_pixbuf_scale_simple (pixbuf,
						  size * 2 / 3,
						  size * 2 / 3,
						  GDK_INTERP_BILINEAR);
	}
	else {

In nautilus_throbber_load_images():
	for (y = 0; y < grid_height; y += size) {
		for (x = 0; x < grid_width ; x += size) {
			pixbuf = extract_frame (throbber, icon_pixbuf, x, y, size);
			image_list = g_list_prepend (image_list, pixbuf);
		}

You have to handle extract_frame returning NULL. That may happen if
e.g. the grid size is not a multiple of the icon size.

I didn't actually test the code, I just assume it works well. If you
don't know of any problems with it it should be fine to commit once
the comments above are fixed.
Comment 13 Marco Pesenti Gritti 2003-05-30 15:27:46 UTC
Checked in. I tested it quite well, but if there are problems let me
know and I'll fix them.