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 778930 - gtk3-icon-browser: Add scalable icons to icon detail modal window
gtk3-icon-browser: Add scalable icons to icon detail modal window
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
3.22.x
Other Linux
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2017-02-19 23:49 UTC by Julian Sparber
Modified: 2017-10-16 12:29 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtk3-icon-browser: Add scalable icons to icon detail modal window (8.55 KB, patch)
2017-02-19 23:51 UTC, Julian Sparber
none Details | Review
Fixed style issuse (7.95 KB, patch)
2017-08-07 21:48 UTC, Julian Sparber
none Details | Review
icon-browser: Add scalable icons to icon detail modal window (8.03 KB, patch)
2017-10-16 12:27 UTC, Carlos Garnacho
committed Details | Review

Description Julian Sparber 2017-02-19 23:49:13 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.
Comment 1 Julian Sparber 2017-02-19 23:51:23 UTC
Created attachment 346208 [details] [review]
gtk3-icon-browser: Add scalable icons to icon detail modal window

This implements the feature.
Comment 2 Carlos Garnacho 2017-08-06 16:24:44 UTC
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.
Comment 3 Julian Sparber 2017-08-07 21:48:18 UTC
Created attachment 357158 [details] [review]
Fixed style issuse

Fixed the style issues outlined by Carlos Garnacho. By the way thanks a lot.
Comment 4 Carlos Garnacho 2017-10-16 11:14:19 UTC
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 },
Comment 5 Carlos Garnacho 2017-10-16 12:27:50 UTC
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.
Comment 6 Carlos Garnacho 2017-10-16 12:29:28 UTC
Pushed to gtk-3-22 and master.

Attachment 361667 [details] pushed as 6f71e40 - icon-browser: Add scalable icons to icon detail modal window