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 757303 - Vertically align path labels in Other Locations view
Vertically align path labels in Other Locations view
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
unspecified
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2015-10-29 12:22 UTC by Georges Basile Stavracas Neto
Modified: 2015-10-30 13:36 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
placesview: vertically align path labels (4.94 KB, patch)
2015-10-29 12:22 UTC, Georges Basile Stavracas Neto
none Details | Review
placesview: vertically align path labels (5.33 KB, patch)
2015-10-29 13:07 UTC, Georges Basile Stavracas Neto
committed Details | Review

Description Georges Basile Stavracas Neto 2015-10-29 12:22:29 UTC
They are all misaligned and it gives it a very bad
impression.
Comment 1 Georges Basile Stavracas Neto 2015-10-29 12:22:37 UTC
Created attachment 314389 [details] [review]
placesview: vertically align path labels

The current situation is somewhat sad, with the path
label totally misaligned throughout the rows.

This is fixed by using a size group for the path labels,
so they all have the same allocated size (with the max
of 15 chars). Also, instead of hiding the eject button,
set it child-invisible, so it is hidden and yet it's size
is allocated by GtkBox.
(
Comment 2 Matthias Clasen 2015-10-29 13:00:52 UTC
Review of attachment 314389 [details] [review]:

::: gtk/gtkplacesview.c
@@ +73,3 @@
   GtkWidget                     *network_placeholder_label;
 
+  GtkSizeGroup                  *size_group;

Might be good to give a more meaningful name, like path_size_group ?

::: gtk/gtkplacesviewrow.c
@@ +151,3 @@
     case PROP_MOUNT:
       g_set_object (&self->mount, g_value_get_object (value));
+      gtk_widget_set_child_visible (GTK_WIDGET (self->eject_button), self->mount != NULL);

This use of child visible here seems a bit unconventional and fragile.
At the very least, it needs a comment explaining what is going on.

@@ +327,3 @@
+void
+gtk_places_view_row_set_size_group (GtkPlacesViewRow *row,
+                                    GtkSizeGroup     *group)

...and reflect that here too then: gtk_places_view_row_set_path_size_group
Comment 3 Georges Basile Stavracas Neto 2015-10-29 13:07:37 UTC
Created attachment 314394 [details] [review]
placesview: vertically align path labels

Added a comment and updated function and var names.
Comment 4 Matthias Clasen 2015-10-29 13:13:27 UTC
Review of attachment 314394 [details] [review]:

thanks for making those changes. the use of child-visible seems iffy, still
Comment 5 Georges Basile Stavracas Neto 2015-10-30 13:36:36 UTC
Attachment 314394 [details] pushed as 50c6a11 - placesview: vertically align path labels