summaryrefslogtreecommitdiff
path: root/gui
diff options
context:
space:
mode:
authorWerner Almesberger <werner@almesberger.net>2016-08-29 01:22:33 -0300
committerWerner Almesberger <werner@almesberger.net>2016-08-29 01:22:33 -0300
commit14c368e003feb2dfd83429bee459e6499bb0be8d (patch)
tree348c6500dfdd4e714ab0a93da576b2db0c0e2787 /gui
parent3d994873533bfa4228b9783908e8027f81984701 (diff)
downloadeeshow-14c368e003feb2dfd83429bee459e6499bb0be8d.tar.gz
eeshow-14c368e003feb2dfd83429bee459e6499bb0be8d.tar.bz2
eeshow-14c368e003feb2dfd83429bee459e6499bb0be8d.zip
gui/render.c (on_draw_event): move history drawing to history_draw_event
Diffstat (limited to 'gui')
-rw-r--r--gui/common.h4
-rw-r--r--gui/history.c13
-rw-r--r--gui/render.c22
3 files changed, 30 insertions, 9 deletions
diff --git a/gui/common.h b/gui/common.h
index cce607b..9a6f8ac 100644
--- a/gui/common.h
+++ b/gui/common.h
@@ -134,6 +134,9 @@ struct gui {
};
+#define VCS_OVERLAYS_X 5
+#define VCS_OVERLAYS_Y 5
+
#define GLABEL_STACK_PADDING 5
@@ -167,6 +170,7 @@ void sheet_setup(struct gui *gui);
/* history.c */
+void history_draw_event(const struct gui *gui, cairo_t *cr);
void show_history(struct gui *gui, enum selecting sel);
/* index.c */
diff --git a/gui/history.c b/gui/history.c
index f86f742..52c8550 100644
--- a/gui/history.c
+++ b/gui/history.c
@@ -28,6 +28,19 @@
#include "gui/common.h"
+/* ----- Drawing ----------------------------------------------------------- */
+
+
+void history_draw_event(const struct gui *gui, cairo_t *cr)
+{
+ overlay_draw_all_d(gui->hist_overlays, cr,
+ VCS_OVERLAYS_X,
+ VCS_OVERLAYS_Y +
+ (gui->mode == showing_history ? gui->hist_y_offset : 0),
+ 0, 1);
+}
+
+
/* ----- Overlay interaction ----------------------------------------------- */
diff --git a/gui/render.c b/gui/render.c
index c2a9622..48003f5 100644
--- a/gui/render.c
+++ b/gui/render.c
@@ -33,9 +33,6 @@
#include "gui/common.h"
-#define VCS_OVERLAYS_X 5
-#define VCS_OVERLAYS_Y 5
-
#define SHEET_OVERLAYS_X -10
#define SHEET_OVERLAYS_Y 10
@@ -227,11 +224,9 @@ static gboolean on_draw_event(GtkWidget *widget, cairo_t *cr,
overlay_draw_all(gui->sheet_overlays, cr,
SHEET_OVERLAYS_X, SHEET_OVERLAYS_Y);
- overlay_draw_all_d(gui->hist_overlays, cr,
- VCS_OVERLAYS_X,
- VCS_OVERLAYS_Y +
- (gui->mode == showing_history ? gui->hist_y_offset : 0),
- 0, 1);
+ if (gui->mode != showing_history)
+ overlay_draw_all_d(gui->hist_overlays, cr,
+ VCS_OVERLAYS_X, VCS_OVERLAYS_Y, 0, 1);
overlay_draw_all_d(gui->pop_underlays, cr, gui->pop_x, gui->pop_y,
gui->pop_dx, gui->pop_dy);
overlay_draw_all_d(gui->pop_overlays, cr,
@@ -239,8 +234,17 @@ static gboolean on_draw_event(GtkWidget *widget, cairo_t *cr,
gui->pop_y + gui->pop_dy * GLABEL_STACK_PADDING,
gui->pop_dx, gui->pop_dy);
- if (gui->mode == showing_index)
+ switch (gui->mode) {
+ case showing_history:
+ history_draw_event(gui, cr);
+ break;
+ case showing_index:
index_draw_event(gui, cr);
+ break;
+ default:
+ break;
+ }
+ if (gui->mode == showing_index)
timer_show(cr);