[gtksourceview/wip/chergert/vim] stop using overlay
- From: Christian Hergert <chergert src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gtksourceview/wip/chergert/vim] stop using overlay
- Date: Mon, 8 Nov 2021 22:26:33 +0000 (UTC)
commit a0678f3eefd6a5ba942ded1e95760be86a16135d
Author: Christian Hergert <chergert redhat com>
Date: Mon Nov 8 14:26:28 2021 -0800
stop using overlay
just a bit annoying due to label changes
tests/test-vim.c | 30 +++++++++++++++++++-----------
1 file changed, 19 insertions(+), 11 deletions(-)
---
diff --git a/tests/test-vim.c b/tests/test-vim.c
index 2c15ea67..7d873e3d 100644
--- a/tests/test-vim.c
+++ b/tests/test-vim.c
@@ -88,10 +88,7 @@ observe_key (GtkSourceVimIMContext *self,
GtkLabel *label = data;
if (reset_observer)
- {
g_string_truncate (sequence, 0);
- g_string_append (sequence, "Sequence: ");
- }
g_string_append (sequence, str);
gtk_label_set_label (label, sequence->str);
@@ -112,7 +109,7 @@ main (int argc,
GtkLabel *command_bar;
GtkLabel *command;
GtkLabel *observe;
- GtkOverlay *overlay;
+ GtkBox *vbox;
GtkBox *box;
GFile *file;
@@ -128,8 +125,9 @@ main (int argc,
"default-width", 800,
"default-height", 600,
NULL);
- overlay = g_object_new (GTK_TYPE_OVERLAY, NULL);
- scroller = g_object_new (GTK_TYPE_SCROLLED_WINDOW, NULL);
+ scroller = g_object_new (GTK_TYPE_SCROLLED_WINDOW,
+ "vexpand", TRUE,
+ NULL);
buffer = gtk_source_buffer_new (NULL);
gtk_source_buffer_set_language (buffer, gtk_source_language_manager_get_language (languages, "c"));
gtk_source_buffer_set_style_scheme (buffer, gtk_source_style_scheme_manager_get_scheme (schemes,
"Adwaita"));
@@ -141,7 +139,15 @@ main (int argc,
"top-margin", 6,
"left-margin", 6,
NULL);
+ vbox = g_object_new (GTK_TYPE_BOX,
+ "orientation", GTK_ORIENTATION_VERTICAL,
+ "vexpand", TRUE,
+ NULL);
box = g_object_new (GTK_TYPE_BOX,
+ "margin-start", 12,
+ "margin-top", 6,
+ "margin-bottom", 6,
+ "margin-end", 12,
"orientation", GTK_ORIENTATION_HORIZONTAL,
"hexpand", TRUE,
NULL);
@@ -157,20 +163,22 @@ main (int argc,
"margin-top", 6,
"margin-bottom", 6,
"margin-end", 12,
+ "width-chars", 8,
NULL);
observe = g_object_new (GTK_TYPE_LABEL,
- "label", "Sequence: ",
"margin-start", 24,
+ "width-chars", 12,
+ "wrap", TRUE,
+ "xalign", 1.0f,
NULL);
- gtk_window_set_child (window, GTK_WIDGET (overlay));
+ gtk_window_set_child (window, GTK_WIDGET (vbox));
+ gtk_box_append (vbox, GTK_WIDGET (scroller));
+ gtk_box_append (vbox, GTK_WIDGET (box));
gtk_scrolled_window_set_child (scroller, GTK_WIDGET (view));
- gtk_text_view_set_gutter (GTK_TEXT_VIEW (view), GTK_TEXT_WINDOW_BOTTOM, GTK_WIDGET (box));
gtk_box_append (box, GTK_WIDGET (command_bar));
- gtk_box_append (box, g_object_new (GTK_TYPE_LABEL, "label", "Command:", NULL));
gtk_box_append (box, GTK_WIDGET (command));
gtk_box_append (box, GTK_WIDGET (observe));
- gtk_overlay_set_child (overlay, GTK_WIDGET (scroller));
im_context = gtk_source_vim_im_context_new ();
g_object_bind_property (im_context, "command-bar-text", command_bar, "label", G_BINDING_SYNC_CREATE);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]