zoom in/out in timeline
This commit is contained in:
@@ -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 */
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user