[gtksourceview/wip/chergert/gsv-gtk4: 90/125] completion: remove GtkSourceCompletionContainer



commit f86397d8235cbd7e0d29a656492a7f807f74f692
Author: Christian Hergert <chergert redhat com>
Date:   Wed Jan 15 14:16:44 2020 -0800

    completion: remove GtkSourceCompletionContainer
    
    This is unfortunate, but we cannot subclass GtkScrolledWindow anymore. We
    might bring this back, but more likely is that we'll reintroduce the
    sizing feature as part of a modernized completion API using newer GLib
    features such as GListModel.
    
    The fallout from this is tight control over the completion window height
    is temporarily lost until the new API lands.

 gtksourceview/gtksourcecompletion.c                |   7 -
 gtksourceview/gtksourcecompletion.ui               |   6 +-
 .../gtksourcecompletioncontainer-private.h         |  37 ----
 gtksourceview/gtksourcecompletioncontainer.c       | 222 ---------------------
 4 files changed, 5 insertions(+), 267 deletions(-)
---
diff --git a/gtksourceview/gtksourcecompletion.c b/gtksourceview/gtksourcecompletion.c
index af95aae6..8ba75be8 100644
--- a/gtksourceview/gtksourcecompletion.c
+++ b/gtksourceview/gtksourcecompletion.c
@@ -108,7 +108,6 @@
 #include "gtksourcecompletioninfo-private.h"
 #include "gtksourcecompletionproposal.h"
 #include "gtksourcecompletionprovider.h"
-#include "gtksourcecompletioncontainer-private.h"
 #include "gtksourcecompletioncontext-private.h"
 #include "gtksourcebuffer.h"
 #include "gtksource-marshal.h"
@@ -2241,14 +2240,9 @@ gtk_source_completion_constructed (GObject *object)
        GtkSourceCompletion *completion = GTK_SOURCE_COMPLETION (object);
        GError *error = NULL;
        GtkBuilder *builder = gtk_builder_new ();
-       GtkSourceCompletionContainer *container = _gtk_source_completion_container_new ();
-       g_object_ref_sink (container);
 
        gtk_builder_set_translation_domain (builder, GETTEXT_PACKAGE);
 
-       /* GtkSourceCompletionContainer is a private type. */
-       gtk_builder_expose_object (builder, "completion_container", G_OBJECT (container));
-
        gtk_builder_add_from_resource (builder,
                                       "/org/gnome/gtksourceview/ui/gtksourcecompletion.ui",
                                       &error);
@@ -2264,7 +2258,6 @@ gtk_source_completion_constructed (GObject *object)
        connect_style_context (completion);
 
        g_object_unref (builder);
-       g_object_unref (container);
 
        G_OBJECT_CLASS (gtk_source_completion_parent_class)->constructed (object);
 }
diff --git a/gtksourceview/gtksourcecompletion.ui b/gtksourceview/gtksourcecompletion.ui
index 39763974..7de346ce 100644
--- a/gtksourceview/gtksourcecompletion.ui
+++ b/gtksourceview/gtksourcecompletion.ui
@@ -36,8 +36,12 @@ along with this library; if not, see <http://www.gnu.org/licenses/>.
         <property name="visible">True</property>
         <property name="orientation">vertical</property>
         <child>
-          <object class="GtkSourceCompletionContainer" id="completion_container">
+          <object class="GtkScrolledWindow" id="completion_container">
             <property name="visible">True</property>
+            <!-- TODO: this will need more work with a gtk4 port -->
+            <property name="propagate-natural-height">True</property>
+            <property name="propagate-natural-width">True</property>
+            <property name="max-content-height">250</property>
             <property name="can_focus">False</property>
             <child>
               <object class="GtkTreeView" id="tree_view_proposals">


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