Hide line numbers by default
This commit is contained in:
parent
c141f3883a
commit
3c5aec27c3
4 changed files with 10 additions and 0 deletions
|
|
@ -193,6 +193,8 @@ export default function EditorPanel({className, style}: {className?: string, sty
|
||||||
onMount={onMount} // TODO: This looks a bit silly, does it trigger a re-render??
|
onMount={onMount} // TODO: This looks a bit silly, does it trigger a re-render??
|
||||||
options={{
|
options={{
|
||||||
...openscadEditorOptions,
|
...openscadEditorOptions,
|
||||||
|
|
||||||
|
lineNumbers: state.view.lineNumbers ? 'on' : 'off',
|
||||||
// readOnly: !isFileWritable(state.params.sourcePath)
|
// readOnly: !isFileWritable(state.params.sourcePath)
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,12 @@ export default function SettingsMenu({className, style}: {className?: string, st
|
||||||
// disabled: true,
|
// disabled: true,
|
||||||
command: () => model.mutate(s => s.view.showShadows = !s.view.showShadows)
|
command: () => model.mutate(s => s.view.showShadows = !s.view.showShadows)
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
label: state.view.lineNumbers ? 'Hide line numbers' : 'Show line numbers',
|
||||||
|
icon: 'pi pi-list',
|
||||||
|
// disabled: true,
|
||||||
|
command: () => model.mutate(s => s.view.lineNumbers = !s.view.lineNumbers)
|
||||||
|
},
|
||||||
] as MenuItem[]} popup ref={settingsMenu} />
|
] as MenuItem[]} popup ref={settingsMenu} />
|
||||||
<Button title="Settings menu"
|
<Button title="Settings menu"
|
||||||
style={style}
|
style={style}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ export interface State {
|
||||||
color: string,
|
color: string,
|
||||||
showAxes?: boolean,
|
showAxes?: boolean,
|
||||||
showShadows?: boolean,
|
showShadows?: boolean,
|
||||||
|
lineNumbers?: boolean,
|
||||||
}
|
}
|
||||||
|
|
||||||
lastCheckerRun?: {
|
lastCheckerRun?: {
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,7 @@ export function readStateFromFragment(): State | null {
|
||||||
color: validateString(view?.color, () => defaultModelColor),
|
color: validateString(view?.color, () => defaultModelColor),
|
||||||
showAxes: validateBoolean(view?.layout?.showAxis),
|
showAxes: validateBoolean(view?.layout?.showAxis),
|
||||||
showShadows: validateBoolean(view?.layout?.showShadow),
|
showShadows: validateBoolean(view?.layout?.showShadow),
|
||||||
|
lineNumbers: validateBoolean(view?.layout?.lineNumbers, () => false)
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue