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; return;
} }
switch (this._state) { return [
case State.Normal: new TouchBar.TouchBarSlider({
return [ label: "Zoom",
new TouchBar.TouchBarSlider({ value: map.getZoom(),
label: "Zoom", minValue: map.getMinZoom(),
value: map.getZoom(), maxValue: map.getMaxZoom(),
minValue: map.getMinZoom(), change(newValue) {
maxValue: map.getMaxZoom(), that.ignoreNextZoomEvent = true;
change(newValue) { map.setZoom(newValue);
that.ignoreNextZoomEvent = true; },
map.setZoom(newValue); }),
}, new TouchBar.TouchBarButton({
}), label: "New geo note",
new TouchBar.TouchBarButton({ click: () => this.triggerCommand("geoMapCreateChildNote", { ntxId: this.ntxId }),
label: "New geo note", enabled: (this._state === State.Normal)
click: () => this.triggerCommand("geoMapCreateChildNote", { ntxId: this.ntxId }) })
}) ];
];
case State.NewNote:
return [
new TouchBar.TouchBarSpacer({ size: "flexible" }),
new TouchBar.TouchBarLabel({ label: "New note" })
]
}
} }
} }