Skip to content

Commit

Permalink
[ide] added status bar
Browse files Browse the repository at this point in the history
  • Loading branch information
EspeuteClement committed Nov 19, 2024
1 parent 8602ed7 commit 5d26ddc
Show file tree
Hide file tree
Showing 3 changed files with 51 additions and 0 deletions.
16 changes: 16 additions & 0 deletions bin/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
23 changes: 23 additions & 0 deletions bin/style.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}
12 changes: 12 additions & 0 deletions hide/Ide.hx
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class Ide extends hide.tools.IdeData {
var scripts : Map<String,Array<Void->Void>> = new Map();
var hasReloaded = false;

var statusBar : hide.Element;

public var show3DIcons = true;
public var show3DIconsCategory : Map<hrt.impl.EditorTools.IconCategory, Bool> = new Map();

Expand Down Expand Up @@ -262,6 +264,8 @@ class Ide extends hide.tools.IdeData {
});

hrt.impl.EditorTools.setupIconCategories();

statusBar = new Element('<div id="statusBar"></div>').appendTo(body);
}

public function getViews<K,T:hide.ui.View<K>>( cl : Class<T> ) {
Expand Down Expand Up @@ -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('<div class="statusbar-icon"></div>').appendTo(statusBar);
wrapper.append(e);
}

public function chooseFiles( exts : Array<String>, onSelect : Array<String> -> Void, allowNull=false ) {
chooseFileOptions(onSelect, {exts: exts, allowNull: allowNull, multiple: true});
}
Expand Down

0 comments on commit 5d26ddc

Please sign in to comment.