summaryrefslogtreecommitdiff
path: root/gui/render.c
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-24 00:00:42 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-24 01:55:49 -0300
commit6e07f89c6fd2cf86e25fa245c2688d8c2e20be95 (patch)
treef7f89de51a6e9bdbfa1ae075f22681093fa71b22 /gui/render.c
parent03a241809ee91fb0addd685a71d3c98c69e4c868 (diff)
downloadeeshow-6e07f89c6fd2cf86e25fa245c2688d8c2e20be95.tar.gz
eeshow-6e07f89c6fd2cf86e25fa245c2688d8c2e20be95.tar.bz2
eeshow-6e07f89c6fd2cf86e25fa245c2688d8c2e20be95.zip
gui/: experimental sheet index (WIP)
We also change the way the sheet overlays work: now clicking on the subsheet (which, in the case of the bottom-most sheet did nothing) goes back to the parent and clicking on the root opens the index.
Diffstat (limited to 'gui/render.c')
-rw-r--r--gui/render.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/gui/render.c b/gui/render.c
index 050f428..9cf71e9 100644
--- a/gui/render.c
+++ b/gui/render.c
@@ -18,6 +18,7 @@
#include <gtk/gtk.h>
#include "misc/util.h"
+#include "misc/diag.h"
#include "gfx/style.h"
#include "gfx/cro.h"
#include "gfx/gfx.h"
@@ -169,7 +170,7 @@ static void hack(const struct gui_ctx *ctx, cairo_t *cr,
static gboolean on_draw_event(GtkWidget *widget, cairo_t *cr,
gpointer user_data)
{
- const struct gui_ctx *ctx = user_data;
+ struct gui_ctx *ctx = user_data;
const struct gui_sheet *sheet = ctx->curr_sheet;
GtkAllocation alloc;
float f = ctx->scale;
@@ -224,7 +225,8 @@ static gboolean on_draw_event(GtkWidget *widget, cairo_t *cr,
SHEET_OVERLAYS_X, SHEET_OVERLAYS_Y);
overlay_draw_all_d(ctx->hist_overlays, cr,
VCS_OVERLAYS_X,
- VCS_OVERLAYS_Y + (ctx->showing_history ? ctx->hist_y_offset : 0),
+ VCS_OVERLAYS_Y +
+ (ctx->mode == showing_history ? ctx->hist_y_offset : 0),
0, 1);
overlay_draw_all_d(ctx->pop_underlays, cr, ctx->pop_x, ctx->pop_y,
ctx->pop_dx, ctx->pop_dy);
@@ -233,6 +235,9 @@ static gboolean on_draw_event(GtkWidget *widget, cairo_t *cr,
ctx->pop_y + ctx->pop_dy * GLABEL_STACK_PADDING,
ctx->pop_dx, ctx->pop_dy);
+ if (ctx->mode == showing_index)
+ index_draw_event(ctx, cr);
+
return FALSE;
}