[gtk] text: Remove the ::has-frame property



commit 82bde1e10a849c5843aad54a2b983dae9cb9a99f
Author: Matthias Clasen <mclasen redhat com>
Date:   Wed Feb 20 10:34:42 2019 -0500

    text: Remove the ::has-frame property
    
    This is purely GtkEntry functionality and should
    remain there.

 docs/reference/gtk/gtk4-sections.txt |  2 --
 gtk/gtktext.c                        | 63 ++----------------------------------
 gtk/gtktext.h                        |  6 ----
 3 files changed, 2 insertions(+), 69 deletions(-)
---
diff --git a/docs/reference/gtk/gtk4-sections.txt b/docs/reference/gtk/gtk4-sections.txt
index 6c084c4063..b5caee5b72 100644
--- a/docs/reference/gtk/gtk4-sections.txt
+++ b/docs/reference/gtk/gtk4-sections.txt
@@ -891,8 +891,6 @@ gtk_text_get_visibility
 gtk_text_set_invisible_char
 gtk_text_get_invisible_char
 gtk_text_unset_invisible_char
-gtk_text_set_has_frame
-gtk_text_get_has_frame
 gtk_text_set_overwrite_mode
 gtk_text_get_overwrite_mode
 gtk_text_set_max_length
diff --git a/gtk/gtktext.c b/gtk/gtktext.c
index 0d54525daa..62f8f289cb 100644
--- a/gtk/gtktext.c
+++ b/gtk/gtktext.c
@@ -101,7 +101,7 @@
  * # CSS nodes
  *
  * |[<!-- language="plain" -->
- * text[.read-only][.flat][.warning][.error]
+ * text[.read-only]
  * ├── placeholder
  * ├── undershoot.left
  * ├── undershoot.right
@@ -111,8 +111,7 @@
  * ]|
  *
  * GtkText has a main node with the name text. Depending on the properties
- * of the widget, the style classes .read-only and .flat may appear. The style
- * classes .warning and .error may also be used with entries.
+ * of the widget, the .read-only style class may appear.
  *
  * When the entry has a selection, it adds a subnode with the name selection.
  *
@@ -1457,10 +1456,6 @@ gtk_text_set_property (GObject      *object,
       gtk_text_set_visibility (self, g_value_get_boolean (value));
       break;
 
-    case PROP_HAS_FRAME:
-      gtk_text_set_has_frame (self, g_value_get_boolean (value));
-      break;
-
     case PROP_INVISIBLE_CHAR:
       gtk_text_set_invisible_char (self, g_value_get_uint (value));
       break;
@@ -1587,10 +1582,6 @@ gtk_text_get_property (GObject    *object,
       g_value_set_boolean (value, priv->visible);
       break;
 
-    case PROP_HAS_FRAME:
-      g_value_set_boolean (value, gtk_text_get_has_frame (self));
-      break;
-
     case PROP_INVISIBLE_CHAR:
       g_value_set_uint (value, priv->invisible_char);
       break;
@@ -1744,7 +1735,6 @@ gtk_text_init (GtkText *self)
     }
 
   set_text_cursor (GTK_WIDGET (self));
-  gtk_text_set_has_frame (self, FALSE);
 }
 
 static void
@@ -5539,55 +5529,6 @@ gtk_text_set_max_width_chars (GtkText *self,
     }
 }
 
-/**
- * gtk_text_set_has_frame:
- * @self: a #GtkText
- * @has_frame: new value
- * 
- * Sets whether the self has a beveled frame around it.
- **/
-void
-gtk_text_set_has_frame (GtkText  *self,
-                        gboolean  has_frame)
-{
-  GtkStyleContext *context;
-
-  g_return_if_fail (GTK_IS_TEXT (self));
-
-  has_frame = (has_frame != FALSE);
-
-  if (has_frame == gtk_text_get_has_frame (self))
-    return;
-
-  context = gtk_widget_get_style_context (GTK_WIDGET (self));
-  if (has_frame)
-    gtk_style_context_remove_class (context, GTK_STYLE_CLASS_FLAT);
-  else
-    gtk_style_context_add_class (context, GTK_STYLE_CLASS_FLAT);
-
-  g_object_notify_by_pspec (G_OBJECT (self), text_props[PROP_HAS_FRAME]);
-}
-
-/**
- * gtk_text_get_has_frame:
- * @self: a #GtkText
- * 
- * Gets the value set by gtk_text_set_has_frame().
- * 
- * Returns: whether the self has a beveled frame
- **/
-gboolean
-gtk_text_get_has_frame (GtkText *self)
-{
-  GtkStyleContext *context;
-
-  g_return_val_if_fail (GTK_IS_TEXT (self), FALSE);
-
-  context = gtk_widget_get_style_context (GTK_WIDGET (self));
-
-  return !gtk_style_context_has_class (context, GTK_STYLE_CLASS_FLAT);
-}
-
 PangoLayout *
 gtk_text_get_layout (GtkText *self)
 {
diff --git a/gtk/gtktext.h b/gtk/gtktext.h
index c0a1e58f8e..eb7615c909 100644
--- a/gtk/gtktext.h
+++ b/gtk/gtktext.h
@@ -158,12 +158,6 @@ gunichar        gtk_text_get_invisible_char             (GtkText         *self);
 GDK_AVAILABLE_IN_ALL
 void            gtk_text_unset_invisible_char           (GtkText         *self);
 
-GDK_AVAILABLE_IN_ALL
-void            gtk_text_set_has_frame                  (GtkText         *self,
-                                                         gboolean         has_frame);
-GDK_AVAILABLE_IN_ALL
-gboolean        gtk_text_get_has_frame                  (GtkText         *self);
-
 GDK_AVAILABLE_IN_ALL
 void            gtk_text_set_overwrite_mode             (GtkText         *self,
                                                          gboolean         overwrite);


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