GNOME Bugzilla – Bug 778930
gtk3-icon-browser: Add scalable icons to icon detail modal window
Last modified: 2017-10-16 12:29:33 UTC
When making mockups for GNOME apps in Inkscape, looking for symbolic icons is a common task. Searching for icons in the file system is clumsy, and icon-browser provides a much better interface for finding them. However, currently there is no way to insert the symbolic icons as SVG directly from icon-browser. It would be great if this was possible, as it would be a much better workflow for designing with symbolic icons.
Created attachment 346208 [details] [review] gtk3-icon-browser: Add scalable icons to icon detail modal window This implements the feature.
Review of attachment 346208 [details] [review]: Thanks for the patch. the code seems alright, there's some style nits though. First thing to point out, commit log should be manually wrapped to a max width of 74cols. ::: demos/icon-browser/iconbrowserwin.c @@ +14,3 @@ +/* Drag 'n Drop */ +static GtkTargetEntry target_table[] = { + { "text/uri-list", 0, 0}, indenting is 2 spaces wide @@ +73,3 @@ GdkPixbuf *pixbuf; + stray newline @@ +126,3 @@ set_image (win->image5, name, 64); + if (win->symbolic) + { gtk+ uses gnu indentation, like this: if (foo) { bar1 (); bar2 (); } else { baz1 (); baz2 (); } Mind the indenting of curly brackets. @@ +823,3 @@ + + info = gtk_icon_theme_lookup_icon (gtk_icon_theme_get_default (), name, -1, 0); + file = g_file_new_for_path(gtk_icon_info_get_filename (info)); missing space before first ( @@ +841,3 @@ parent = gtk_widget_get_parent (image); gtk_drag_source_set (parent, GDK_BUTTON1_MASK, NULL, 0, GDK_ACTION_COPY); + stray newline @@ +855,3 @@ + target_table, G_N_ELEMENTS (target_table), + GDK_ACTION_COPY | GDK_ACTION_MOVE | + GDK_ACTION_LINK | GDK_ACTION_ASK); I think you can only offer GDK_ACTION_COPY here, move/ask are not implemented, and link is dubious/unimplemented here.
Created attachment 357158 [details] [review] Fixed style issuse Fixed the style issues outlined by Carlos Garnacho. By the way thanks a lot.
Review of attachment 357158 [details] [review]: Looks good! Found two minor nits but they can be fixed in place before pushing. It seems the commit log summary (the first line) got also also truncated. It would be preferable to find a wording that doesn't require this, s/gtk3-icon-browser/icon-browser/ and s/modal window/dialog/ come to mind. ::: demos/icon-browser/iconbrowserwin.c @@ +14,3 @@ +/* Drag 'n Drop */ +static GtkTargetEntry target_table[] = { + {"text/uri-list", 0, 0}, Style nit: there should be a space between the curly braces and the struct definition: { "text/...", 0, 0 },
Created attachment 361667 [details] [review] icon-browser: Add scalable icons to icon detail modal window When making mockups for GNOME apps in Inkscape, looking for symbolic icons is a common task. Searching for icons in the file system is clumsy, and icon-browser provides a much better interface for finding them. However, currently there is no way to insert the symbolic icons as SVG directly from icon-browser, so right now it is only useful for finding the name. This patch adds a sixth column to the modal window that appears when clicking a symbolic icon. The icon in this column is labeled "scalable", and dragging it onto another window results in the vector icon URI being inserted. This enables a much simpler workflow when designing with symbolic icons.
Pushed to gtk-3-22 and master. Attachment 361667 [details] pushed as 6f71e40 - icon-browser: Add scalable icons to icon detail modal window