From de32a70a10f8616e0669cbca9028be8ae842ba9c Mon Sep 17 00:00:00 2001 From: Felix Riemann Date: Wed, 15 Feb 2012 14:25:23 +0100 Subject: MetadataSidebar: Change layout of the data values Move the value labels in their own line below their key labels. That improves the visibility of the values and takes away less horizontal space for image viewing. Unfortunately scrolling could be necessary now as the vertical space requirement increased. origin commit: https://gitlab.gnome.org/GNOME/eog/commit/00aad08 --- src/eom-metadata-sidebar.c | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) (limited to 'src') diff --git a/src/eom-metadata-sidebar.c b/src/eom-metadata-sidebar.c index f8f3002..6e44435 100644 --- a/src/eom-metadata-sidebar.c +++ b/src/eom-metadata-sidebar.c @@ -127,22 +127,30 @@ _gtk_grid_append_prop_line (GtkGrid *grid, GtkWidget *sibling, GtkWidget **data_label, const gchar *text) { GtkWidget *label; + gchar *markup; + GtkWidget *box; - label = gtk_label_new (text); - gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); + box = gtk_box_new (GTK_ORIENTATION_VERTICAL, 0); + label = gtk_label_new (NULL); + markup = g_markup_printf_escaped("%s", text); + gtk_label_set_markup (GTK_LABEL(label), markup); + g_free (markup); - gtk_grid_attach_next_to (grid, label, sibling, GTK_POS_BOTTOM, 1, 1); + gtk_misc_set_alignment (GTK_MISC (label), 0.0, 1.0); + gtk_box_pack_start (GTK_BOX (box), label, FALSE, FALSE, 0); if (G_LIKELY (data_label != NULL)) { *data_label = gtk_label_new (NULL); gtk_label_set_selectable (GTK_LABEL (*data_label), TRUE); - gtk_label_set_ellipsize (GTK_LABEL (*data_label), PANGO_ELLIPSIZE_END); - gtk_misc_set_alignment (GTK_MISC (*data_label), 0.0, 0.5); - gtk_grid_attach_next_to (grid, *data_label, label, - GTK_POS_RIGHT, 1, 1); + gtk_label_set_line_wrap (GTK_LABEL(*data_label), TRUE); + gtk_misc_set_alignment (GTK_MISC (*data_label), 0.0, 0.0); + // Add a small margin to make it a sublabel to the first label + gtk_widget_set_margin_left (*data_label, 12); + gtk_box_pack_end (GTK_BOX(box), *data_label, FALSE, FALSE, 0); } + gtk_grid_attach_next_to (grid, box, sibling, GTK_POS_BOTTOM, 2, 1); - return label; + return box; } #if HAVE_EXEMPI @@ -499,11 +507,15 @@ eom_metadata_sidebar_init (EomMetadataSidebar *sidebar) label = _gtk_grid_append_prop_line (GTK_GRID (priv->grid), label, NULL, _("Folder:")); +{ priv->folder_button = gtk_button_new_with_label (""); g_signal_connect (priv->folder_button, "clicked", G_CALLBACK (_folder_button_clicked_cb), sidebar); - gtk_grid_attach_next_to (GTK_GRID (priv->grid), priv->folder_button, - label, GTK_POS_RIGHT, 1, 1); + gtk_widget_set_margin_left (priv->folder_button, 12); + gtk_widget_set_margin_right (priv->folder_button, 12); + gtk_widget_set_margin_top (priv->folder_button, 3); + gtk_box_pack_end (GTK_BOX (label), priv->folder_button, FALSE, FALSE, 0); +} #if HAVE_METADATA label = _gtk_grid_append_title_line (GTK_GRID (priv->grid), -- cgit v1.2.1