summaryrefslogtreecommitdiffstats
path: root/src/splash.c
diff options
context:
space:
mode:
authorP. J. McDermott <pj@pehjota.net>2021-08-05 18:29:03 (EDT)
committer P. J. McDermott <pj@pehjota.net>2021-08-05 18:37:18 (EDT)
commit371eed87471036c4ac4e5cf030869bdade8a7107 (patch)
tree38e919bc2e5dd016edc166f59aa332bff75a64f3 /src/splash.c
parent674e4bedcc69288da92248e0f988b45f1c055fee (diff)
downloadmazefight-371eed87471036c4ac4e5cf030869bdade8a7107.zip
mazefight-371eed87471036c4ac4e5cf030869bdade8a7107.tar.gz
mazefight-371eed87471036c4ac4e5cf030869bdade8a7107.tar.bz2
tk: Support alignment of widgets in grid
Diffstat (limited to 'src/splash.c')
-rw-r--r--src/splash.c18
1 files changed, 15 insertions, 3 deletions
diff --git a/src/splash.c b/src/splash.c
index 317906f..07036b8 100644
--- a/src/splash.c
+++ b/src/splash.c
@@ -109,30 +109,40 @@ _mf_splash_form(SDL_Renderer *renderer, const char *font_path,
grid = mftk_grid_new(4, 2, MF_SPLASH_ROW_M, MF_SPLASH_COL_M,
mftk_label_new(text_font, "Size", text_color, renderer),
+ MFTK_GRID_HALIGN_R|MFTK_GRID_VALIGN_T,
mftk_radio_new(MF_SPLASH_CHK_BTN_W, MF_SPLASH_CHK_BTN_P,
&chkb_color, &chkm_color, MF_SPLASH_CHK_LBL_P,
MF_SPLASH_CHK_ITM_P, text_font, text_color,
_mf_splash_size, NULL, renderer, 0, 3, "15x15",
"20x20", "30x30"),
+ MFTK_GRID_HALIGN_L|MFTK_GRID_VALIGN_T,
mftk_label_new(text_font, "Fog of war", text_color,
renderer),
+ MFTK_GRID_HALIGN_R|MFTK_GRID_VALIGN_T,
mftk_check_new(MF_SPLASH_CHK_BTN_W, MF_SPLASH_CHK_BTN_P,
&chkb_color, &chkm_color, SDL_TRUE, 0, NULL,
NULL, NULL, _mf_splash_fow, NULL, renderer),
+ MFTK_GRID_HALIGN_L|MFTK_GRID_VALIGN_T,
mftk_label_new(text_font, "Reveal maze", text_color,
renderer),
+ MFTK_GRID_HALIGN_R|MFTK_GRID_VALIGN_T,
mftk_check_new(MF_SPLASH_CHK_BTN_W, MF_SPLASH_CHK_BTN_P,
&chkb_color, &chkm_color, SDL_FALSE, 0, NULL,
NULL, NULL, _mf_splash_reveal, NULL, renderer),
+ MFTK_GRID_HALIGN_L|MFTK_GRID_VALIGN_T,
mftk_blank_new(),
+ MFTK_GRID_HALIGN_R|MFTK_GRID_VALIGN_T,
mftk_grid_new(1, 2, 0, MF_SPLASH_BTN_M,
mftk_button_new(text_font, "Quit", text_color,
&butn_color, MF_SPLASH_BTN_P,
&_mf_splash_quit, NULL, renderer),
+ MFTK_GRID_HALIGN_L|MFTK_GRID_VALIGN_T,
mftk_button_new(text_font, "Play", text_color,
&butn_color, MF_SPLASH_BTN_P,
- &_mf_splash_play, NULL, renderer)
- )
+ &_mf_splash_play, NULL, renderer),
+ MFTK_GRID_HALIGN_L|MFTK_GRID_VALIGN_T
+ ),
+ MFTK_GRID_HALIGN_L|MFTK_GRID_VALIGN_T
);
TTF_CloseFont(text_font);
@@ -171,8 +181,10 @@ mf_splash(SDL_Renderer *renderer)
&form_color, mftk_grid_new(2, 1, MF_SPLASH_TITLE_M, 0,
mftk_label_new(title_font, "Maze Fight",
&text_color, renderer),
+ MFTK_GRID_HALIGN_C|MFTK_GRID_VALIGN_T,
_mf_splash_form(renderer, font_path,
- &text_color)
+ &text_color),
+ MFTK_GRID_HALIGN_C|MFTK_GRID_VALIGN_T
)
);
/* TODO: Widgets */