Mercurial > molko
comparison examples/example-ui.c @ 161:31d7f23c0588
ui: label no longer has w, h fields
author | David Demelier <markand@malikania.fr> |
---|---|
date | Sat, 17 Oct 2020 10:12:41 +0200 |
parents | c3a40062acc2 |
children | 4bbfcd9180a8 |
comparison
equal
deleted
inserted
replaced
160:22141b6b2e43 | 161:31d7f23c0588 |
---|---|
135 } | 135 } |
136 | 136 |
137 static void | 137 static void |
138 resize_header(void) | 138 resize_header(void) |
139 { | 139 { |
140 struct frame *h = &ui.panel.frame; | 140 struct frame *f = &ui.panel.frame; |
141 struct label *l = &ui.header.label; | 141 struct label *l = &ui.header.label; |
142 unsigned int w, h; | |
142 | 143 |
143 /* Header. */ | 144 /* Header. */ |
144 label_query(l); | 145 label_query(l, &w, &h); |
145 align(ALIGN_LEFT, &l->x, &l->y, l->w, l->h, h->x, h->y, h->w, HEADER_HEIGHT); | 146 align(ALIGN_LEFT, &l->x, &l->y, w, h, f->x, f->y, f->w, HEADER_HEIGHT); |
146 | 147 |
147 l->x += theme_default()->padding; | 148 l->x += theme_default()->padding; |
148 } | 149 } |
149 | 150 |
150 static void | 151 static void |
156 struct label *l = &ui.autosave.label; | 157 struct label *l = &ui.autosave.label; |
157 | 158 |
158 c->x = f->x + padding; | 159 c->x = f->x + padding; |
159 c->y = f->y + HEADER_HEIGHT + padding; | 160 c->y = f->y + HEADER_HEIGHT + padding; |
160 | 161 |
161 l->w = f->w - c->w - padding; | |
162 l->x = c->x + c->w + padding; | 162 l->x = c->x + c->w + padding; |
163 l->y = c->y; | 163 l->y = c->y; |
164 } | 164 } |
165 | 165 |
166 static void | 166 static void |