Posting 43 from psydbernz posted at 2025-01-10 16:23:42 expires:
2025-04-10 16:23:42
diff --git a/thunar/thunar-properties-dialog.c b/thunar/thunar-properties-dialog.c
index bda0fca62..f053cdbc9 100644
--- a/thunar/thunar-properties-dialog.c
+++ b/thunar/thunar-properties-dialog.c
@@ -175,9 +175,9 @@ struct _ThunarPropertiesDialog
GtkWidget *kind_ebox;
GtkWidget *kind_label;
GtkWidget *openwith_chooser;
- GtkWidget *link_label;
- GtkWidget *link_label_text;
- GtkWidget *location_label;
+ GtkWidget *link_entry;
+ GtkWidget *link_entry_text;
+ GtkWidget *location_entry;
GtkWidget *origin_label;
GtkWidget *created_label;
GtkWidget *deleted_label;
@@ -484,20 +484,21 @@ thunar_properties_dialog_constructed (GObject *object)
++row;
label = gtk_label_new (_("Link Target:"));
- dialog->link_label_text = label;
+ dialog->link_entry_text = label;
gtk_label_set_attributes (GTK_LABEL (label), thunar_pango_attr_list_bold ());
gtk_label_set_xalign (GTK_LABEL (label), 1.0f);
gtk_grid_attach (GTK_GRID (grid), label, 0, row, 1, 1);
gtk_widget_show (label);
- dialog->link_label = g_object_new (GTK_TYPE_LABEL, "ellipsize", PANGO_ELLIPSIZE_START, "xalign", 0.0f, NULL);
- gtk_label_set_selectable (GTK_LABEL (dialog->link_label), TRUE);
- g_object_bind_property (G_OBJECT (dialog->link_label), "visible",
+ dialog->link_entry = g_object_new (GTK_TYPE_ENTRY, NULL);
+ gtk_editable_set_editable (GTK_EDITABLE (dialog->link_entry), FALSE);
+ gtk_entry_set_has_frame (GTK_ENTRY (dialog->link_entry), FALSE);
+ g_object_bind_property (G_OBJECT (dialog->link_entry), "visible",
G_OBJECT (label), "visible",
G_BINDING_SYNC_CREATE);
- gtk_widget_set_hexpand (dialog->link_label, TRUE);
- gtk_grid_attach (GTK_GRID (grid), dialog->link_label, 1, row, 1, 1);
- gtk_widget_show (dialog->link_label);
+ gtk_widget_set_hexpand (dialog->link_entry, TRUE);
+ gtk_grid_attach (GTK_GRID (grid), dialog->link_entry, 1, row, 1, 1);
+ gtk_widget_show (dialog->link_entry);
++row;
@@ -528,14 +529,15 @@ thunar_properties_dialog_constructed (GObject *object)
gtk_grid_attach (GTK_GRID (grid), label, 0, row, 1, 1);
gtk_widget_show (label);
- dialog->location_label = g_object_new (GTK_TYPE_LABEL, "ellipsize", PANGO_ELLIPSIZE_START, "xalign", 0.0f, NULL);
- gtk_label_set_selectable (GTK_LABEL (dialog->location_label), TRUE);
- g_object_bind_property (G_OBJECT (dialog->location_label), "visible",
+ dialog->location_entry = g_object_new (GTK_TYPE_ENTRY, NULL);
+ gtk_editable_set_editable (GTK_EDITABLE (dialog->location_entry), FALSE);
+ gtk_entry_set_has_frame (GTK_ENTRY (dialog->location_entry), FALSE);
+ g_object_bind_property (G_OBJECT (dialog->location_entry), "visible",
G_OBJECT (label), "visible",
G_BINDING_SYNC_CREATE);
- gtk_widget_set_hexpand (dialog->location_label, TRUE);
- gtk_grid_attach (GTK_GRID (grid), dialog->location_label, 1, row, 1, 1);
- gtk_widget_show (dialog->location_label);
+ gtk_widget_set_hexpand (dialog->location_entry, TRUE);
+ gtk_grid_attach (GTK_GRID (grid), dialog->location_entry, 1, row, 1, 1);
+ gtk_widget_show (dialog->location_entry);
++row;
@@ -1426,14 +1428,15 @@ thunar_properties_dialog_update_single (ThunarPropertiesDialog *dialog)
if (G_UNLIKELY (path != NULL))
{
display_name = g_filename_display_name (path);
- gtk_label_set_text (GTK_LABEL (dialog->link_label), display_name);
- gtk_widget_set_tooltip_text (dialog->link_label, display_name);
- gtk_widget_show (dialog->link_label);
+ gtk_entry_set_text (GTK_ENTRY (dialog->link_entry), display_name);
+ gtk_editable_set_position (GTK_EDITABLE (dialog->link_entry), -1);
+ gtk_widget_set_tooltip_text (dialog->link_entry, display_name);
+ gtk_widget_show (dialog->link_entry);
g_free (display_name);
}
else
{
- gtk_widget_hide (dialog->link_label);
+ gtk_widget_hide (dialog->link_entry);
}
/* update the original path */
@@ -1455,15 +1458,16 @@ thunar_properties_dialog_update_single (ThunarPropertiesDialog *dialog)
if (G_UNLIKELY (parent_file != NULL))
{
display_name = g_file_get_parse_name (thunar_file_get_file (parent_file));
- gtk_label_set_text (GTK_LABEL (dialog->location_label), display_name);
- gtk_widget_set_tooltip_text (dialog->location_label, display_name);
- gtk_widget_show (dialog->location_label);
+ gtk_entry_set_text (GTK_ENTRY (dialog->location_entry), display_name);
+ gtk_editable_set_position (GTK_EDITABLE (dialog->location_entry), -1);
+ gtk_widget_set_tooltip_text (GTK_WIDGET (dialog->location_entry), display_name);
+ gtk_widget_show (GTK_WIDGET (dialog->location_entry));
g_object_unref (G_OBJECT (parent_file));
g_free (display_name);
}
else
{
- gtk_widget_hide (dialog->location_label);
+ gtk_widget_hide (GTK_WIDGET (dialog->location_entry));
}
/* update the volume */
@@ -1633,7 +1637,7 @@ thunar_properties_dialog_update_multiple (ThunarPropertiesDialog *dialog)
gtk_widget_hide (dialog->freespace_vbox);
gtk_widget_hide (dialog->origin_label);
gtk_widget_hide (dialog->openwith_chooser);
- gtk_widget_hide (dialog->link_label);
+ gtk_widget_hide (dialog->link_entry);
names_string = g_string_new (NULL);
@@ -1648,8 +1652,8 @@ thunar_properties_dialog_update_multiple (ThunarPropertiesDialog *dialog)
if (resolved_path != NULL)
{
/* If there is even a single symlink then make 'Link Targets' visible and rename it to 'Link Targets' */
- gtk_widget_show (dialog->link_label);
- gtk_label_set_text (GTK_LABEL (dialog->link_label_text), _("Link Targets:"));
+ gtk_widget_show (dialog->link_entry);
+ gtk_label_set_text (GTK_LABEL (dialog->link_entry_text), _("Link Targets:"));
/* Add , only if there was a resolved path before*/
if (str_of_resolved_paths->len != 0)
@@ -1747,13 +1751,14 @@ thunar_properties_dialog_update_multiple (ThunarPropertiesDialog *dialog)
/* update the link target */
if (G_LIKELY (str_of_resolved_paths->len > 0))
{
- gtk_label_set_text (GTK_LABEL (dialog->link_label), str_of_resolved_paths->str);
- gtk_widget_set_tooltip_text (dialog->link_label, str_of_resolved_paths->str);
- gtk_widget_show (dialog->link_label);
+ gtk_entry_set_text (GTK_ENTRY (dialog->link_entry), str_of_resolved_paths->str);
+ gtk_editable_set_position (GTK_EDITABLE (dialog->link_entry), -1);
+ gtk_widget_set_tooltip_text (dialog->link_entry, str_of_resolved_paths->str);
+ gtk_widget_show (dialog->link_entry);
}
else
{
- gtk_widget_hide (dialog->link_label);
+ gtk_widget_hide (dialog->link_entry);
}
g_string_free (str_of_resolved_paths, TRUE);
@@ -1761,15 +1766,16 @@ thunar_properties_dialog_update_multiple (ThunarPropertiesDialog *dialog)
if (G_UNLIKELY (parent_file != NULL))
{
display_name = g_file_get_parse_name (thunar_file_get_file (parent_file));
- gtk_label_set_text (GTK_LABEL (dialog->location_label), display_name);
- gtk_widget_set_tooltip_text (dialog->location_label, display_name);
- gtk_widget_show (dialog->location_label);
+ gtk_entry_set_text (GTK_ENTRY (dialog->location_entry), display_name);
+ gtk_editable_set_position (GTK_EDITABLE (dialog->location_entry), -1);
+ gtk_widget_set_tooltip_text (dialog->location_entry, display_name);
+ gtk_widget_show (dialog->location_entry);
g_object_unref (G_OBJECT (parent_file));
g_free (display_name);
}
else
{
- gtk_widget_hide (dialog->location_label);
+ gtk_widget_hide (dialog->location_entry);
}
/* update the volume */