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




commit f15bacf13fdab2e1d5e7bbcd63f3d833d78f1fc4
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 502ccd655..7e5ccb191 100644
--- a/src/nautilus-properties-window.c
+++ b/src/nautilus-properties-window.c
@@ -1377,17 +1377,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]