From 96210dc82ccd9fadce2fe6abaab53ab06d2c136a Mon Sep 17 00:00:00 2001 From: Tareq Imbasher Date: Thu, 16 Nov 2023 19:22:08 +0200 Subject: [PATCH] Minor changes --- src/Apps/NetPad.Apps.App/App/src/main.ts | 17 ++++++++++------- .../main/output-view/output-view-toolbar.html | 12 ++++++++---- .../main/output-view/output-view-toolbar.ts | 3 +-- .../src/windows/main/statusbar/statusbar.html | 2 +- 4 files changed, 20 insertions(+), 14 deletions(-) diff --git a/src/Apps/NetPad.Apps.App/App/src/main.ts b/src/Apps/NetPad.Apps.App/App/src/main.ts index 5080bd1d..abb992f1 100644 --- a/src/Apps/NetPad.Apps.App/App/src/main.ts +++ b/src/Apps/NetPad.Apps.App/App/src/main.ts @@ -41,18 +41,25 @@ import {AppLifeCycle} from "./main.app-lifecycle"; import {IPlatform} from "@application/platforms/iplatform"; import {SettingsBackgroundService} from "@application/background-services/settings-background-service"; -// Register common dependencies shared for all windows +// Register common dependencies shared for all windows/apps const builder = Aurelia.register( Registration.instance(String, window.location.origin), Registration.instance(URLSearchParams, new URLSearchParams(window.location.search)), Registration.instance(Settings, new Settings()), Registration.singleton(IAppService, AppService), - Registration.singleton(IIpcGateway, SignalRIpcGateway), Registration.singleton(IEventBus, EventBus), Registration.singleton(ISession, Session), Registration.singleton(ISettingsService, SettingsService), Registration.singleton(AppMutationObserver, AppMutationObserver), Registration.singleton(IBackgroundService, SettingsBackgroundService), + + // The default main IPC gateway the app will use. Can be configured for each platform separately + Registration.singleton(IIpcGateway, SignalRIpcGateway), + + DialogDefaultConfiguration.customize((config) => { + config.lock = true; + }), + LogConfig.register({ colorOptions: ColorOptions.colors, level: Env.isProduction ? LogLevel.info : LogLevel.debug, @@ -103,10 +110,6 @@ const builder = Aurelia.register( ] }), - DialogDefaultConfiguration.customize((config) => { - config.lock = true; - }), - // Global Custom Attributes ExternalLinkCustomAttribute, @@ -162,6 +165,6 @@ const app = builder.app(entryPoint); await app.start(); -window.addEventListener("beforeunload", (e) => app.stop(true)); +window.addEventListener("beforeunload", () => app.stop(true)); logger.debug("App started"); diff --git a/src/Apps/NetPad.Apps.App/App/src/windows/main/output-view/output-view-toolbar.html b/src/Apps/NetPad.Apps.App/App/src/windows/main/output-view/output-view-toolbar.html index db56c477..117b8500 100644 --- a/src/Apps/NetPad.Apps.App/App/src/windows/main/output-view/output-view-toolbar.html +++ b/src/Apps/NetPad.Apps.App/App/src/windows/main/output-view/output-view-toolbar.html @@ -8,11 +8,15 @@
- +
+ + + ${action.label} + +
${action.label} diff --git a/src/Apps/NetPad.Apps.App/App/src/windows/main/output-view/output-view-toolbar.ts b/src/Apps/NetPad.Apps.App/App/src/windows/main/output-view/output-view-toolbar.ts index f73e81e9..33f2e110 100644 --- a/src/Apps/NetPad.Apps.App/App/src/windows/main/output-view/output-view-toolbar.ts +++ b/src/Apps/NetPad.Apps.App/App/src/windows/main/output-view/output-view-toolbar.ts @@ -10,7 +10,6 @@ export interface IToolbarTab { text: string; icon?: string; active?: boolean; - show?: () => boolean; clicked?: (event: MouseEvent) => Promise; view: OutputViewBase } @@ -19,7 +18,7 @@ export interface IToolbarAction { icon?: string; label?: string; active?: boolean; - show?: () => boolean; + show?: boolean; clicked?: (event: MouseEvent) => Promise; actions?: IToolbarAction[]; } diff --git a/src/Apps/NetPad.Apps.App/App/src/windows/main/statusbar/statusbar.html b/src/Apps/NetPad.Apps.App/App/src/windows/main/statusbar/statusbar.html index a4f0b87e..abcc2912 100644 --- a/src/Apps/NetPad.Apps.App/App/src/windows/main/statusbar/statusbar.html +++ b/src/Apps/NetPad.Apps.App/App/src/windows/main/statusbar/statusbar.html @@ -4,7 +4,7 @@ - (Took: ${activeEnvironment.runDurationMilliseconds} ms) + (Took: ${activeEnvironment.runDurationMilliseconds}ms)