Skip to content

Commit

Permalink
Reset editLayerName on location change; respond immediately; set edit…
Browse files Browse the repository at this point in the history
…LayerName on source list sel change
  • Loading branch information
justvanrossum committed Sep 19, 2023
1 parent 5096bbd commit 0d389b0
Showing 1 changed file with 22 additions and 9 deletions.
31 changes: 22 additions & 9 deletions src/fontra/views/editor/panel-designspace-navigation.js
Original file line number Diff line number Diff line change
Expand Up @@ -163,15 +163,20 @@ export default class DesignspaceNavigationPanel extends Panel {
}, 100)
);

this.sceneSettingsController.addKeyListener("location", (event) => {
this.updateResetAllAxesButtonState();
this.updateInterpolationContributions();
if (event.senderInfo?.senderID === this) {
// Sent by us, ignore
return;
}
this.designspaceLocation.values = event.newValue;
});
this.sceneSettingsController.addKeyListener(
"location",
(event) => {
this.sceneSettings.editLayerName = null;
this.updateResetAllAxesButtonState();
this.updateInterpolationContributions();
if (event.senderInfo?.senderID === this) {
// Sent by us, ignore
return;
}
this.designspaceLocation.values = event.newValue;
},
true
);

this.sceneSettingsController.addKeyListener("selectedSourceIndex", (event) => {
this.sourcesList.setSelectedItemIndex(event.newValue);
Expand Down Expand Up @@ -255,6 +260,14 @@ export default class DesignspaceNavigationPanel extends Panel {
this.sceneController.scrollAdjustBehavior = "pin-glyph-center";
const sourceIndex = this.sourcesList.getSelectedItemIndex();
this.sceneSettings.selectedSourceIndex = sourceIndex;
if (sourceIndex != undefined) {
const varGlyphController =
await this.sceneModel.getSelectedVariableGlyphController();
if (varGlyphController) {
this.sceneSettings.editLayerName =
varGlyphController.sources[sourceIndex]?.layerName;
}
}
});

this.sourcesList.addEventListener("rowDoubleClicked", (event) => {
Expand Down

0 comments on commit 0d389b0

Please sign in to comment.