[gtk/wip/matthiasc/can-focus: 19/27] widget: Make the :has-focus property readonly



commit 54f5d19bb9d5ebeeb9167091bb3b3569f4185a3b
Author: Matthias Clasen <mclasen redhat com>
Date:   Thu Apr 2 20:51:31 2020 -0400

    widget: Make the :has-focus property readonly
    
    The only place where this should be set is when making
    a widget the focus-widget of a window. We still keep
    the property around in readonly form, since there are
    a few places where we rely on property notification
    for it.

 gtk/gtkwidget.c             | 6 +-----
 gtk/inspector/css-editor.ui | 1 -
 2 files changed, 1 insertion(+), 6 deletions(-)
---
diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c
index c9d65d0470..75155458e5 100644
--- a/gtk/gtkwidget.c
+++ b/gtk/gtkwidget.c
@@ -989,7 +989,7 @@ gtk_widget_class_init (GtkWidgetClass *klass)
                             P_("Has focus"),
                             P_("Whether the widget has the input focus"),
                             FALSE,
-                            GTK_PARAM_READWRITE|G_PARAM_EXPLICIT_NOTIFY);
+                            GTK_PARAM_READABLE|G_PARAM_EXPLICIT_NOTIFY);
 
   widget_props[PROP_CAN_TARGET] =
       g_param_spec_boolean ("can-target",
@@ -1687,10 +1687,6 @@ gtk_widget_set_property (GObject         *object,
     case PROP_CAN_FOCUS:
       gtk_widget_set_can_focus (widget, g_value_get_boolean (value));
       break;
-    case PROP_HAS_FOCUS:
-      if (g_value_get_boolean (value))
-       gtk_widget_grab_focus (widget);
-      break;
     case PROP_CAN_TARGET:
       gtk_widget_set_can_target (widget, g_value_get_boolean (value));
       break;
diff --git a/gtk/inspector/css-editor.ui b/gtk/inspector/css-editor.ui
index 15984bc28d..50b9bee503 100644
--- a/gtk/inspector/css-editor.ui
+++ b/gtk/inspector/css-editor.ui
@@ -55,7 +55,6 @@
             <property name="buffer">text</property>
             <property name="wrap-mode">word</property>
             <property name="monospace">1</property>
-            <property name="has-focus">1</property>
             <property name="left-margin">6</property>
             <property name="right-margin">6</property>
             <property name="has-tooltip">1</property>


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]