summaryrefslogtreecommitdiff
path: root/gui/gui.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-24 02:01:30 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-24 02:01:30 -0300
commitef5150170a0a26f79b2ddfed3d0815aaf48781ac (patch)
tree1f1a342e5e78f76942ce26122625194f337422b9 /gui/gui.c
parent6e07f89c6fd2cf86e25fa245c2688d8c2e20be95 (diff)
downloadeeshow-ef5150170a0a26f79b2ddfed3d0815aaf48781ac.tar.gz
eeshow-ef5150170a0a26f79b2ddfed3d0815aaf48781ac.tar.bz2
eeshow-ef5150170a0a26f79b2ddfed3d0815aaf48781ac.zip
gui/: move resizing back to gui.c; support resizing index
Diffstat (limited to 'gui/gui.c')
-rw-r--r--gui/gui.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/gui/gui.c b/gui/gui.c
index 0a0d2b5..2b3e001 100644
--- a/gui/gui.c
+++ b/gui/gui.c
@@ -424,6 +424,20 @@ static void get_history(struct gui_ctx *ctx, const char *sch_name, int limit)
}
+/* ----- Resizing ---------------------------------------------------------- */
+
+
+static void size_allocate_event(GtkWidget *widget, GdkRectangle *allocation,
+ gpointer data)
+{
+ struct gui_ctx *ctx = data;
+
+ zoom_to_extents(ctx);
+ if (ctx->mode == showing_index)
+ index_resize(ctx);
+}
+
+
/* ----- Initialization ---------------------------------------------------- */
@@ -475,6 +489,8 @@ int gui(const struct file_names *fn, bool recurse, int limit)
if (!ctx.new_hist)
fatal("no valid sheets\n");
+ g_signal_connect(G_OBJECT(ctx.da), "size_allocate",
+ G_CALLBACK(size_allocate_event), &ctx);
g_signal_connect(window, "destroy",
G_CALLBACK(gtk_main_quit), NULL);