From a0447c41b42ff90595c5e1c52a17d334709817d8 Mon Sep 17 00:00:00 2001 From: Elian Doran Date: Sun, 13 Apr 2025 20:29:56 +0300 Subject: [PATCH] feat(touchbar): display modal title --- src/public/app/widgets/touch_bar.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/public/app/widgets/touch_bar.ts b/src/public/app/widgets/touch_bar.ts index 3154ae9a3..8cc2b9359 100644 --- a/src/public/app/widgets/touch_bar.ts +++ b/src/public/app/widgets/touch_bar.ts @@ -74,9 +74,15 @@ export default class TouchBarWidget extends NoteContextAwareWidget { #buildModalTouchBar() { const { TouchBar } = this.remote; - const { TouchBarButton, TouchBarSpacer } = this.remote.TouchBar; + const { TouchBarButton, TouchBarLabel, TouchBarSpacer } = this.remote.TouchBar; const items: TouchBarItem[] = []; + // Look for the modal title. + const $title = this.$activeModal.find(".modal-title"); + if ($title.length > 0) { + items.push(new TouchBarLabel({ label: $title.text() })) + } + items.push(new TouchBarSpacer({ size: "flexible" })); // Look for buttons in the modal.