Skip to content

Commit

Permalink
ModelView: fix selection changed to None on Material Library
Browse files Browse the repository at this point in the history
  • Loading branch information
LeoVgr committed Nov 28, 2024
1 parent c200320 commit 61c05f6
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 20 deletions.
32 changes: 16 additions & 16 deletions hide/Ide.hx
Original file line number Diff line number Diff line change
Expand Up @@ -268,22 +268,6 @@ class Ide extends hide.tools.IdeData {

hrt.impl.EditorTools.setupIconCategories();

if (hideRoot != null) {
hideRoot.remove();
hideRoot = null;
}
hideRoot = new Element('<div class="hide-root"></div>').appendTo(new Element("body"));

goldenContainer = new Element('<div class="golden-layout-root"></div>').appendTo(hideRoot);

statusBar = new Element('<div class="status-bar"></div>').appendTo(hideRoot);
statusIcons = new Element('<div id="status-icons"></div>').appendTo(statusBar);

var commitHash = getGitCommitHashAndDate();
if (commitHash.length > 0) {
new Element('<span class="build">hide $commitHash</span>').appendTo(statusBar);
}

refreshFont();
}

Expand Down Expand Up @@ -394,6 +378,22 @@ class Ide extends hide.tools.IdeData {
}
for( i in config.content ) checkRec(i);

if (hideRoot != null) {
hideRoot.remove();
hideRoot = null;
}
hideRoot = new Element('<div class="hide-root"></div>').appendTo(new Element("body"));

goldenContainer = new Element('<div class="golden-layout-root"></div>').appendTo(hideRoot);

statusBar = new Element('<div class="status-bar"></div>').appendTo(hideRoot);
statusIcons = new Element('<div id="status-icons"></div>').appendTo(statusBar);

var commitHash = getGitCommitHashAndDate();
if (commitHash.length > 0) {
new Element('<span class="build">hide $commitHash</span>').appendTo(statusBar);
}

layout = new golden.Layout(config, goldenContainer.get(0));
var resizeTimer : haxe.Timer = null;
var observer = new hide.comp.ResizeObserver((elts, observer) -> {
Expand Down
16 changes: 12 additions & 4 deletions hide/view/Model.hx
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,19 @@ class Model extends FileView {
if ( props != null && props.__refMode != null )
mode.val((props:Dynamic).__refMode).select();


function setDefault() {
tex.show();
matEl.show();
def = true;
selectMaterial(m);
}

libSelect.change(function(_) {
updateMatSelect();

if (libSelect.val() == "")
setDefault();
});

matSelect.change(function(_) {
Expand All @@ -297,10 +308,7 @@ class Model extends FileView {
tex.hide();
matEl.hide();
} else {
tex.show();
matEl.show();
def = true;
selectMaterial(m);
setDefault();
}
});

Expand Down

0 comments on commit 61c05f6

Please sign in to comment.