Add container style, remove some debug messages
This commit is contained in:
+2
-1
@@ -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);
|
||||
|
||||
@@ -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 ();
|
||||
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
@@ -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])
|
||||
|
||||
Reference in New Issue
Block a user