comparison libmlk-ui/mlk/ui/notify.c @ 505:6100c643dba0

ui: finally ditch theme
author David Demelier <markand@malikania.fr>
date Wed, 01 Mar 2023 16:24:07 +0100
parents 52a305833381
children d49a05e7a5b5
comparison
equal deleted inserted replaced
504:52a305833381 505:6100c643dba0
27 27
28 #include "align.h" 28 #include "align.h"
29 #include "frame.h" 29 #include "frame.h"
30 #include "label.h" 30 #include "label.h"
31 #include "notify.h" 31 #include "notify.h"
32 #include "theme.h"
33 32
34 #define WIDTH (mlk_window.w / 3) 33 #define WIDTH (mlk_window.w / 3)
35 #define HEIGHT (mlk_window.h / 10) 34 #define HEIGHT (mlk_window.h / 10)
36 35
37 struct geo { 36 struct geo {
58 static size_t stacksz; 57 static size_t stacksz;
59 58
60 static void 59 static void
61 geometry(struct geo *geo, const struct mlk_notify *n, size_t index) 60 geometry(struct geo *geo, const struct mlk_notify *n, size_t index)
62 { 61 {
62 #if 0
63 int x, y; 63 int x, y;
64 64
65 /* Determine theme. */ 65 /* Determine theme. */
66 geo->theme = system->theme ? system->theme : &mlk_theme; 66 geo->theme = system->theme ? system->theme : &mlk_theme;
67 67
95 95
96 /* Align body so it ends at the end of the icon. */ 96 /* Align body so it ends at the end of the icon. */
97 geo->body_x = geo->title_x; 97 geo->body_x = geo->title_x;
98 geo->body_y = geo->icon_y + n->icon->h; 98 geo->body_y = geo->icon_y + n->icon->h;
99 geo->body_y -= mlk_font_height(geo->theme->fonts[MLK_THEME_FONT_INTERFACE]) / 2; 99 geo->body_y -= mlk_font_height(geo->theme->fonts[MLK_THEME_FONT_INTERFACE]) / 2;
100 #endif
100 } 101 }
101 102
102 static void 103 static void
103 draw_frame(const struct geo *geo) 104 draw_frame(const struct geo *geo)
104 { 105 {
119 } 120 }
120 121
121 static void 122 static void
122 draw_title(const struct geo *geo, const struct mlk_notify *n) 123 draw_title(const struct geo *geo, const struct mlk_notify *n)
123 { 124 {
125 #if 0
124 const struct mlk_label l = { 126 const struct mlk_label l = {
125 .x = geo->title_x, 127 .x = geo->title_x,
126 .y = geo->title_y, 128 .y = geo->title_y,
127 .text = n->title, 129 .text = n->title,
128 .flags = MLK_LABEL_FLAGS_SHADOW 130 .flags = MLK_LABEL_FLAGS_SHADOW
129 }; 131 };
130 132
131 mlk_label_draw(&l); 133 mlk_label_draw(&l);
134 #endif
132 } 135 }
133 136
134 static void 137 static void
135 draw_body(const struct geo *geo, const struct mlk_notify *n) 138 draw_body(const struct geo *geo, const struct mlk_notify *n)
136 { 139 {
140 #if 0
137 const struct mlk_label l = { 141 const struct mlk_label l = {
138 .x = geo->body_x, 142 .x = geo->body_x,
139 .y = geo->body_y, 143 .y = geo->body_y,
140 .text = n->body, 144 .text = n->body,
141 .flags = MLK_LABEL_FLAGS_SHADOW 145 .flags = MLK_LABEL_FLAGS_SHADOW
142 }; 146 };
143 147
144 mlk_label_draw(&l); 148 mlk_label_draw(&l);
149 #endif
145 } 150 }
146 151
147 static void 152 static void
148 draw(const struct mlk_notify *n, size_t index) 153 draw(const struct mlk_notify *n, size_t index)
149 { 154 {