Index: docs/README.thunarrc =================================================================== --- docs/README.thunarrc (revision 20692) +++ docs/README.thunarrc (working copy) @@ -168,6 +168,13 @@ Whether to use single click navigation instead of the default double click navigation. + * MiscSingleClickTimeout (0...2000) + + If MiscSingleClick mode is enabled this is the amount of time in + milliseconds after which the item under the mouse pointer will be + selected automatically. A value of 0 disables the automatic selec- + tion. + * MiscTextBesidesIcons (FALSE/TRUE) Controls whether the icon view should display the file names beside Index: thunar/thunar-preferences-dialog.c =================================================================== --- thunar/thunar-preferences-dialog.c (revision 20692) +++ thunar/thunar-preferences-dialog.c (working copy) @@ -193,14 +193,19 @@ thunar_preferences_dialog_init (ThunarPreferencesDialog *dialog) { AtkRelationSet *relations; + GtkAdjustment *adjustment; AtkRelation *relation; AtkObject *object; GtkWidget *notebook; GtkWidget *button; + GtkWidget *align; GtkWidget *combo; GtkWidget *frame; GtkWidget *label; + GtkWidget *range; GtkWidget *table; + GtkWidget *hbox; + GtkWidget *ibox; GtkWidget *vbox; /* grab a reference on the preferences */ @@ -444,7 +449,7 @@ gtk_frame_set_label_widget (GTK_FRAME (frame), label); gtk_widget_show (label); - table = gtk_table_new (1, 2, FALSE); + table = gtk_table_new (3, 1, FALSE); gtk_table_set_row_spacings (GTK_TABLE (table), 6); gtk_table_set_col_spacings (GTK_TABLE (table), 12); gtk_container_set_border_width (GTK_CONTAINER (table), 12); @@ -454,13 +459,81 @@ button = gtk_radio_button_new_with_mnemonic (NULL, _("_Single click to activate items")); exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-single-click", G_OBJECT (button), "active"); g_signal_connect (G_OBJECT (button), "toggled", G_CALLBACK (g_object_notify), "active"); - gtk_table_attach (GTK_TABLE (table), button, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 0, 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_widget_show (button); + align = gtk_alignment_new (0.0f, 0.0f, 1.0f, 1.0f); + gtk_alignment_set_padding (GTK_ALIGNMENT (align), 0, 6, 18, 0); + exo_binding_new (G_OBJECT (button), "active", G_OBJECT (align), "sensitive"); + gtk_table_attach (GTK_TABLE (table), align, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_widget_show (align); + + hbox = gtk_hbox_new (FALSE, 0); + gtk_container_add (GTK_CONTAINER (align), hbox); + gtk_widget_show (hbox); + + ibox = gtk_vbox_new (FALSE, 0); + gtk_box_pack_start (GTK_BOX (hbox), ibox, FALSE, FALSE, 0); + gtk_widget_show (ibox); + + label = gtk_label_new_with_mnemonic (_("The d_elay after which an item gets selected\n" + "when the mouse pointer is paused over it:")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0f, 0.0f); + gtk_box_pack_start (GTK_BOX (ibox), label, FALSE, FALSE, 0); + gtk_widget_show (label); + + align = g_object_new (GTK_TYPE_ALIGNMENT, "height-request", 6, NULL); + gtk_box_pack_start (GTK_BOX (ibox), align, FALSE, FALSE, 0); + gtk_widget_show (align); + + range = gtk_hscale_new_with_range (0.0, 2000.0, 100.0); + gtk_scale_set_draw_value (GTK_SCALE (range), FALSE); + gtk_tooltips_set_tip (dialog->tooltips, range, _("When single-click activation is enabled, pausing the mouse pointer over an item " + "will automatically select that item after the chosen delay. You can disable this " + "behavior by moving the slider to the left-most position. This behavior may be " + "useful when single clicks activate items, and you want only to select the item " + "without activating it."), NULL); + gtk_box_pack_start (GTK_BOX (ibox), range, FALSE, FALSE, 0); + gtk_label_set_mnemonic_widget (GTK_LABEL (label), range); + gtk_widget_show (range); + + /* connect the range's adjustment to the preferences */ + adjustment = gtk_range_get_adjustment (GTK_RANGE (range)); + exo_mutual_binding_new (G_OBJECT (dialog->preferences), "misc-single-click-timeout", G_OBJECT (adjustment), "value"); + + /* set Atk label relation for the range */ + object = gtk_widget_get_accessible (range); + relations = atk_object_ref_relation_set (gtk_widget_get_accessible (label)); + relation = atk_relation_new (&object, 1, ATK_RELATION_LABEL_FOR); + atk_relation_set_add (relations, relation); + g_object_unref (G_OBJECT (relation)); + + hbox = gtk_hbox_new (TRUE, 6); + gtk_box_pack_start (GTK_BOX (ibox), hbox, FALSE, FALSE, 0); + gtk_widget_show (hbox); + + label = gtk_label_new (_("Disabled")); + gtk_misc_set_alignment (GTK_MISC (label), 0.0f, 0.5f); + gtk_label_set_attributes (GTK_LABEL (label), thunar_pango_attr_list_small_italic ()); + gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0); + gtk_widget_show (label); + + label = gtk_label_new (_("Medium")); + gtk_misc_set_alignment (GTK_MISC (label), 0.5f, 0.5f); + gtk_label_set_attributes (GTK_LABEL (label), thunar_pango_attr_list_small_italic ()); + gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0); + gtk_widget_show (label); + + label = gtk_label_new (_("Long")); + gtk_misc_set_alignment (GTK_MISC (label), 1.0f, 0.5f); + gtk_label_set_attributes (GTK_LABEL (label), thunar_pango_attr_list_small_italic ()); + gtk_box_pack_start (GTK_BOX (hbox), label, TRUE, TRUE, 0); + gtk_widget_show (label); + button = gtk_radio_button_new_with_mnemonic_from_widget (GTK_RADIO_BUTTON (button), _("_Double click to activate items")); exo_mutual_binding_new_with_negation (G_OBJECT (dialog->preferences), "misc-single-click", G_OBJECT (button), "active"); g_signal_connect (G_OBJECT (button), "toggled", G_CALLBACK (g_object_notify), "active"); - gtk_table_attach (GTK_TABLE (table), button, 0, 1, 1, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + gtk_table_attach (GTK_TABLE (table), button, 0, 1, 2, 3, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_widget_show (button); Index: thunar/thunar-preferences.c =================================================================== --- thunar/thunar-preferences.c (revision 20692) +++ thunar/thunar-preferences.c (working copy) @@ -73,6 +73,7 @@ PROP_MISC_SHOW_ABOUT_TEMPLATES, PROP_MISC_SHOW_THUMBNAILS, PROP_MISC_SINGLE_CLICK, + PROP_MISC_SINGLE_CLICK_TIMEOUT, PROP_MISC_TEXT_BESIDE_ICONS, PROP_SHORTCUTS_ICON_EMBLEMS, PROP_SHORTCUTS_ICON_SIZE, @@ -512,6 +513,22 @@ EXO_PARAM_READWRITE)); /** + * ThunarPreferences:misc-single-click-timeout: + * + * If single-click mode is enabled this is the amount of time + * in milliseconds after which the item under the mouse cursor + * will be selected automatically. A value of %0 disables the + * automatic selection. + **/ + g_object_class_install_property (gobject_class, + PROP_MISC_SINGLE_CLICK_TIMEOUT, + g_param_spec_uint ("misc-single-click-timeout", + "misc-single-click-timeout", + "misc-single-click-timeout", + 0u, G_MAXUINT, 500u, + EXO_PARAM_READWRITE)); + + /** * ThunarPreferences:misc-text-beside-icons: * * Whether the icon view should display the file names beside the Index: thunar/thunar-standard-view.c =================================================================== --- thunar/thunar-standard-view.c (revision 20692) +++ thunar/thunar-standard-view.c (working copy) @@ -641,8 +641,9 @@ */ g_object_set (G_OBJECT (view), "model", standard_view->model, NULL); - /* apply the single-click mode to the view */ + /* apply the single-click settings to the view */ exo_binding_new (G_OBJECT (standard_view->preferences), "misc-single-click", G_OBJECT (view), "single-click"); + exo_binding_new (G_OBJECT (standard_view->preferences), "misc-single-click-timeout", G_OBJECT (view), "single-click-timeout"); /* apply the default sort column and sort order */ g_object_get (G_OBJECT (standard_view->preferences), "last-sort-column", &sort_column, "last-sort-order", &sort_order, NULL); Index: ChangeLog =================================================================== --- ChangeLog (revision 20692) +++ ChangeLog (working copy) @@ -1,5 +1,17 @@ 2006-03-31 Benedikt Meurer + * docs/README.thunarrc, thunar/thunar-preferences.c: Add new option + "MiscSingleClickTimeout", which specifies the delay after which + items are automatically selected in single-click mode. + * thunar/thunar-preferences-dialog.c(thunar_preferences_dialog_init): + Add "MiscSingleClickTimeout" setting to the preferences dialog. + * thunar/thunar-standard-view.c(thunar_standard_view_constructor): + Apply global single-click timeout setting to the view. + * po/Thunar.pot, po/*.po: Merge new strings. + * po/de.po: Update german translations. + +2006-03-31 Benedikt Meurer + * thunar/thunar-list-model.c(thunar_list_model_file_changed): Do not re-sort the model unless the name of the file (and thereby its position) has changed. Greatly improves the performance of the