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 756568 - Some improvements to gtkplacesview
Some improvements to gtkplacesview
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: .General
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-10-14 12:44 UTC by Carlos Soriano
Modified: 2015-10-15 17:26 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
gtkplacesview: tweak ui to allow more server rows (1.59 KB, patch)
2015-10-14 12:44 UTC, Carlos Soriano
committed Details | Review
gtkplacesview: rotate server list icon on toggled (3.73 KB, patch)
2015-10-14 12:45 UTC, Carlos Soriano
committed Details | Review
gtkplacesview: add a clear button to address entry (3.29 KB, patch)
2015-10-14 12:45 UTC, Carlos Soriano
committed Details | Review
gtkplacesview: align spinner with header label (1.35 KB, patch)
2015-10-14 12:45 UTC, Carlos Soriano
none Details | Review
gtkplacesview: remove hover color from rows (2.17 KB, patch)
2015-10-14 12:45 UTC, Carlos Soriano
committed Details | Review
gtkplacesview: plug leak (674 bytes, patch)
2015-10-14 20:09 UTC, Carlos Soriano
none Details | Review
gtkplacesview: align spinner with header label (1.13 KB, patch)
2015-10-14 20:10 UTC, Carlos Soriano
committed Details | Review
gtkplacesview: plug leak (1.31 KB, patch)
2015-10-15 17:24 UTC, Carlos Soriano
committed Details | Review

Description Carlos Soriano 2015-10-14 12:44:47 UTC
Finish to fix most of the issues listed on https://wiki.gnome.org/Apps/Nautilus/Roadmap/OtherPlaces .

Attaching here so it's easier for reviewers.

Only issues remaining that could be fixable is the address hint, to which we need consensus to either leave as it is or change it as per the mockups.
Comment 1 Carlos Soriano 2015-10-14 12:44:53 UTC
Created attachment 313260 [details] [review]
gtkplacesview: tweak ui to allow more server rows

Following design guidance, reduce row height and increase
popover height so the user is allowed to see more than 3
rows.
Comment 2 Carlos Soriano 2015-10-14 12:45:03 UTC
Created attachment 313261 [details] [review]
gtkplacesview: rotate server list icon on toggled

Disclosure triangles are usually used pointing down, however
in this case the popover spawns in the upper direction, which
makes it odd looking.
Instead of pointing always down or up, point down when not toggled and
animate a rotation when toggled.
Comment 3 Carlos Soriano 2015-10-14 12:45:10 UTC
Created attachment 313262 [details] [review]
gtkplacesview: add a clear button to address entry

So it allows a quick way to clear the entry.
Comment 4 Carlos Soriano 2015-10-14 12:45:19 UTC
Created attachment 313263 [details] [review]
gtkplacesview: align spinner with header label

Use the box margin top instead of the label margin top,
so the spinner remains aligned with the header label.
Comment 5 Carlos Soriano 2015-10-14 12:45:30 UTC
Created attachment 313264 [details] [review]
gtkplacesview: remove hover color from rows

Since other views are not using hover neither
Comment 6 Carlos Soriano 2015-10-14 12:46:22 UTC
(In reply to Carlos Soriano from comment #5)
> Created attachment 313264 [details] [review] [review]
> gtkplacesview: remove hover color from rows
> 
> Since other views are not using hover neither

Mathias pointed that it's not a good solution to override activatable for hover.
However, the only way to make a different hover style is overriding this .list-row.activatable class, if not, the style is not specifity enough. The original reason for activatable is: https://git.gnome.org/browse/gtk+/commit/?id=207e593075b01815973c4bfcb5a0d90f1de8d11e
Comment 7 Allan Day 2015-10-14 12:55:22 UTC
(In reply to Carlos Soriano from comment #0)
...
> Only issues remaining that could be fixable is the address hint, to which we
> need consensus to either leave as it is or change it as per the mockups.

I've reported this separately, as bug 756570.
Comment 8 Matthias Clasen 2015-10-14 19:18:36 UTC
Review of attachment 313260 [details] [review]:

this looks ok
Comment 9 Matthias Clasen 2015-10-14 19:20:48 UTC
Review of attachment 313261 [details] [review]:

I don't think I agree that it is "odd looking", really. At least not odd enough to justify custom theming...
Comment 10 Matthias Clasen 2015-10-14 19:25:32 UTC
Review of attachment 313262 [details] [review]:

Looks ok, other than the preexisting problems in the function

::: gtk/gtkplacesview.c
@@ +1852,3 @@
   supported = FALSE;
   supported_protocols = g_vfs_get_supported_uri_schemes (g_vfs_get_default ());
+  address = g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->address_entry)));

Looking at this function, I have two comments:

1. Why dup the address ? I don't see any need for that, saves a g_free and makes the goto out unnecessary.

2. On the other hand, you are leaking the scheme (independent of this patch)
Comment 11 Matthias Clasen 2015-10-14 19:26:51 UTC
Review of attachment 313263 [details] [review]:

::: gtk/gtkplacesview.c
@@ +1995,3 @@
+                             "spacing", 6,
+                             "margin-top", 6,
+                             NULL);

I don't really like the overuse of generic api. I'd much prefer to just
gtk_widget_set_margin_top (header, 6);
Comment 12 Matthias Clasen 2015-10-14 19:28:27 UTC
Review of attachment 313264 [details] [review]:

