Improved layer display

This commit is contained in:
Devine Lu Linvega
2017-01-17 09:22:35 -07:00
parent 348943c505
commit 35edb43503
5 changed files with 25 additions and 6 deletions

View File

@@ -7,6 +7,14 @@ function FileSave(rune)
this.docs = "Creates a new window with a image of the resulting canvas in the specified format.";
this.layer = null;
this.install = function()
{
this.layer = new Layer("Export",this);
ronin.surface.add_layer(this.layer);
}
this.active = function(cmd)
{
var d = null;

View File

@@ -9,7 +9,8 @@ function Overlay(rune)
this.install = function()
{
this.layer = new Layer("Test",this);
this.layer = new Layer("Guide",this);
this.layer.element.setAttribute("style","z-index:9000");
ronin.surface.add_layer(this.layer);
}

View File

@@ -44,7 +44,16 @@ function Layer(name,manager = null)
this.widget = function()
{
return (ronin.surface.active_layer.name == this.name) ? "<span class='highlight'>- "+(this.manager != null ? this.manager.constructor.name+"." : '')+this.name+"</span><br />" : "- "+(this.manager != null ? this.manager.constructor.name+"." : '')+this.name+"<br />";
var e_name = "";
if(this.manager != null){ e_name += this.manager.constructor.name+"."; }
e_name += this.name;
var e_class = "";
e_class += "layer ";
if(ronin.surface.active_layer.name == this.name){ e_class += "highlight "; }
if(this.manager != null){ e_class += "managed "; }
return "<span class='"+e_class+"'>- "+e_name+"</span><br />";
}
this.move_from = null;