mirror of
https://github.com/l0ng-ai/openidea.git
synced 2026-11-19 00:10:00 +00:00
The debug console used the UI mono font and size instead of the console font the Run window resolves from Tools › Terminal › Font (or Editor › Font). Both consoles now take family, size and row height from a shared useConsoleFont() hook, the debug console re-measures its rows when the size changes, and its evaluate input uses the same font. Closes #2844 Co-authored-by: a-rookie-of-C-language <186315048+a-rookie-of-C-language@users.noreply.github.com>
15 lines
679 B
TypeScript
15 lines
679 B
TypeScript
import { useProject } from "./project";
|
||
import { resolveMonoFont } from "./fonts";
|
||
import { useWorkflowSettings } from "./workflowSettings";
|
||
|
||
/**
|
||
* The font of the Run and Debug consoles: Tools › Terminal › Font (which can follow
|
||
* Editor › Font), with the row height both consoles lay their lines out with.
|
||
*/
|
||
export function useConsoleFont(): { family: string; size: number; rowHeight: number } {
|
||
const terminalFont = useWorkflowSettings((s) => s.terminal);
|
||
const editorFont = useProject((s) => s.settings?.editor);
|
||
const { family, size } = resolveMonoFont(terminalFont, editorFont);
|
||
return { family, size, rowHeight: Math.max(16, Math.round(size * 1.5)) };
|
||
}
|