mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-22 20:03:39 +08:00
feat(touch_bar): reflect new note state
This commit is contained in:
parent
cbbe10ba67
commit
a3c58834d1
@ -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" })
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user