aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-gtk/interface-gtk.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2016-02-03 02:43:09 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2016-02-03 02:43:09 +0100
commit45413d04eacfd9dc23904cb4893918309d3a6a36 (patch)
tree3461b14219103dbcb836c2f6a25949a94afae88c /src/interface-gtk/interface-gtk.cpp
parente768487fe3ef9ec8f94cea11ad6587c49c32422a (diff)
downloadsciteco-45413d04eacfd9dc23904cb4893918309d3a6a36.tar.gz
Gtk UI: popup will now overlay both the Scintilla view and message widgets
* this is what the Curses UI does for a long time now * the popup does NOT cover the info (header) line, as this would be inconsistent if the header is actually the window's title bar. This should perhaps be adapted in the Curses UI as well, so both UIs look more consistently. * removed unused InterfaceGtk attribute
Diffstat (limited to 'src/interface-gtk/interface-gtk.cpp')
-rw-r--r--src/interface-gtk/interface-gtk.cpp26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/interface-gtk/interface-gtk.cpp b/src/interface-gtk/interface-gtk.cpp
index 7938131..a2d2a1b 100644
--- a/src/interface-gtk/interface-gtk.cpp
+++ b/src/interface-gtk/interface-gtk.cpp
@@ -169,7 +169,9 @@ void
InterfaceGtk::main_impl(int &argc, char **&argv)
{
static const Cmdline empty_cmdline;
- GtkWidget *overlay_widget;
+
+ GtkWidget *vbox;
+ GtkWidget *overlay_widget, *overlay_vbox;
GtkWidget *message_bar_content;
/*
@@ -193,7 +195,7 @@ InterfaceGtk::main_impl(int &argc, char **&argv)
g_signal_connect(G_OBJECT(window), "delete-event",
G_CALLBACK(window_delete_cb), event_queue);
- vbox = gtk_vbox_new(FALSE, 0);
+ vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
info_current = g_strdup("");
@@ -220,17 +222,25 @@ InterfaceGtk::main_impl(int &argc, char **&argv)
}
/*
+ * Overlay widget will allow overlaying the Scintilla view
+ * and message widgets with the info popup.
+ * Therefore overlay_vbox (containing the view and popup)
+ * will be the main child of the overlay.
+ */
+ overlay_widget = gtk_overlay_new();
+ overlay_vbox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+
+ /*
* The event box is the parent of all Scintilla views
* that should be displayed.
* This is handy when adding or removing current views,
* enabling and disabling GDK updates and in order to filter
* mouse and keyboard events going to Scintilla.
*/
- overlay_widget = gtk_overlay_new();
event_box_widget = gtk_event_box_new();
gtk_event_box_set_above_child(GTK_EVENT_BOX(event_box_widget), TRUE);
- gtk_container_add(GTK_CONTAINER(overlay_widget), event_box_widget);
- gtk_box_pack_start(GTK_BOX(vbox), overlay_widget, TRUE, TRUE, 0);
+ gtk_box_pack_start(GTK_BOX(overlay_vbox), event_box_widget,
+ TRUE, TRUE, 0);
message_bar_widget = gtk_info_bar_new();
gtk_widget_set_name(message_bar_widget, "sciteco-message-bar");
@@ -238,7 +248,11 @@ InterfaceGtk::main_impl(int &argc, char **&argv)
message_widget = gtk_label_new("");
gtk_misc_set_alignment(GTK_MISC(message_widget), 0., 0.);
gtk_container_add(GTK_CONTAINER(message_bar_content), message_widget);
- gtk_box_pack_start(GTK_BOX(vbox), message_bar_widget, FALSE, FALSE, 0);
+ gtk_box_pack_start(GTK_BOX(overlay_vbox), message_bar_widget,
+ FALSE, FALSE, 0);
+
+ gtk_container_add(GTK_CONTAINER(overlay_widget), overlay_vbox);
+ gtk_box_pack_start(GTK_BOX(vbox), overlay_widget, TRUE, TRUE, 0);
cmdline_widget = gtk_entry_new();
gtk_widget_set_name(cmdline_widget, "sciteco-cmdline");