summaryrefslogtreecommitdiffstats
path: root/gtk-gui.c
diff options
context:
space:
mode:
authorGravatar Mikko Rasa <tdb@tdb.fi>2012-07-29 12:13:36 +0300
committerGravatar Mikko Rasa <tdb@tdb.fi>2012-07-31 21:11:58 +0300
commit618a20ba5f2a9adc0e5a35117535f8eaa9fd34a4 (patch)
tree62eeef8b3c1b0da0e9bdaca307fa717d6f9d5dfd /gtk-gui.c
parent7fe652ab5738717ba443ae9de2b8f437103fd71b (diff)
downloadsubsurface-618a20ba5f2a9adc0e5a35117535f8eaa9fd34a4.tar.gz
Divide the panes evenly in view_three
There was a note by Linus that he doesn't know how to get the size, so I'm fixing that. Signed-off-by: Mikko Rasa <tdb@tdb.fi>
Diffstat (limited to 'gtk-gui.c')
-rw-r--r--gtk-gui.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk-gui.c b/gtk-gui.c
index 45aa21263..bdf2952f0 100644
--- a/gtk-gui.c
+++ b/gtk-gui.c
@@ -609,11 +609,13 @@ static void view_info(GtkWidget *w, gpointer data)
gtk_paned_set_position(GTK_PANED(hpane), 65535);
}
-/* Ooh. I don't know how to get the half-way size. So I'm just using random numbers */
static void view_three(GtkWidget *w, gpointer data)
{
- gtk_paned_set_position(GTK_PANED(hpane), 400);
- gtk_paned_set_position(GTK_PANED(vpane), 200);
+ GtkAllocation alloc;
+ gtk_widget_get_allocation(hpane, &alloc);
+ gtk_paned_set_position(GTK_PANED(hpane), alloc.width/2);
+ gtk_widget_get_allocation(vpane, &alloc);
+ gtk_paned_set_position(GTK_PANED(vpane), alloc.height/2);
}
static GtkActionEntry menu_items[] = {