mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-12-28 22:41:43 +00:00
entry: Activate default via action
Switch to the new way of activating default.
This commit is contained in:
parent
7553d0c471
commit
218d635ca2
@ -2120,10 +2120,6 @@ gtk_entry_get_text_length (GtkEntry *entry)
|
||||
* widget for the window containing the entry. This usually means that
|
||||
* the dialog box containing the entry will be closed, since the default
|
||||
* widget is usually one of the dialog buttons.
|
||||
*
|
||||
* (For experts: if @setting is %TRUE, the entry calls
|
||||
* gtk_window_activate_default() on the window containing the entry, in
|
||||
* the default handler for the #GtkEntry::activate signal.)
|
||||
**/
|
||||
void
|
||||
gtk_entry_set_activates_default (GtkEntry *entry,
|
||||
|
@ -82,8 +82,7 @@ struct _GtkEntry
|
||||
* non-%NULL, this will be called to add additional entries to the context
|
||||
* menu when it is displayed.
|
||||
* @activate: Class handler for the #GtkEntry::activate signal. The default
|
||||
* implementation calls gtk_window_activate_default() on the entry’s top-level
|
||||
* window.
|
||||
* implementation activates the gtk.activate-default action.
|
||||
* @move_cursor: Class handler for the #GtkEntry::move-cursor signal. The
|
||||
* default implementation specifies the standard #GtkEntry cursor movement
|
||||
* behavior.
|
||||
|
@ -3839,30 +3839,9 @@ static void
|
||||
gtk_text_real_activate (GtkText *self)
|
||||
{
|
||||
GtkTextPrivate *priv = gtk_text_get_instance_private (self);
|
||||
GtkWindow *window;
|
||||
GtkWidget *default_widget, *focus_widget;
|
||||
GtkWidget *toplevel;
|
||||
GtkWidget *widget;
|
||||
|
||||
widget = GTK_WIDGET (self);
|
||||
|
||||
if (priv->activates_default)
|
||||
{
|
||||
toplevel = gtk_widget_get_toplevel (widget);
|
||||
if (GTK_IS_WINDOW (toplevel))
|
||||
{
|
||||
window = GTK_WINDOW (toplevel);
|
||||
|
||||
if (window)
|
||||
{
|
||||
default_widget = gtk_window_get_default_widget (window);
|
||||
focus_widget = gtk_root_get_focus (GTK_ROOT (window));
|
||||
if (widget != default_widget &&
|
||||
!(widget == focus_widget && (!default_widget || !gtk_widget_get_sensitive (default_widget))))
|
||||
gtk_window_activate_default (window);
|
||||
}
|
||||
}
|
||||
}
|
||||
gtk_widget_activate_default (GTK_WIDGET (self));
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -38,8 +38,7 @@ typedef struct _GtkTextClass GtkTextClass;
|
||||
* non-%NULL, this will be called to add additional entries to the context
|
||||
* menu when it is displayed.
|
||||
* @activate: Class handler for the #GtkText::activate signal. The default
|
||||
* implementation calls gtk_window_activate_default() on the entry’s top-level
|
||||
* window.
|
||||
* implementation activates the gtk.activate-default action.
|
||||
* @move_cursor: Class handler for the #GtkText::move-cursor signal. The
|
||||
* default implementation specifies the standard #GtkText cursor movement
|
||||
* behavior.
|
||||
|
Loading…
Reference in New Issue
Block a user