aboutsummaryrefslogtreecommitdiff
path: root/apps/view
diff options
context:
space:
mode:
authorMarvin Borner2021-06-28 16:37:30 +0200
committerMarvin Borner2021-06-28 16:37:30 +0200
commit5a4eea5c6b39d221fe4828cb279c68c60bad8fae (patch)
tree64b91481a4257980785b3a57684b5580e5d81f80 /apps/view
parent461e6fcb6a0abbf594ea08d6828b841ea6dc964e (diff)
Implemented basic layout rendering
Diffstat (limited to 'apps/view')
-rw-r--r--apps/view/main.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/apps/view/main.c b/apps/view/main.c
index fc7e3bc..f3ccb3d 100644
--- a/apps/view/main.c
+++ b/apps/view/main.c
@@ -14,7 +14,7 @@ static void mousemove(struct gui_event_mouse *event)
size = vec2_mul(size, event->scroll < 0 ? SCALING_FACTOR + 1 : 1 - SCALING_FACTOR);
gui_fill(event->win, event->widget, GUI_LAYER_FG, COLOR_WHITE);
gui_draw_image(event->win, event->widget, GUI_LAYER_FG, vec2(0, 0), size, path);
- gui_redraw_widget(event->win, event->widget);
+ gui_widget_redraw(event->win, event->widget);
}
}
@@ -25,12 +25,13 @@ int main(int argc, char *argv[])
path = "/res/test.png";
- u32 win = gui_custom_window(APPNAME, vec2(0, 0), size);
- u32 canvas = gui_widget(win, gui_main_widget(win), vec2(0, 0), size);
+ u32 win = gui_window_custom(APPNAME, vec2(0, 0), size);
+ gui_widget_margin(win, gui_widget_main(win), vec2(0, 0));
+ u32 canvas = gui_widget(win, gui_widget_main(win), size);
gui_fill(win, canvas, GUI_LAYER_BG, COLOR_WHITE);
gui_widget_listen(win, canvas, GUI_LISTEN_MOUSEMOVE, (u32)mousemove);
- gui_redraw_window(win);
+ gui_window_redraw(win);
gui_loop();
return 0;