summaryrefslogtreecommitdiff
path: root/ui.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-01-22 16:25:05 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-01-22 16:25:05 -0500
commit73a00e3b343526887579f698ca2db324cc4c7cee (patch)
tree213434234065c76e6fe0f8db9c1078937641989b /ui.c
parent968bbd92cf9bf9cc364baa973d81f4dcfa647ca3 (diff)
bold text for file selector cwd
Diffstat (limited to 'ui.c')
-rw-r--r--ui.c14
1 files changed, 8 insertions, 6 deletions
diff --git a/ui.c b/ui.c
index 7b36c81..57b6177 100644
--- a/ui.c
+++ b/ui.c
@@ -5,9 +5,10 @@ static bool file_selector_entry_pos(Ted const *ted, FileSelector const *fs,
Rect bounds = fs->bounds;
float padding = ted->settings.padding;
float char_height = text_font_char_height(ted->font);
+ float char_height_bold = text_font_char_height(ted->font_bold);
*r = rect(V2(bounds.pos.x, bounds.pos.y
- + char_height // make room for cwd
- + char_height * 1.5f + padding // make room for line buffer
+ + char_height_bold + padding // make room for cwd
+ + char_height * 1.5f // make room for line buffer
+ char_height * (float)i),
V2(bounds.size.x, char_height));
return rect_clip_to_rect(r, bounds);
@@ -192,16 +193,17 @@ static void file_selector_render(Ted *ted, FileSelector *fs) {
Rect bounds = fs->bounds;
u32 n_entries = fs->n_entries;
FileEntry const *entries = fs->entries;
- Font *font = ted->font;
+ Font *font = ted->font, *font_bold = ted->font_bold;
float padding = settings->padding;
- float char_height = text_font_char_height(ted->font);
+ float char_height = text_font_char_height(font);
+ float char_height_bold = text_font_char_height(font_bold);
float x1, y1, x2, y2;
rect_coords(bounds, &x1, &y1, &x2, &y2);
// current working directory
gl_color_rgba(colors[COLOR_TEXT]);
- text_render(font, fs->cwd, x1, y1);
- y1 += char_height + padding;
+ text_render(font_bold, fs->cwd, x1, y1);
+ y1 += char_height_bold + padding;
// search buffer
float line_buffer_height = char_height * 1.5f;