mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-23 04:12:35 +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) {
|
#changeState(newState: State) {
|
||||||
this._state = newState;
|
this._state = newState;
|
||||||
this.geoMapWidget.$container.toggleClass("placing-note", newState === State.NewNote);
|
this.geoMapWidget.$container.toggleClass("placing-note", newState === State.NewNote);
|
||||||
|
this.triggerCommand("refreshTouchBar");
|
||||||
}
|
}
|
||||||
|
|
||||||
async #onMapClicked(e: LeafletMouseEvent) {
|
async #onMapClicked(e: LeafletMouseEvent) {
|
||||||
@ -396,22 +397,31 @@ export default class GeoMapTypeWidget extends TypeWidget {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
switch (this._state) {
|
||||||
new TouchBar.TouchBarSlider({
|
case State.Normal:
|
||||||
label: "Zoom",
|
return [
|
||||||
value: map.getZoom(),
|
new TouchBar.TouchBarSlider({
|
||||||
minValue: map.getMinZoom(),
|
label: "Zoom",
|
||||||
maxValue: map.getMaxZoom(),
|
value: map.getZoom(),
|
||||||
change(newValue) {
|
minValue: map.getMinZoom(),
|
||||||
that.ignoreNextZoomEvent = true;
|
maxValue: map.getMaxZoom(),
|
||||||
map.setZoom(newValue);
|
change(newValue) {
|
||||||
},
|
that.ignoreNextZoomEvent = true;
|
||||||
}),
|
map.setZoom(newValue);
|
||||||
new TouchBar.TouchBarButton({
|
},
|
||||||
label: "New geo note",
|
}),
|
||||||
click: () => this.triggerCommand("geoMapCreateChildNote", { ntxId: this.ntxId })
|
new TouchBar.TouchBarButton({
|
||||||
})
|
label: "New geo note",
|
||||||
];
|
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