[nautilus/wip/antoniof/properties-followup: 9/10] properties-window: Show MIME type as tooltip




commit ca972490c5ed01af833c664e70d18037fded88f6
Author: António Fernandes <antoniof gnome org>
Date:   Thu Aug 4 13:12:20 2022 +0100

    properties-window: Show MIME type as tooltip
    
    Displaying type name and MIME type string in the same line leads to
    ellipsizing in some cases (e.g. OpenDocument types).
    
    Also, MIME type is quite a technical thing which doesn't have to be
    exposed to everybody.
    
    This is exactly what tooltips are for.

 src/nautilus-properties-window.c | 16 ++++++----------
 1 file changed, 6 insertions(+), 10 deletions(-)
---
diff --git a/src/nautilus-properties-window.c b/src/nautilus-properties-window.c
index f9790d403..bd1197e23 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -1342,17 +1342,13 @@ value_field_update (GtkLabel                 *label,
 
     attribute_value = file_list_get_string_attribute (file_list,
                                                       attribute_name);
-    if (attribute_value != NULL &&
-        g_str_equal (attribute_name, "detailed_type"))
+    if (g_str_equal (attribute_name, "detailed_type"))
     {
-        g_autofree char *mime_type = file_list_get_string_attribute (file_list,
-                                                                     "mime_type");
-        if (mime_type != NULL &&
-            !g_str_equal (mime_type, "inode/directory"))
-        {
-            g_autofree char *tmp = g_steal_pointer (&attribute_value);
-            attribute_value = g_strdup_printf (C_("MIME type description (MIME type)", "%s (%s)"), tmp, 
mime_type);
-        }
+        g_autofree char *mime_type = NULL;
+
+        mime_type = file_list_get_string_attribute (file_list, "mime_type");
+
+        gtk_widget_set_tooltip_text (GTK_WIDGET (label), mime_type);
     }
 
     gtk_label_set_text (label, attribute_value);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]