From 371eed87471036c4ac4e5cf030869bdade8a7107 Mon Sep 17 00:00:00 2001 From: P. J. McDermott Date: Thu, 05 Aug 2021 18:29:03 -0400 Subject: tk: Support alignment of widgets in grid --- (limited to 'src/splash.c') 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 */ -- cgit v0.9.1