From bfa0ab401551074157e8f0aeb4ffdcc936c1b681 Mon Sep 17 00:00:00 2001 From: Alexander Drozdov Date: Sat, 25 Jul 2020 17:06:11 +0300 Subject: [PATCH] hide-on-focus --- src/ipc/types.ts | 3 ++- src/main/config.ts | 2 +- src/web/overlay/OverlayWindow.vue | 6 ++++++ src/web/settings/maps.vue | 2 +- 4 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/ipc/types.ts b/src/ipc/types.ts index 024680ec..c8bf4dc1 100644 --- a/src/ipc/types.ts +++ b/src/ipc/types.ts @@ -51,7 +51,8 @@ type WidgetWellKnownFlag = 'has-browser' | 'invisible-on-blur' | 'hide-on-blur' | - 'hide-on-blur(close)' + 'hide-on-blur(close)' | + 'hide-on-focus' export const defaultConfig: Config = { configVersion: 3, diff --git a/src/main/config.ts b/src/main/config.ts index 4167e731..69b387f9 100644 --- a/src/main/config.ts +++ b/src/main/config.ts @@ -47,7 +47,7 @@ export const config = (() => { config.fontSize = defaultConfig.fontSize } - { + { // config.configVersion < 2 (undefined) const mapWidget = config.widgets.find(w => w.wmType === 'map-check')! if (mapWidget.wmZorder !== 'exclusive') { mapWidget.wmZorder = 'exclusive' diff --git a/src/web/overlay/OverlayWindow.vue b/src/web/overlay/OverlayWindow.vue index c943e595..8632d574 100644 --- a/src/web/overlay/OverlayWindow.vue +++ b/src/web/overlay/OverlayWindow.vue @@ -101,6 +101,12 @@ export default { } } } + } else { + for (const w of this.widgets) { + if (w.wmFlags.includes('hide-on-focus')) { + this.hide(w.wmId) + } + } } }) MainProcess.addEventListener(VISIBILITY, ({ detail: e }) => { diff --git a/src/web/settings/maps.vue b/src/web/settings/maps.vue index a25c7dcd..8d5b80a5 100644 --- a/src/web/settings/maps.vue +++ b/src/web/settings/maps.vue @@ -15,7 +15,7 @@ -
+
{{ $t('Stat (found: {0})', [filteredStats.length]) }}
{{ $t('Invert') }}