vg_build_font_face_run( &small, 'a', 'z', 0, 28 );
vg_build_font_face_run( &small, '0', '9', 208,14 );
vg_build_font_face_run( &small, 0x7f, 0xa4, 0,42 );
+ vg_build_font_face_run( &small, 0xb0, 0xb2, 208,28 );
vg_build_write_font_face( fp, &small );
vg_font_face large =
vg_build_font_face_run( &large, 'a', 'z', 0, 98 );
vg_build_font_face_run( &large, '0', '9', 312,77 );
vg_build_font_face_run( &large, 0x7f, 0xa4, 0,119 );
+ vg_build_font_face_run( &large, 0xb0, 0xb2, 312,98 );
vg_build_write_font_face( fp, &large );
vg_font_face title =
vg_build_font_face_run( &title, 0x7f, 0x88, 120,350 );
vg_build_font_face_run( &title, 0x93, 0x98, 360,350 );
vg_build_font_face_run( &title, 0x99, 0xa4, 0,392 );
+ vg_build_font_face_run( &title, 0xb0, 0xb2, 288,392 );
vg_build_write_font_face( fp, &title );
fclose( fp );
text_cursor[0] -= vg_ui.font->sx*scale;
ui_rect glyph;
- ui_text_glyph( vg_ui.font, '\xb6' /*FIXME*/, glyph );
+ ui_text_glyph( vg_ui.font, '\xb1' /*FIXME*/, glyph );
ui_fill_rect( text_cursor, 0x00ffffff, glyph );
text_cursor[0] += vg_ui.font->sx*scale;
}
* -----------------------------------------------------------------------------
*/
+enum ui_button_state ui_checkbox_base( ui_rect box, i32 *data )
+{
+ enum ui_button_state state = ui_button_base( box );
+ if( state == k_ui_button_click )
+ *data = (*data) ^ 0x1;
+ return state;
+}
+
int ui_checkbox( ui_rect inout_panel, const char *str_label, i32 *data )
{
ui_rect rect, label, box;
ui_split( rect, k_ui_axis_v, -rect[3], 0, label, box );
ui_text( label, str_label, k_ui_scale, k_ui_align_middle_left, 0 );
+
+ enum ui_button_state state = ui_checkbox_base( box, data );
- int changed = ui_colourbutton( box, k_ui_bg, 0, 0 ) == k_ui_button_click;
- if( changed )
- *data = (*data) ^ 0x1;
+ if( state == k_ui_button_holding_inside )
+ {
+ ui_fill( box, ui_colour(k_ui_bg+2) );
+ ui_outline( box, 1, ui_colour(k_ui_fg), 0 );
+ }
+ else if( state == k_ui_button_holding_outside )
+ {
+ ui_fill( box, ui_colour(k_ui_bg) );
+ ui_outline( box, 1, ui_colour(k_ui_fg), 0 );
+ }
+ else if( state == k_ui_button_hover )
+ {
+ ui_fill( box, ui_colour(k_ui_bg) );
+ ui_outline( box, 1, ui_colour(k_ui_fg), 0 );
+ }
+ else
+ {
+ ui_fill( box, ui_colour(k_ui_bg) );
+ ui_outline( box, 1, ui_colour(k_ui_bg+4), 0 );
+ }
+
+ bool changed = (state == k_ui_button_click);
- if( *data ){
+ if( *data )
+ {
ui_rect_pad( box, (ui_px[2]){4,4} );
ui_fill( box, ui_colour( k_ui_orange ) );
}