diff --git a/src/public/app/widgets/touch_bar.ts b/src/public/app/widgets/touch_bar.ts index 9e3a80234..8ce1b0d34 100644 --- a/src/public/app/widgets/touch_bar.ts +++ b/src/public/app/widgets/touch_bar.ts @@ -4,6 +4,8 @@ import appContext from "../components/app_context.js"; import NoteContextAwareWidget from "./note_context_aware_widget.js"; import type { TouchBarButton, TouchBarGroup, TouchBarSegmentedControl, TouchBarSpacer } from "@electron/remote"; +export type TouchBarItem = (TouchBarButton | TouchBarSpacer | TouchBarGroup | TouchBarSegmentedControl); + export function buildSelectedBackgroundColor(isSelected: boolean) { return isSelected ? "#757575" : undefined; } @@ -58,13 +60,13 @@ export default class TouchBarWidget extends NoteContextAwareWidget { let result = parentComponent.triggerCommand("buildTouchBar", { TouchBar, buildIcon: this.buildIcon.bind(this) - }); + }) as unknown as TouchBarItem[]; const touchBar = this.#buildTouchBar(result); this.remote.getCurrentWindow().setTouchBar(touchBar); } - #buildTouchBar(componentSpecificItems?: (TouchBarButton | TouchBarSpacer | TouchBarGroup | TouchBarSegmentedControl)[]) { + #buildTouchBar(componentSpecificItems?: TouchBarItem[]) { const { TouchBar } = this.remote; const { TouchBarButton, TouchBarSpacer, TouchBarGroup, TouchBarSegmentedControl, TouchBarOtherItemsProxy } = this.remote.TouchBar; @@ -81,7 +83,6 @@ export default class TouchBarWidget extends NoteContextAwareWidget { new TouchBarSpacer({ size: "large" }), ...componentSpecificItems, new TouchBarOtherItemsProxy(), - new TouchBarSpacer({ size: "flexible" }), new TouchBarButton({ icon: this.buildIcon("NSTouchBarAddDetailTemplate"), click: () => this.triggerCommand("jumpToNote") diff --git a/src/public/app/widgets/type_widgets/editable_code.ts b/src/public/app/widgets/type_widgets/editable_code.ts index 389eb7ae3..ca922cfc2 100644 --- a/src/public/app/widgets/type_widgets/editable_code.ts +++ b/src/public/app/widgets/type_widgets/editable_code.ts @@ -1,9 +1,12 @@ -import type { EventData } from "../../components/app_context.js"; +import { app } from "electron"; +import type { CommandListenerData, EventData } from "../../components/app_context.js"; import type FNote from "../../entities/fnote.js"; import { t } from "../../services/i18n.js"; import keyboardActionService from "../../services/keyboard_actions.js"; import options from "../../services/options.js"; import AbstractCodeTypeWidget from "./abstract_code_type_widget.js"; +import appContext from "../../components/app_context.js"; +import type { TouchBarItem } from "../touch_bar.js"; const TPL = `