We've discussed this on irc. I dislike the way in which this overrides activatable, and as I said on irc, if we want to declare this list to be more content-nature than action-nature, we should use a more suitable style class for it rather than just hardcoding GtkPlacesView into the theme.
Comment 13 Carlos Soriano 2015-10-14 19:36:48 UTC
(In reply to Matthias Clasen from comment #9)
> Review of attachment 313261 [details] [review] [review]:
> 
> I don't think I agree that it is "odd looking", really. At least not odd
> enough to justify custom theming...

Allan, then down arrow?
Comment 14 Carlos Soriano 2015-10-14 19:37:06 UTC
(In reply to Matthias Clasen from comment #10)
> Review of attachment 313262 [details] [review] [review]:
> 
> Looks ok, other than the preexisting problems in the function
> 
> ::: gtk/gtkplacesview.c
> @@ +1852,3 @@
>    supported = FALSE;
>    supported_protocols = g_vfs_get_supported_uri_schemes (g_vfs_get_default
> ());
> +  address = g_strdup (gtk_entry_get_text (GTK_ENTRY (priv->address_entry)));
> 
> Looking at this function, I have two comments:
> 
> 1. Why dup the address ? I don't see any need for that, saves a g_free and
> makes the goto out unnecessary.
> 

because:
https://git.gnome.org/browse/gtk+/commit/?id=ecc698a282ac69e747026f58ac43eee7958be626

> 2. On the other hand, you are leaking the scheme (independent of this patch)

Ok
Comment 15 Carlos Soriano 2015-10-14 19:37:53 UTC
(In reply to Matthias Clasen from comment #11)
> Review of attachment 313263 [details] [review] [review]:
> 
> ::: gtk/gtkplacesview.c
> @@ +1995,3 @@
> +                             "spacing", 6,
> +                             "margin-top", 6,
> +                             NULL);
> 
> I don't really like the overuse of generic api. I'd much prefer to just
> gtk_widget_set_margin_top (header, 6);

Me neither, I was just following how is done all over the class, to be consistent.
I will change it.
Comment 16 Carlos Soriano 2015-10-14 19:40:15 UTC
(In reply to Matthias Clasen from comment #12)
> Review of attachment 313264 [details] [review] [review]:
> 
> We've discussed this on irc. I dislike the way in which this overrides
> activatable, and as I said on irc, if we want to declare this list to be
> more content-nature than action-nature, we should use a more suitable style
> class for it rather than just hardcoding GtkPlacesView into the theme.

Maybe I'm not good enough on CSS and I'm wrong, but there is no way to override the hover state of the list-box if not doing it this way, because the specifity of list-box.activatable:hover is greater than a custom class for say GtkPlacesViewRow:hover.
Comment 17 Carlos Soriano 2015-10-14 20:09:39 UTC
Created attachment 313330 [details] [review]
gtkplacesview: plug leak
Comment 18 Carlos Soriano 2015-10-14 20:10:26 UTC
Created attachment 313331 [details] [review]
gtkplacesview: align spinner with header label

Use the box margin top instead of the label margin top,
so the spinner remains aligned with the header label.
Comment 19 Allan Day 2015-10-15 09:23:37 UTC
(In reply to Carlos Soriano from comment #13)
> (In reply to Matthias Clasen from comment #9)
> > Review of attachment 313261 [details] [review] [review] [review]:
> > 
> > I don't think I agree that it is "odd looking", really. At least not odd
> > enough to justify custom theming...
> 
> Allan, then down arrow?

I guess. It's a bit sad to lose the spinning arrow - it's really neat.
Comment 20 Matthias Clasen 2015-10-15 13:53:29 UTC
Review of attachment 313262 [details] [review]:

ok then
Comment 21 Matthias Clasen 2015-10-15 13:53:56 UTC
Review of attachment 313261 [details] [review]:

retracting my opposition. I don't want to make Allan sad
Comment 22 Matthias Clasen 2015-10-15 13:54:49 UTC
Review of attachment 313330 [details] [review]:

::: gtk/gtkplacesview.c
@@ +1876,3 @@
   gtk_widget_set_sensitive (priv->connect_button, supported);
   g_free (address);
+  g_clear_pointer (&scheme, g_free);

Just use g_free here. You are aout to leave the scope, so setting the local variable to NULL is really pointless.
Comment 23 Matthias Clasen 2015-10-15 13:55:12 UTC
Review of attachment 313331 [details] [review]:

ok
Comment 24 Matthias Clasen 2015-10-15 14:03:23 UTC
Review of attachment 313264 [details] [review]:

hmm, I guess that is true (about specificity). Lets go with this for now, then
Comment 25 Carlos Soriano 2015-10-15 17:24:46 UTC
Created attachment 313390 [details] [review]
gtkplacesview: plug leak
Comment 26 Carlos Soriano 2015-10-15 17:26:10 UTC
Thanks for reviews. Pushed the leak patch with the correction and with a small change to avoid free a non initialized scheme.

Attachment 313260 [details] pushed as 831509f - gtkplacesview: tweak ui to allow more server rows
Attachment 313261 [details] pushed as f9b6c07 - gtkplacesview: rotate server list icon on toggled
Attachment 313262 [details] pushed as 9341f64 - gtkplacesview: add a clear button to address entry
Attachment 313264 [details] pushed as d29d54a - gtkplacesview: remove hover color from rows
Attachment 313331 [details] pushed as c368683 - gtkplacesview: align spinner with header label
Attachment 313390 [details] pushed as 9cc3e63 - gtkplacesview: plug leak