aboutsummaryrefslogtreecommitdiff
path: root/src/comet.c
diff options
context:
space:
mode:
authorFederico Angelilli <code@fedang.net>2023-11-19 12:29:04 +0100
committerFederico Angelilli <code@fedang.net>2023-11-19 12:29:04 +0100
commit6ac026b7a28dcf704a2d239184f75c81cbdae008 (patch)
tree0ca6991c5539b55ed83323e770ccb389dcfa658f /src/comet.c
parentbd327c61eb3c59458b197e70f6c091d81dbde1ba (diff)
Add button alignment and layouting
Diffstat (limited to 'src/comet.c')
-rw-r--r--src/comet.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/comet.c b/src/comet.c
index 268d846..a1bc605 100644
--- a/src/comet.c
+++ b/src/comet.c
@@ -69,16 +69,24 @@ int main(int argc, char **argv)
for (int i = 0; i < 9; ++i) {
char text[] = { '1' + i, '\0' };
- Button *btn = button_create(text);
+ Button *btn = button_create(text, PANGO_ALIGN_LEFT);
button_set_action(btn, action);
state_add_button(state, btn);
}
- Button *btn = button_create("long button");
- button_set_action(btn, action);
- state_add_button(state, btn);
+ Button *long_btn = button_create("long button", PANGO_ALIGN_CENTER);
+ button_set_action(long_btn, action);
+ state_add_button(state, long_btn);
- draw_compute_layout(draw, state->btns, window_get_context(win));
+ Button *date_btn = button_create("date = today", PANGO_ALIGN_RIGHT);
+ button_set_action(date_btn, action);
+ state_add_button(state, date_btn);
+
+ Button *u_btn = button_create("U", PANGO_ALIGN_RIGHT);
+ button_set_action(u_btn, action);
+ state_add_button(state, u_btn);
+
+ draw_compute_layout(draw, win, state->btns);
connect_attach_state(con, state);
connect_attach_source(con);