static void glw_update_sizes(glw_root_t *gr) { int val; int base_size = gr->gr_height / 35; // 35 is just something val = GLW_CLAMP(base_size + glw_settings.gs_size, 14, 40); if(gr->gr_current_size != val) { gr->gr_current_size = val; prop_set(gr->gr_prop_ui, "size", PROP_SET_INT, val); glw_text_flush(gr); glw_icon_flush(gr); TRACE(TRACE_DEBUG, "GLW", "UI size scale changed to %d", val); } val = GLW_CLAMP(gr->gr_base_underscan_h + glw_settings.gs_underscan_h, 0, 100); if(gr->gr_underscan_h != val) { prop_set(gr->gr_prop_ui, "underscan_h", PROP_SET_INT, val); gr->gr_underscan_h = val; } val = GLW_CLAMP(gr->gr_base_underscan_v + glw_settings.gs_underscan_v, 0, 100); if(gr->gr_underscan_v != val) { prop_set(gr->gr_prop_ui, "underscan_v", PROP_SET_INT, val); gr->gr_underscan_v = val; } }
void glw_update_size(glw_root_t *gr) { int v = gr->gr_base_size + gr->gr_user_size; v = GLW_CLAMP(v, 14, 40); if(gr->gr_current_size == v) return; gr->gr_current_size = v; prop_set_int(gr->gr_prop_size, v); glw_text_flush(gr); glw_icon_flush(gr); TRACE(TRACE_DEBUG, "GLW", "UI size scale changed to %d", v); }