forked from AuroraMiddleware/gtk
Desensitize "Select All" when GtkEntry is empty
This avoids possible confusion in some situations, and selecting an empty string is not very useful. https://bugzilla.gnome.org/show_bug.cgi?id=647962
This commit is contained in:
parent
7d3693b82b
commit
54c3f05848
@ -8866,6 +8866,7 @@ popup_targets_received (GtkClipboard *clipboard,
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (info_entry_priv->popup_menu), menuitem);
|
||||
|
||||
menuitem = gtk_image_menu_item_new_from_stock (GTK_STOCK_SELECT_ALL, NULL);
|
||||
gtk_widget_set_sensitive (menuitem, gtk_entry_buffer_get_length (info_entry_priv->buffer) > 0);
|
||||
g_signal_connect_swapped (menuitem, "activate",
|
||||
G_CALLBACK (gtk_entry_select_all), entry);
|
||||
gtk_widget_show (menuitem);
|
||||
|
@ -8266,6 +8266,8 @@ popup_targets_received (GtkClipboard *clipboard,
|
||||
gtk_menu_shell_append (GTK_MENU_SHELL (priv->popup_menu), menuitem);
|
||||
|
||||
menuitem = gtk_image_menu_item_new_from_stock (GTK_STOCK_SELECT_ALL, NULL);
|
||||
gtk_widget_set_sensitive (menuitem,
|
||||
gtk_text_buffer_get_char_count (priv->buffer) > 0);
|
||||
g_signal_connect (menuitem, "activate",
|
||||
G_CALLBACK (select_all_cb), text_view);
|
||||
gtk_widget_show (menuitem);
|
||||
|
Loading…
Reference in New Issue
Block a user