From 5d26ddc5b3bd9f5ac66620b31f3014a4820d90e8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Espeute?= Date: Tue, 19 Nov 2024 12:24:18 +0100 Subject: [PATCH] [ide] added status bar --- bin/style.css | 16 ++++++++++++++++ bin/style.less | 23 +++++++++++++++++++++++ hide/Ide.hx | 12 ++++++++++++ 3 files changed, 51 insertions(+) diff --git a/bin/style.css b/bin/style.css index c60d6889..b86191cf 100644 --- a/bin/style.css +++ b/bin/style.css @@ -3759,3 +3759,19 @@ hide-popover hide-content { color: white; mix-blend-mode: difference; } +#statusBar { + position: fixed; + bottom: 16px; + right: 16px; + z-index: 999; + display: flex; + align-items: center; +} +#statusBar > .statusbar-icon { + height: 24px; + width: 24px; + display: flex; + align-items: center; + justify-content: center; + font-size: 2em; +} diff --git a/bin/style.less b/bin/style.less index eb7ec0f0..090d8888 100644 --- a/bin/style.less +++ b/bin/style.less @@ -4393,4 +4393,27 @@ hide-popover { .tag-disp { color: white; mix-blend-mode: difference; +} + +#statusBar { + position: fixed; + bottom: 16px; + right: 16px; + + z-index: 999; + + display: flex; + + align-items: center; + + > .statusbar-icon { + height: 24px; + width: 24px; + + display: flex; + align-items: center; + justify-content: center; + + font-size: 2em; + } } \ No newline at end of file diff --git a/hide/Ide.hx b/hide/Ide.hx index 1ad04e48..ac3b8cfa 100644 --- a/hide/Ide.hx +++ b/hide/Ide.hx @@ -40,6 +40,8 @@ class Ide extends hide.tools.IdeData { var scripts : MapVoid>> = new Map(); var hasReloaded = false; + var statusBar : hide.Element; + public var show3DIcons = true; public var show3DIconsCategory : Map = new Map(); @@ -262,6 +264,8 @@ class Ide extends hide.tools.IdeData { }); hrt.impl.EditorTools.setupIconCategories(); + + statusBar = new Element('
').appendTo(body); } public function getViews>( cl : Class ) { @@ -847,6 +851,14 @@ class Ide extends hide.tools.IdeData { } } + /** + Adds an element to the ide status bar + **/ + public function addStatusIcon(e: hide.Element) { + var wrapper = new hide.Element('
').appendTo(statusBar); + wrapper.append(e); + } + public function chooseFiles( exts : Array, onSelect : Array -> Void, allowNull=false ) { chooseFileOptions(onSelect, {exts: exts, allowNull: allowNull, multiple: true}); }