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??
|
||||
options={{
|
||||
...openscadEditorOptions,
|
||||
|
||||
lineNumbers: state.view.lineNumbers ? 'on' : 'off',
|
||||
// readOnly: !isFileWritable(state.params.sourcePath)
|
||||
}}
|
||||
/>
|
||||
|
|
|
|||
|
|
@ -38,6 +38,12 @@ export default function SettingsMenu({className, style}: {className?: string, st
|
|||
// disabled: true,
|
||||
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} />
|
||||
<Button title="Settings menu"
|
||||
style={style}
|
||||
|
|
|
|||
|
|
@ -24,6 +24,7 @@ export interface State {
|
|||
color: string,
|
||||
showAxes?: boolean,
|
||||
showShadows?: boolean,
|
||||
lineNumbers?: boolean,
|
||||
}
|
||||
|
||||
lastCheckerRun?: {
|
||||
|
|
|
|||
|
|
@ -37,6 +37,7 @@ export function readStateFromFragment(): State | null {
|
|||
color: validateString(view?.color, () => defaultModelColor),
|
||||
showAxes: validateBoolean(view?.layout?.showAxis),
|
||||
showShadows: validateBoolean(view?.layout?.showShadow),
|
||||
lineNumbers: validateBoolean(view?.layout?.lineNumbers, () => false)
|
||||
}
|
||||
};
|
||||
} catch (e) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue