Skip to content

Build your personal knowledge base with Trilium Notes

feat(touch_bar): new geonote button

Elian Doran5961e983c734
diff --git a/src/public/app/components/app_context.ts b/src/public/app/components/app_context.ts
index 5861894d17..f863274aa1 100644
--- a/src/public/app/components/app_context.ts
+++ b/src/public/app/components/app_context.ts
@@ -256,6 +256,8 @@ export type CommandMappings = {
refreshResults: {};
refreshSearchDefinition: {};
+ geoMapCreateChildNote: CommandData;
+
buildTouchBar: CommandData & {
TouchBar: typeof import("electron").TouchBar;
buildIcon(name: string): NativeImage;
@@ -356,9 +358,6 @@ type EventMappings = {
exportSvg: {
ntxId: string | null | undefined;
};
- geoMapCreateChildNote: {
- ntxId: string | null | undefined; // TODO: deduplicate ntxId
- };
tabReorder: {
ntxIdsInOrder: string[];
};
diff --git a/src/public/app/widgets/geo_map.ts b/src/public/app/widgets/geo_map.ts
index b0a37d2b83..76ff7d0eb2 100644
--- a/src/public/app/widgets/geo_map.ts
+++ b/src/public/app/widgets/geo_map.ts
@@ -77,6 +77,10 @@ export default class GeoMapWidget extends NoteContextAwareWidget {
change(newValue) {
map.setZoom(newValue);
},
+ }),
+ new TouchBar.TouchBarButton({
+ label: "New geo note",
+ click: () => this.parent?.triggerEvent("geoMapCreateChildNote", { ntxId: this.ntxId })
})
];
}