From 5424932f1a445d878292a6c2eeed6c34865f21b8 Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Fri, 12 Apr 2024 15:03:45 +0200 Subject: [PATCH] Feature: add possibility to have a title when opening the popup as FloatOver --- .../ThemeConfig/Json/LayerConfigJson.ts | 5 +++-- src/Models/ThemeConfig/LayerConfig.ts | 2 +- .../BigComponents/SelectedElementTitle.svelte | 3 +++ src/UI/ThemeViewGUI.svelte | 22 ++++++++++++------- 4 files changed, 21 insertions(+), 11 deletions(-) diff --git a/src/Models/ThemeConfig/Json/LayerConfigJson.ts b/src/Models/ThemeConfig/Json/LayerConfigJson.ts index aab3799fd..fdcc794f4 100644 --- a/src/Models/ThemeConfig/Json/LayerConfigJson.ts +++ b/src/Models/ThemeConfig/Json/LayerConfigJson.ts @@ -219,12 +219,13 @@ export interface LayerConfigJson { * * If set, open the selectedElementView in a floatOver instead of on the right. * - * iftrue: show the infobox in the splashscreen floating over the entire UI + * iftrue: show the infobox in the splashscreen floating over the entire UI; hide the title bar * iffalse: show the infobox in a sidebar on the right + * suggestions: return [{if: "value=title", then: "Show in a floatover and show the title bar"}] * group: advanced * default: sidebar */ - popupInFloatover?: boolean + popupInFloatover?: boolean | "title" | string /** * Small icons shown next to the title. diff --git a/src/Models/ThemeConfig/LayerConfig.ts b/src/Models/ThemeConfig/LayerConfig.ts index 8e6a70d08..b72658cf8 100644 --- a/src/Models/ThemeConfig/LayerConfig.ts +++ b/src/Models/ThemeConfig/LayerConfig.ts @@ -66,7 +66,7 @@ export default class LayerConfig extends WithContextLoader { public readonly syncSelection: (typeof LayerConfig.syncSelectionAllowed)[number] // this is a trick to conver a constant array of strings into a type union of these values public readonly _needsFullNodeDatabase: boolean - public readonly popupInFloatover + public readonly popupInFloatover: boolean | string constructor(json: LayerConfigJson, context?: string, official: boolean = true) { context = context + "." + json.id diff --git a/src/UI/BigComponents/SelectedElementTitle.svelte b/src/UI/BigComponents/SelectedElementTitle.svelte index a00e58a72..44987328e 100644 --- a/src/UI/BigComponents/SelectedElementTitle.svelte +++ b/src/UI/BigComponents/SelectedElementTitle.svelte @@ -65,6 +65,8 @@ {/if} + + +