zoom in/out in timeline

This commit is contained in:
Cedric Roux
2016-05-17 16:18:29 +02:00
parent 7d1665fe42
commit 2e7ab60d70
3 changed files with 44 additions and 1 deletions
+2
View File
@@ -81,6 +81,8 @@ int new_color(gui *gui, char *color);
* - click { int: button } (if enabled)
* - timeline
* - resize { int: width }
* - scrollup { void *: NULL }
* - scrolldown { void *: NULL }
*/
/* same type as in gui_defs.h */
+16
View File
@@ -54,6 +54,21 @@ static void allocate(gui *_gui, widget *_this,
gui_notify(_gui, "resize", _this, &width);
}
static void button(gui *_g, widget *_this, int x, int y, int button, int up)
{
struct gui *g = _g;
struct timeline_widget *this = _this;
LOGD("BUTTON timeline %p xy %d %d button %d up %d\n", _this, x, y, button, up);
/* scroll up */
if (button == 4 && up == 0) {
gui_notify(g, "scrollup", _this, NULL);
}
/* scroll down */
if (button == 5 && up == 0) {
gui_notify(g, "scrolldown", _this, NULL);
}
}
/*************************************************************************/
/* creation function */
/*************************************************************************/
@@ -87,6 +102,7 @@ widget *new_timeline(gui *_gui, int width, int number_of_sublines,
w->common.paint = paint;
w->common.hints = hints;
w->common.allocate = allocate;
w->common.button = button;
gunlock(g);