diff --git a/ivette/src/frama-c/kernel/ASTinfo.tsx b/ivette/src/frama-c/kernel/ASTinfo.tsx index 42d5488bfbc0e86951ea86494094c2aa74aa6360..9ae52f7ec89dbb4160dc38ec17650330ab954726 100644 --- a/ivette/src/frama-c/kernel/ASTinfo.tsx +++ b/ivette/src/frama-c/kernel/ASTinfo.tsx @@ -40,6 +40,7 @@ import { getInfo } from 'frama-c/kernel/api/ast'; export default function ASTinfo(): JSX.Element { + const theme = Preferences.useThemeColors(); const buffer = React.useMemo(() => new RichTextBuffer(), []); const [selection, updateSelection] = States.useSelection(); const marker = selection?.current?.marker; @@ -65,7 +66,7 @@ export default function ASTinfo(): JSX.Element { <Text buffer={buffer} mode="text" - theme={Preferences.useThemeColors()} + theme={theme} onSelection={onTextSelection} readOnly /> diff --git a/ivette/src/ivette/prefs.tsx b/ivette/src/ivette/prefs.tsx index 0e9b3dece18684ce6984ec4dc65b8c46f0e00679..d71fab48e1d45ffa4077584fe3b599c14dd64d74 100644 --- a/ivette/src/ivette/prefs.tsx +++ b/ivette/src/ivette/prefs.tsx @@ -95,12 +95,13 @@ export function useThemeColors() { export function useThemeButtons(props: ThemeProps): ThemeControls { const [fontSize, setFontSize] = Settings.useGlobalSettings(props.fontSize); const [wrapText, setWrapText] = Settings.useGlobalSettings(props.wrapText); + const theme = useThemeColors(); const zoomIn = () => fontSize < 48 && setFontSize(fontSize + 2); const zoomOut = () => fontSize > 4 && setFontSize(fontSize - 2); const flipWrapText = () => setWrapText(!wrapText); const { disabled = false } = props; return { - theme: useThemeColors(), + theme, fontSize, wrapText, buttons: [ diff --git a/ivette/src/renderer/Controller.tsx b/ivette/src/renderer/Controller.tsx index b7236c770d5fb4debd3ae8086ae298ad4f03c392..df50ecbcbc34ff694b24d84a6b7e6b53f62742a9 100644 --- a/ivette/src/renderer/Controller.tsx +++ b/ivette/src/renderer/Controller.tsx @@ -197,6 +197,7 @@ export const Control = () => { const editor = new RichTextBuffer(); const RenderConsole = () => { + const theme = Preferences.useThemeColors(); const scratch = React.useRef([] as string[]); const [cursor, setCursor] = React.useState(-1); const [isEmpty, setEmpty] = React.useState(true); @@ -331,7 +332,7 @@ const RenderConsole = () => { buffer={edited ? editor : Server.buffer} mode="text" readOnly={!edited} - theme={Preferences.useThemeColors()} + theme={theme} /> </> );