summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorApoorv Sachan <apoorv.99.sachan@gmail.com>2020-07-14 01:05:14 +0530
committerAntónio Fernandes <antoniojpfernandes@gmail.com>2020-08-05 13:48:10 +0000
commitde0cfecf63b10892232020a588335b4905151225 (patch)
tree8a5108dee97ab7b821e7256f540d5036c84694c5
parent44072126b0011cba51c34a271fa87dc2c831dcde (diff)
downloadnautilus-de0cfecf63b10892232020a588335b4905151225.tar.gz
properties-window: Align Contents title lable propperly
When the Contents field displays a multi line message the Contents label needs to be aligned to the first line. Traditional implementation achieved this by conditionally appending a newline character, however now that valign property could be used to achieve the same, by setting it to "Start"
-rw-r--r--src/nautilus-properties-window.c20
-rw-r--r--src/resources/ui/nautilus-properties-window.ui1
2 files changed, 1 insertions, 20 deletions
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 293f9b22d..a72788f8a 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -2110,7 +2110,6 @@ directory_contents_value_field_update (NautilusPropertiesWindow *window)
guint total_count;
guint unreadable_directory_count;
goffset total_size;
- gboolean used_two_lines;
NautilusFile *file;
GList *l;
guint file_unreadable;
@@ -2172,7 +2171,6 @@ directory_contents_value_field_update (NautilusPropertiesWindow *window)
}
text = NULL;
- used_two_lines = FALSE;
if (total_count == 0)
{
@@ -2209,7 +2207,6 @@ directory_contents_value_field_update (NautilusPropertiesWindow *window)
_("(some contents unreadable)"),
NULL);
g_free (temp);
- used_two_lines = TRUE;
}
}
@@ -2217,23 +2214,6 @@ directory_contents_value_field_update (NautilusPropertiesWindow *window)
text);
g_free (text);
- /* Also set the title field here, with a trailing carriage return &
- * space if the value field has two lines. This is a hack to get the
- * "Contents:" title to line up with the first line of the
- * 2-line value. Maybe there's a better way to do this, but I
- * couldn't think of one.
- */
- text = g_strdup (_("Contents:"));
- if (used_two_lines)
- {
- temp = text;
- text = g_strconcat (temp, "\n ", NULL);
- g_free (temp);
- }
- gtk_label_set_text (GTK_LABEL (window->contents_title_label),
- text);
- g_free (text);
-
if (!deep_count_active)
{
window->deep_count_finished = TRUE;
diff --git a/src/resources/ui/nautilus-properties-window.ui b/src/resources/ui/nautilus-properties-window.ui
index f4425caa6..67d8c4a92 100644
--- a/src/resources/ui/nautilus-properties-window.ui
+++ b/src/resources/ui/nautilus-properties-window.ui
@@ -175,6 +175,7 @@
<child>
<object class="GtkLabel" id="contents_title_label">
<property name="can_focus">False</property>
+ <property name="valign">start</property>
<property name="label" translatable="yes">Contents:</property>
<property name="xalign">0</property>
</object>