feat(touch_bar): use disabled button for geomap

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

View File

@ -397,31 +397,23 @@ export default class GeoMapTypeWidget extends TypeWidget {
return;
}
switch (this._state) {
case State.Normal:
return [
new TouchBar.TouchBarSlider({
label: "Zoom",
value: map.getZoom(),
minValue: map.getMinZoom(),
maxValue: map.getMaxZoom(),
change(newValue) {
that.ignoreNextZoomEvent = true;
map.setZoom(newValue);
},
}),
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" })
]
}
return [
new TouchBar.TouchBarSlider({
label: "Zoom",
value: map.getZoom(),
minValue: map.getMinZoom(),
maxValue: map.getMaxZoom(),
change(newValue) {
that.ignoreNextZoomEvent = true;
map.setZoom(newValue);
},
}),
new TouchBar.TouchBarButton({
label: "New geo note",
click: () => this.triggerCommand("geoMapCreateChildNote", { ntxId: this.ntxId }),
enabled: (this._state === State.Normal)
})
];
}
}