[nautilus/wip/apoos-maximus/gsoc2020: 62/73] properties-window: set Contents title lable's valign property
- From: António Fernandes <antoniof src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [nautilus/wip/apoos-maximus/gsoc2020: 62/73] properties-window: set Contents title lable's valign property
- Date: Sun, 2 Aug 2020 12:33:40 +0000 (UTC)
commit 69ba3341d540fa8e006a8adc994b286002c99934
Author: Apoorv Sachan <apoorv 99 sachan gmail com>
Date: Tue Jul 14 01:05:14 2020 +0530
properties-window: set Contents title lable's valign property
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"
src/nautilus-properties-window.c | 20 --------------------
src/resources/ui/nautilus-properties-window.ui | 1 +
2 files changed, 1 insertion(+), 20 deletions(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index 5c4de46be..05b257457 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -2101,7 +2101,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;
@@ -2163,7 +2162,6 @@ directory_contents_value_field_update (NautilusPropertiesWindow *window)
}
text = NULL;
- used_two_lines = FALSE;
if (total_count == 0)
{
@@ -2200,7 +2198,6 @@ directory_contents_value_field_update (NautilusPropertiesWindow *window)
_("(some contents unreadable)"),
NULL);
g_free (temp);
- used_two_lines = TRUE;
}
}
@@ -2208,23 +2205,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 f2caa3259..71cd428e9 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>
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]