[gnome-terminal] screen: container: Use a GtkOverlay for the info bar



commit ec639cb206633ec2ba7357b9cc9573613c6f34b4
Author: Christian Persch <chpe gnome org>
Date:   Wed Dec 25 22:44:03 2013 +0100

    screen: container: Use a GtkOverlay for the info bar
    
    https://bugzilla.gnome.org/show_bug.cgi?id=712548

 src/terminal-screen-container.c |    9 ++++-----
 src/terminal-screen-container.h |    4 ++--
 src/terminal-screen.c           |   12 ++++++++----
 3 files changed, 14 insertions(+), 11 deletions(-)
---
diff --git a/src/terminal-screen-container.c b/src/terminal-screen-container.c
index 46fb99e..5d11cd0 100644
--- a/src/terminal-screen-container.c
+++ b/src/terminal-screen-container.c
@@ -43,7 +43,7 @@ enum
   PROP_WINDOW_PLACEMENT_SET
 };
 
-G_DEFINE_TYPE (TerminalScreenContainer, terminal_screen_container, GTK_TYPE_BOX)
+G_DEFINE_TYPE (TerminalScreenContainer, terminal_screen_container, GTK_TYPE_OVERLAY)
 
 /* helper functions */
 
@@ -98,8 +98,8 @@ terminal_screen_container_init (TerminalScreenContainer *container)
 
 static GObject *
 terminal_screen_container_constructor (GType type,
-                                guint n_construct_properties,
-                                GObjectConstructParam *construct_params)
+                                       guint n_construct_properties,
+                                       GObjectConstructParam *construct_params)
 {
   GObject *object;
   TerminalScreenContainer *container;
@@ -121,7 +121,7 @@ terminal_screen_container_constructor (GType type,
   gtk_box_pack_start (GTK_BOX (priv->hbox), GTK_WIDGET (priv->screen), TRUE, TRUE, 0);
   gtk_box_pack_start (GTK_BOX (priv->hbox), priv->vscrollbar, FALSE, FALSE, 0);
 
-  gtk_box_pack_end (GTK_BOX (container), priv->hbox, TRUE, TRUE, 0);
+  gtk_container_add (GTK_CONTAINER (container), priv->hbox);
   gtk_widget_show_all (priv->hbox);
 
   _terminal_screen_update_scrollbar (priv->screen);
@@ -247,7 +247,6 @@ GtkWidget *
 terminal_screen_container_new (TerminalScreen *screen)
 {
   return g_object_new (TERMINAL_TYPE_SCREEN_CONTAINER,
-                       "orientation", GTK_ORIENTATION_VERTICAL,
                        "screen", screen,
                        NULL);
 }
diff --git a/src/terminal-screen-container.h b/src/terminal-screen-container.h
index 56e97b6..94a3ea8 100644
--- a/src/terminal-screen-container.h
+++ b/src/terminal-screen-container.h
@@ -36,7 +36,7 @@ typedef struct _TerminalScreenContainerPrivate TerminalScreenContainerPrivate;
 
 struct _TerminalScreenContainer
 {
-  GtkBox parent_instance;
+  GtkOverlay parent_instance;
 
   /*< private >*/
   TerminalScreenContainerPrivate *priv;
@@ -44,7 +44,7 @@ struct _TerminalScreenContainer
 
 struct _TerminalScreenContainerClass
 {
-  GtkBoxClass parent_class;
+  GtkOverlayClass parent_class;
 };
 
 GType terminal_screen_container_get_type (void);
diff --git a/src/terminal-screen.c b/src/terminal-screen.c
index f70dbfa..5ff7e3b 100644
--- a/src/terminal-screen.c
+++ b/src/terminal-screen.c
@@ -1336,8 +1336,10 @@ terminal_screen_do_exec (TerminalScreen *screen,
     g_signal_connect (info_bar, "response",
                       G_CALLBACK (info_bar_response_cb), screen);
 
-    gtk_box_pack_start (GTK_BOX (terminal_screen_container_get_from_screen (screen)),
-                        info_bar, FALSE, FALSE, 0);
+    gtk_widget_set_halign (info_bar, GTK_ALIGN_FILL);
+    gtk_widget_set_valign (info_bar, GTK_ALIGN_START);
+    gtk_overlay_add_overlay (GTK_OVERLAY (terminal_screen_container_get_from_screen (screen)),
+                             info_bar);
     gtk_info_bar_set_default_response (GTK_INFO_BAR (info_bar), GTK_RESPONSE_CANCEL);
     gtk_widget_show (info_bar);
 
@@ -1688,8 +1690,10 @@ terminal_screen_child_exited (VteTerminal *terminal)
       g_signal_connect (info_bar, "response",
                         G_CALLBACK (info_bar_response_cb), screen);
 
-      gtk_box_pack_start (GTK_BOX (terminal_screen_container_get_from_screen (screen)),
-                          info_bar, FALSE, FALSE, 0);
+      gtk_widget_set_halign (info_bar, GTK_ALIGN_FILL);
+      gtk_widget_set_valign (info_bar, GTK_ALIGN_START);
+      gtk_overlay_add_overlay (GTK_OVERLAY (terminal_screen_container_get_from_screen (screen)),
+                               info_bar);
       gtk_info_bar_set_default_response (GTK_INFO_BAR (info_bar), RESPONSE_RELAUNCH);
       gtk_widget_show (info_bar);
       break;


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