summaryrefslogtreecommitdiff
path: root/find.c
diff options
context:
space:
mode:
authorLeo Tenenbaum <pommicket@gmail.com>2021-02-07 19:08:17 -0500
committerLeo Tenenbaum <pommicket@gmail.com>2021-02-07 19:08:17 -0500
commite802f33329f5c9c2a0630693d42c737d4b75b409 (patch)
treef8be266956a39882c6aa53b978ce25ff9b3dfdef /find.c
parent4bfae2f646237d21d2ab2714241fe5273759526c (diff)
improved text rendering, started find
Diffstat (limited to 'find.c')
-rw-r--r--find.c28
1 files changed, 28 insertions, 0 deletions
diff --git a/find.c b/find.c
new file mode 100644
index 0000000..85816ba
--- /dev/null
+++ b/find.c
@@ -0,0 +1,28 @@
+static float find_menu_height(Ted *ted) {
+ Font *font = ted->font, *font_bold = ted->font_bold;
+ float char_height = text_font_char_height(font),
+ char_height_bold = text_font_char_height(font_bold);
+ Settings const *settings = &ted->settings;
+ float padding = settings->padding;
+
+ return char_height_bold + char_height + 4 * padding;
+}
+
+static void find_menu_frame(Ted *ted) {
+ Font *font = ted->font, *font_bold = ted->font_bold;
+ float const char_height = text_font_char_height(font),
+ char_height_bold = text_font_char_height(font_bold);
+
+ Settings const *settings = &ted->settings;
+ float const padding = settings->padding;
+ float const menu_height = find_menu_height(ted);
+ float const window_width = ted->window_width, window_height = ted->window_height;
+ u32 const *colors = settings->colors;
+
+ Rect menu_bounds = rect(V2(padding, window_height - menu_height), V2(window_width - 2*padding, menu_height - padding));
+
+ gl_geometry_rect_border(menu_bounds, 1, colors[COLOR_BORDER]);
+
+ gl_geometry_draw();
+ (void)char_height; (void)char_height_bold;
+}