cmodule2 FixFonts > DynPrintLogAndEnabled { switchable int fontSize = 16; transient RSTOverQ rstUpdateAllModules = dm_rstOverModuleQ(r updateAllModules_impl); start { dm_onAnyModuleVisualized(mod -> { //print("Module " + mod + " visualized: " + dm_vis(mod)); dm_q(r { updateModule(mod) }); }); dm_onFieldChangeAndNow(ll("fontSize", "enabled"), r updateAllModules); } afterVisualize { addToControlArea(dm_intSpinner fontSize(1, 100)); } void updateAllModules { rstUpdateAllModules.trigger(); } void updateAllModules_impl { if (!enabled) ret; L mods = lambdaFilter dm_isShowing(dm_moduleIDs()); if (empty(mods)) ret; time { print("Setting font size of " + nModules(mods) + " to " + fontSize + "..."); for (O mod : mods) updateModule(mod); } } void updateModule(O mod) { if (!enabled) ret; JComponent vis = dm_vis(mod); if (vis == null) ret; swing { setAllStandardFontSizesRecursively(vis, fontSize); } } }