y += 40.0f;
theme := Button_Theme.{};
theme.active = active_index == i;
- if draw_button(.{x + 4, y - 18, w, 36.0f}, info.name, ^theme, increment=i) {
+ if draw_button(.{x, y - 18, w, 36.0f}, info.name, ^theme, increment=i) {
active_index = i;
}
}
active := false;
}
-@CompilerBug // This should work...
-// default_button_theme := Button_Theme.{};
+default_button_theme := Button_Theme.{};
draw_button :: (use r: Rect, text: str, theme: ^Button_Theme, site := #callsite, increment := 0) -> bool {
// HMMM.... this should be gotten rid of as quick as possible.
immediate_set_color(surface_color);
immediate_rectangle(x + border_width, y + border_width, w - border_width * 2, h - border_width * 2);
- font : Font;
- if theme.font == null do font = font_lookup(.{"./assets/fonts/calibri.ttf", 16});
- else do font = *theme.font;
+ font := font_lookup(.{theme.font_name, theme.font_size});
font_height := font_get_height(font, text);
font_set_color(theme.text_color);
font_draw_centered(font, x, y + (h - font_height) / 2 + font.em - 2, w, text);
placeholder_text_color := Color.{ 0.5, 0.5, 0.5 };
}
-@CompilerBug
-// default_textbox_theme := Textbox_Theme.{};
+default_textbox_theme := Textbox_Theme.{};
#local {
Textbox_Editing_State :: struct {
text_color = theme.placeholder_text_color;
}
- font : Font;
- if theme.font == null do font = font_lookup(.{"./assets/fonts/calibri.ttf", 16});
- else do font = *theme.font;
+ font := font_lookup(.{theme.font_name, theme.font_size});
text_width := font_get_width(font, text);
text_height := font_get_height(font, text);
Text_Theme :: struct {
text_color := Color.{1, 1, 1};
- font : ^Font = null;
+ font_name := "./assets/fonts/calibri.ttf";
+ font_size := 18;
}
Animation_Theme :: struct {