textview: Always show select-all button in touch popup
authorMohammed Sadiq <sadiq@sadiqpk.org>
Fri, 11 May 2018 04:49:09 +0000 (10:19 +0530)
committerMohammed Sadiq <sadiq@sadiqpk.org>
Fri, 11 May 2018 10:39:57 +0000 (16:09 +0530)
"Select all" action is possible regardless of the text selection state
or if the text is editable or not.

gtk/gtktextview.c

index 3bdaf4c04d50222e59ea4fc3610811927bf84179..6d6a72dcee48e1f1160c42df1ac0e5297c3f79ea 100644 (file)
@@ -8789,9 +8789,6 @@ gtk_text_view_selection_bubble_popup_show (gpointer user_data)
   all_selected = gtk_text_iter_equal (&start, &sel_start) &&
                  gtk_text_iter_equal (&end, &sel_end);
 
-  if (!priv->editable && !has_selection)
-    return G_SOURCE_REMOVE;
-
   if (priv->selection_bubble)
     gtk_widget_destroy (priv->selection_bubble);
 
@@ -8817,8 +8814,7 @@ gtk_text_view_selection_bubble_popup_show (gpointer user_data)
   clipboard = gtk_widget_get_clipboard (GTK_WIDGET (text_view));
   has_clipboard = gdk_content_formats_contain_gtype (gdk_clipboard_get_formats (clipboard), GTK_TYPE_TEXT_BUFFER);
 
-  if (range_contains_editable_text (&sel_start, &sel_end, priv->editable) && has_selection)
-    append_bubble_action (text_view, toolbar, _("Select all"), "edit-select-all-symbolic", "select-all", !all_selected);
+  append_bubble_action (text_view, toolbar, _("Select all"), "edit-select-all-symbolic", "select-all", !all_selected);
 
   if (range_contains_editable_text (&sel_start, &sel_end, priv->editable) && has_selection)
     append_bubble_action (text_view, toolbar, _("Cut"), "edit-cut-symbolic", "cut-clipboard", TRUE);