feat(touch_bar): reflect new note state

This commit is contained in:
Elian Doran 2025-03-08 23:21:13 +02:00
parent cbbe10ba67
commit a3c58834d1
No known key found for this signature in database

View File

@ -280,6 +280,7 @@ export default class GeoMapTypeWidget extends TypeWidget {
#changeState(newState: State) {
this._state = newState;
this.geoMapWidget.$container.toggleClass("placing-note", newState === State.NewNote);
this.triggerCommand("refreshTouchBar");
}
async #onMapClicked(e: LeafletMouseEvent) {
@ -396,6 +397,8 @@ export default class GeoMapTypeWidget extends TypeWidget {
return;
}
switch (this._state) {
case State.Normal:
return [
new TouchBar.TouchBarSlider({
label: "Zoom",
@ -412,6 +415,13 @@ export default class GeoMapTypeWidget extends TypeWidget {
click: () => this.triggerCommand("geoMapCreateChildNote", { ntxId: this.ntxId })
})
];
case State.NewNote:
return [
new TouchBar.TouchBarSpacer({ size: "flexible" }),
new TouchBar.TouchBarLabel({ label: "New note" })
]
}
}
}