@@ -18,9 +18,10 @@ import { AutoCompleteTree } from "./AutoCompletion";
1818import { TreeBuilder } from "./DslLanguage" ;
1919import { LabelTypeRegistry } from "../labels/labelTypeRegistry" ;
2020import { EditorModeController } from "../editorMode/editorModeController" ;
21+ import { Switchable } from "../../common/lightDarkSwitch" ;
2122
2223@injectable ( )
23- export class ConstraintMenu extends AbstractUIExtension {
24+ export class ConstraintMenu extends AbstractUIExtension implements Switchable {
2425 static readonly ID = "constraint-menu" ;
2526 private selectedConstraint : Constraint | undefined ;
2627 private editorContainer : HTMLDivElement = document . createElement ( "div" ) as HTMLDivElement ;
@@ -55,16 +56,22 @@ export class ConstraintMenu extends AbstractUIExtension {
5556 protected initializeContents ( containerElement : HTMLElement ) : void {
5657 containerElement . classList . add ( "ui-float" ) ;
5758 containerElement . innerHTML = `
58- <input type="checkbox" id="expand-state-constraint" hidden>
59+ <input type="checkbox" id="expand-state-constraint" class="accordion-state" hidden>
5960 <label id="constraint-menu-expand-label" for="expand-state-constraint">
60- <div class="expand -button">
61+ <div class="accordion -button cevron-left" id="constraint-menu-expand-title ">
6162 Constraints
6263 </div>
6364 </label>
6465 ` ;
65- containerElement . appendChild ( this . buildConstraintInputWrapper ( ) ) ;
66- containerElement . appendChild ( this . buildConstraintListWrapper ( ) ) ;
66+ const accordionContent = document . createElement ( "div" ) ;
67+ accordionContent . classList . add ( "accordion-content" ) ;
68+ const contentDiv = document . createElement ( "div" ) ;
69+ contentDiv . id = "constraint-menu-content" ;
70+ accordionContent . appendChild ( contentDiv ) ;
71+ contentDiv . appendChild ( this . buildConstraintInputWrapper ( ) ) ;
72+ contentDiv . appendChild ( this . buildConstraintListWrapper ( ) ) ;
6773 containerElement . appendChild ( this . buildRunButton ( ) ) ;
74+ containerElement . appendChild ( accordionContent ) ;
6875 }
6976
7077 private buildConstraintInputWrapper ( ) : HTMLElement {
@@ -316,4 +323,8 @@ export class ConstraintMenu extends AbstractUIExtension {
316323
317324 e . layout ( { height : cHeight , width : cWidth } ) ;
318325 }
326+
327+ switchTheme ( useDark : boolean ) : void {
328+ this . editor ?. updateOptions ( { theme : useDark ? "vs-dark" : "vs" } ) ;
329+ }
319330}
0 commit comments