diff --git a/game/src/ui/uiman.c b/game/src/ui/uiman.c index d8cb604..8b72cd3 100644 --- a/game/src/ui/uiman.c +++ b/game/src/ui/uiman.c @@ -50,6 +50,7 @@ uiman_init () Widget *debug_menu = Widget_flowbox_new (TRUE); debug_menu->layout_padding = 8; debug_menu->layout_spacing = 8; + debug_menu->style = WSTYLE (STYLE_CONTAINER); Widget_add_child_flowbox (debug_menu, Widget_label_make_float ("Frame time: %.2f", &delta_time, TEXT_ALIGN_LEFT), 1, 20); Widget_add_child_flowbox (debug_menu, Widget_label_make_int ("Chunks: %d", &n_frame_chunks, TEXT_ALIGN_LEFT), 1./2., 20); @@ -60,7 +61,7 @@ uiman_init () Widget_add_child_flowbox (debug_menu, Widget_label_make_float ("Z: %.1f", &camera_position[2], TEXT_ALIGN_RIGHT), 1./3., 20); Widget *spinner = Widget_composite_spinner_make_int ("Render distance: %d", &render_distance); - spinner->tooltip = g_string_new ("A tooltip"); + spinner->tooltip = g_string_new ("Right click to show a context menu"); Widget_add_child_flowbox (debug_menu, spinner, 1, 20); Widget_add_child_flowbox (debug_menu, Widget_composite_checkbox_make ("Wireframe", "wireframe_enabled"), 1./2., 20); diff --git a/game/src/ui/widget_composites.c b/game/src/ui/widget_composites.c index 9ffd143..e835c57 100644 --- a/game/src/ui/widget_composites.c +++ b/game/src/ui/widget_composites.c @@ -45,8 +45,6 @@ Widget_composite_spinner_make_int (const char *fmt, int *ptr) Widget * Widget_composite_checkbox_make (const char *label, char *flag) { - UNUSED (flag); - Widget *cont = Widget_container_new (TRUE); Widget *box = Widget_plain_new (); diff --git a/game/src/ui/widget_layout.c b/game/src/ui/widget_layout.c index d013533..6da59ec 100644 --- a/game/src/ui/widget_layout.c +++ b/game/src/ui/widget_layout.c @@ -239,8 +239,6 @@ Widget_layout_flowbox (Widget *self) int logical_main = self->position[main_axis]; int logical_cross = self->position[cross_axis]; - g_debug ("Flowbox being layouted!"); - Widget *child; WIDGET_FOREACH_CHILD (self, i, child) { diff --git a/game/src/ui/widget_style.h b/game/src/ui/widget_style.h index a9b9c36..509ec37 100644 --- a/game/src/ui/widget_style.h +++ b/game/src/ui/widget_style.h @@ -40,6 +40,7 @@ typedef enum WidgetStyleId STYLE_TOOLTIP, STYLE_ICON_BUTTON, STYLE_WINDOW, + STYLE_CONTAINER, NSTYLES } WidgetStyleId; @@ -103,6 +104,15 @@ static const WidgetStyle widget_styles[NSTYLES] = { .border_width = 3, }, + + [STYLE_CONTAINER] = { + .background_color = { 0.3, 0.3, 0.3, 1.0 }, + .background_color_hovered = { 0.3, 0.3, 0.3, 1.0 }, + .background_color_clicked = { 0.3, 0.3, 0.3, 1.0 }, + + /* .border_color = { 0.5, 0.5, 0.5, 1.0 }, */ + /* .border_width = 2, */ + }, }; #define WSTYLE(id) (&widget_styles[id])