summaryrefslogtreecommitdiff
path: root/menu.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-25 20:21:13 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-25 20:21:13 -0500
commit3050f7539aa780f15ea1ae4bd0296dfbb57b8e03 (patch)
treeb97fcdb5b11c3f8136a7e10ea3b52725901c7052 /menu.c
parentbf9a22bfff4051a70dcebbcd471eddb7b7724f7a (diff)
menu titles, better padding
Diffstat (limited to 'menu.c')
-rw-r--r--menu.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/menu.c b/menu.c
index 40742cf..287b153 100644
--- a/menu.c
+++ b/menu.c
@@ -73,6 +73,8 @@ static void menu_render(Ted *ted, Menu menu) {
Settings const *settings = &ted->settings;
u32 const *colors = settings->colors;
float window_width = ted->window_width, window_height = ted->window_height;
+ Font *font_bold = ted->font_bold;
+ float char_height_bold = text_font_char_height(font_bold);
// render backdrop
glBegin(GL_QUADS);
@@ -101,6 +103,15 @@ static void menu_render(Ted *ted, Menu menu) {
menu_y2 -= padding;
+ gl_color_rgba(colors[COLOR_TEXT]);
+ if (menu == MENU_OPEN) {
+ text_render(font_bold, "Open...", menu_x1, menu_y1);
+ } else if (menu == MENU_SAVE_AS) {
+ text_render(font_bold, "Save as...", menu_x1, menu_y1);
+ }
+
+ menu_y1 += char_height_bold * 0.75f + padding;
+
FileSelector *fs = &ted->file_selector;
fs->bounds = rect4(menu_x1, menu_y1, menu_x2, menu_y2);
file_selector_render(ted, fs);