aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/interface-gtk/interface-gtk.cpp
diff options
context:
space:
mode:
authorRobin Haberkorn <robin.haberkorn@googlemail.com>2016-02-02 03:54:53 +0100
committerRobin Haberkorn <robin.haberkorn@googlemail.com>2016-02-02 04:05:46 +0100
commitac3d8ca27239d586d5cd7fdbfbd3ec55713ae1aa (patch)
tree2323b9a8803ac103b21183d943ae56774c56679a /src/interface-gtk/interface-gtk.cpp
parentc6ffe2eab904ce3bb84bf0e067d317f9dad18014 (diff)
downloadsciteco-ac3d8ca27239d586d5cd7fdbfbd3ec55713ae1aa.tar.gz
added gtk_info_popup_get_position_in_overlay() and workaround size allocation issue
* this is a callback for GtkOverlay's "get-child-position" signal that allocates a size to the popup. * cleaner than overwriting the size_allocate method and does not assume apriori that the popup is part of an overlay. * the popup was always allocated a few pixels too little height, resulting the GtkViewbox always scrolling. Actually it requests a few pixels too little. We now workaround that by adding a constant value to its natural height when allocating a position in the overlay. This is of course a non-portable hack.
Diffstat (limited to 'src/interface-gtk/interface-gtk.cpp')
-rw-r--r--src/interface-gtk/interface-gtk.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/interface-gtk/interface-gtk.cpp b/src/interface-gtk/interface-gtk.cpp
index b204caa..d718deb 100644
--- a/src/interface-gtk/interface-gtk.cpp
+++ b/src/interface-gtk/interface-gtk.cpp
@@ -197,9 +197,9 @@ InterfaceGtk::main_impl(int &argc, char **&argv)
* filling the entire width.
*/
popup_widget = gtk_info_popup_new();
- gtk_widget_set_halign(popup_widget, GTK_ALIGN_FILL);
- gtk_widget_set_valign(popup_widget, GTK_ALIGN_END);
gtk_overlay_add_overlay(GTK_OVERLAY(overlay_widget), popup_widget);
+ g_signal_connect(overlay_widget, "get-child-position",
+ G_CALLBACK(gtk_info_popup_get_position_in_overlay), NULL);
gtk_widget_grab_focus(cmdline_widget);