comparison examples/example-message/example-message.c @ 504:52a305833381

ui: rework styles
author David Demelier <markand@malikania.fr>
date Wed, 01 Mar 2023 14:07:10 +0100
parents 41267f6e344d
children 7f7602bae0bd
comparison
equal deleted inserted replaced
503:a55d0a29f466 504:52a305833381
97 mlk_game_init(states, MLK_UTIL_SIZE(states)); 97 mlk_game_init(states, MLK_UTIL_SIZE(states));
98 mlk_game_push(&state); 98 mlk_game_push(&state);
99 mlk_game_loop(); 99 mlk_game_loop();
100 } 100 }
101 101
102 #if 0
102 static void 103 static void
103 my_draw_frame(const struct mlk_theme *th, const struct mlk_frame *f) 104 my_draw_frame(const struct mlk_theme *th, const struct mlk_frame *f)
104 { 105 {
105 (void)th; 106 (void)th;
106 107
107 mlk_painter_set_color(0xff0000ff); 108 mlk_painter_set_color(0xff0000ff);
108 mlk_painter_draw_rectangle(f->x, f->y, f->w, f->h); 109 mlk_painter_draw_rectangle(f->x, f->y, f->w, f->h);
109 } 110 }
111 #endif
110 112
111 static void 113 static void
112 basic(void) 114 basic(void)
113 { 115 {
114 const char * const text[] = { 116 const char * const text[] = {
294 } 296 }
295 297
296 static void 298 static void
297 custom(void) 299 custom(void)
298 { 300 {
301 #if 0
299 const char * const text[] = { 302 const char * const text[] = {
300 "This one will destroy your eyes.", 303 "This one will destroy your eyes.",
301 "Because it use a terrible custom theme." 304 "Because it use a terrible custom theme."
302 }; 305 };
303 struct mlk_theme theme; 306 struct mlk_theme theme;
310 .linesz = 2, 313 .linesz = 2,
311 .theme = &theme 314 .theme = &theme
312 }; 315 };
313 316
314 /* Borrow default theme and change its frame drawing. */ 317 /* Borrow default theme and change its frame drawing. */
315 mlk_theme_shallow(&theme, NULL);
316 theme.draw_frame = my_draw_frame; 318 theme.draw_frame = my_draw_frame;
317 theme.colors[MLK_THEME_COLOR_NORMAL] = 0x0000ffff; 319 theme.colors[MLK_THEME_COLOR_NORMAL] = 0x0000ffff;
318 320
319 run(&msg); 321 run(&msg);
322 #endif
320 } 323 }
321 324
322 static void 325 static void
323 quit(void) 326 quit(void)
324 { 327 {