mirror of
https://github.com/captbaritone/webamp.git
synced 2026-07-22 09:37:17 +00:00
Obey some visibility flags
This commit is contained in:
parent
395cbfbcb9
commit
626ba0849d
2 changed files with 9 additions and 3 deletions
|
|
@ -1,9 +1,11 @@
|
|||
import { toBool } from "../utils";
|
||||
import Group from "./Group";
|
||||
import Layout from "./Layout";
|
||||
import XmlObj from "./XmlObj";
|
||||
|
||||
export default class Container extends XmlObj {
|
||||
_layouts: Layout[] = [];
|
||||
_defaultVisible: boolean = true;
|
||||
constructor() {
|
||||
super();
|
||||
}
|
||||
|
|
@ -13,6 +15,8 @@ export default class Container extends XmlObj {
|
|||
return true;
|
||||
}
|
||||
switch (key) {
|
||||
case "default_visible":
|
||||
this._defaultVisible = toBool(value);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
@ -26,8 +30,10 @@ export default class Container extends XmlObj {
|
|||
|
||||
getDebugDom(): HTMLDivElement {
|
||||
const div = window.document.createElement("div");
|
||||
for (const layout of this._layouts) {
|
||||
div.appendChild(layout.getDebugDom());
|
||||
if (this._defaultVisible) {
|
||||
for (const layout of this._layouts) {
|
||||
div.appendChild(layout.getDebugDom());
|
||||
}
|
||||
}
|
||||
return div;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -45,7 +45,7 @@ export default class Group extends GuiObj {
|
|||
const div = super.getDebugDom();
|
||||
div.style.height = Utils.px(this._maximumHeight);
|
||||
div.style.width = Utils.px(this._maximumWidth);
|
||||
if (this._background != null) {
|
||||
if (this._background != null && this._drawBackground) {
|
||||
const bitmap = UI_ROOT.getBitmap(this._background);
|
||||
div.style.background = bitmap.getBackgrondCSSAttribute();
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue