Mercurial > molko
diff examples/example-ui/example-ui.c @ 493:fce3b3c4b496
ui: label -> mlk_label
author | David Demelier <markand@malikania.fr> |
---|---|
date | Tue, 28 Feb 2023 13:26:53 +0100 |
parents | 734b598534c4 |
children | 2af25db99273 |
line wrap: on
line diff
--- a/examples/example-ui/example-ui.c Tue Feb 28 13:18:23 2023 +0100 +++ b/examples/example-ui/example-ui.c Tue Feb 28 13:26:53 2023 +0100 @@ -72,12 +72,12 @@ } panel; struct { - struct label label; + struct mlk_label label; } header; struct { struct mlk_checkbox cb; - struct label label; + struct mlk_label label; } autosave; struct { @@ -97,7 +97,7 @@ .text = "Preferences", .x = FRAME_ORIGIN_X, .y = FRAME_ORIGIN_Y, - .flags = LABEL_FLAGS_SHADOW, + .flags = MLK_LABEL_FLAGS_SHADOW, } }, .autosave = { @@ -107,7 +107,7 @@ }, .label = { .text = "Auto save game", - .flags = LABEL_FLAGS_SHADOW, + .flags = MLK_LABEL_FLAGS_SHADOW, } }, .quit = { @@ -133,11 +133,11 @@ resize_header(void) { struct mlk_frame *f = &ui.panel.frame; - struct label *l = &ui.header.label; + struct mlk_label *l = &ui.header.label; unsigned int w, h; /* Header. */ - label_query(l, &w, &h); + mlk_label_query(l, &w, &h); mlk_align(MLK_ALIGN_LEFT, &l->x, &l->y, w, h, f->x, f->y, f->w, HEADER_HEIGHT); l->x += theme_default()->padding; @@ -149,7 +149,7 @@ unsigned int padding = theme_default()->padding; struct mlk_frame *f = &ui.panel.frame; struct mlk_checkbox *c = &ui.autosave.cb; - struct label *l = &ui.autosave.label; + struct mlk_label *l = &ui.autosave.label; c->x = f->x + padding; c->y = f->y + HEADER_HEIGHT + padding; @@ -244,9 +244,9 @@ mlk_painter_set_color(0xffffffff); mlk_painter_clear(); mlk_frame_draw(&ui.panel.frame); - label_draw(&ui.header.label); + mlk_label_draw(&ui.header.label); mlk_checkbox_draw(&ui.autosave.cb); - label_draw(&ui.autosave.label); + mlk_label_draw(&ui.autosave.label); mlk_button_draw(&ui.quit.button); mlk_painter_present(); }