WIP Apply label: Show apply label button

This commit is contained in:
Bill Kendrick 2022-02-09 23:25:46 -08:00
parent d682044ce0
commit e0922a14e1

View file

@ -684,8 +684,7 @@ enum
enum enum
{ {
LABEL_LABEL, /* Adding new label(s) */ LABEL_LABEL, /* Adding new label(s) */
LABEL_SELECT, /* "Select" button clicked; user is selecting a label to edit */ LABEL_SELECT /* "Select" button clicked; user is selecting a label to edit */
LABEL_APPLY /* "Apply" button clicked; user is selecting a label to apply permanently to the canvas */
}; };
@ -9681,9 +9680,15 @@ static void draw_fonts(void)
/* "Apply Label" button */ /* "Apply Label" button */
dest.x = WINDOW_WIDTH - r_ttoolopt.w; dest.x = WINDOW_WIDTH - r_ttoolopt.w;
dest.y = r_ttoolopt.h + ((most / gd_toolopt.cols + TOOLOFFSET / gd_toolopt.cols) * button_h); dest.y = r_ttoolopt.h + ((most / gd_toolopt.cols + TOOLOFFSET / gd_toolopt.cols) * button_h);
if (are_labels())
SDL_BlitSurface(img_btn_up, NULL, screen, &dest);
else
SDL_BlitSurface(img_btn_off, NULL, screen, &dest); SDL_BlitSurface(img_btn_off, NULL, screen, &dest);
/* FIXME: Draw img_label_apply -bjk 2022.02.09 */ dest.x = WINDOW_WIDTH - r_ttoolopt.w + (button_w - img_label_apply->w) / 2;
dest.y = (r_ttoolopt.h + ((most / gd_toolopt.cols + TOOLOFFSET / gd_toolopt.cols) * button_h) + (button_h - img_label_apply->h) / 2);
SDL_BlitSurface(img_label_apply, NULL, screen, &dest);
/* "Select Label" button */ /* "Select Label" button */
@ -9692,7 +9697,6 @@ static void draw_fonts(void)
if (cur_label == LABEL_SELECT) if (cur_label == LABEL_SELECT)
SDL_BlitSurface(img_btn_down, NULL, screen, &dest); SDL_BlitSurface(img_btn_down, NULL, screen, &dest);
else else
{ {
if (are_labels()) if (are_labels())
@ -9706,6 +9710,7 @@ static void draw_fonts(void)
dest.y = (r_ttoolopt.h + ((most / gd_toolopt.cols + TOOLOFFSET / gd_toolopt.cols) * button_h) + (button_h - img_label_select->h) / 2); dest.y = (r_ttoolopt.h + ((most / gd_toolopt.cols + TOOLOFFSET / gd_toolopt.cols) * button_h) + (button_h - img_label_select->h) / 2);
SDL_BlitSurface(img_label_select, NULL, screen, &dest); SDL_BlitSurface(img_label_select, NULL, screen, &dest);
most = most + gd_toolopt.cols; most = most + gd_toolopt.cols;
} }