瀏覽代碼

allow masking of scene editor side bar

Nicolas Cannasse 5 年之前
父節點
當前提交
e5138602bc
共有 5 個文件被更改,包括 62 次插入0 次删除
  1. 27 0
      bin/style.css
  2. 29 0
      bin/style.less
  3. 4 0
      hide/comp/Tabs.hx
  4. 1 0
      hide/view/Prefab.hx
  5. 1 0
      hide/view/l3d/Level3D.hx

+ 27 - 0
bin/style.css

@@ -401,6 +401,33 @@ input[type=checkbox]:checked:after {
   position: relative;
   height: 100%;
 }
+.hide-tabs.masked {
+  flex: none;
+  position: absolute;
+  height: 20px;
+  width: 20px;
+  right: 0px;
+}
+.hide-tabs.masked > * {
+  display: none !important;
+}
+.hide-tabs.masked > .maskToggle:before {
+  content: "«";
+}
+.hide-tabs > .maskToggle {
+  display: block !important;
+  position: absolute;
+  margin-top: -2px;
+  right: 5px;
+  color: #aaa;
+  font-size: 24px;
+}
+.hide-tabs > .maskToggle:before {
+  content: "»";
+}
+.hide-tabs > .maskToggle:hover {
+  color: white;
+}
 .hide-tabs .tabs-header {
   background-color: #111;
   padding: 2px;

+ 29 - 0
bin/style.less

@@ -431,6 +431,35 @@ input[type=checkbox] {
 	position: relative;
 	height: 100%;
 
+	&.masked {
+		& > * {
+			display : none !important;
+		}
+		flex : none;
+		position: absolute;
+		height : 20px;
+		width : 20px;
+		right : 0px;
+		>.maskToggle:before {
+			content : "«";
+		}
+	}
+
+	>.maskToggle {
+		&:before {
+			content : "»";
+		}
+		display : block !important;
+		position : absolute;
+		margin-top : -2px;
+		right : 5px;
+		color : #aaa;
+		font-size: 24px;
+		&:hover {
+			color : white;
+		}
+	}
+
 	.tabs-header {
 		background-color : #111;
 		padding : 2px;

+ 4 - 0
hide/comp/Tabs.hx

@@ -31,6 +31,10 @@ class Tabs extends Component {
 		return header.find('[index=$index]');
 	}
 
+	public function allowMask() {
+		new Element('<a href="#" class="maskToggle"></a>').prependTo(element).click((_) -> element.toggleClass("masked"));
+	}
+
 	function set_currentTab( e : Element ) {
 		var index = Std.parseInt(e.attr("index"));
 		getTabs().hide();

+ 1 - 0
hide/view/Prefab.hx

@@ -80,6 +80,7 @@ class Prefab extends FileView {
 		');
 		tools = new hide.comp.Toolbar(null,element.find(".toolbar"));
 		tabs = new hide.comp.Tabs(null,element.find(".tabs"));
+		tabs.allowMask();
 		sceneEditor = new PrefabSceneEditor(this, data);
 		element.find(".scenetree").first().append(sceneEditor.tree.element);
 		element.find(".tab").first().append(sceneEditor.properties.element);

+ 1 - 0
hide/view/l3d/Level3D.hx

@@ -313,6 +313,7 @@ class Level3D extends FileView {
 		tools = new hide.comp.Toolbar(null,element.find(".tools-buttons"));
 		layerToolbar = new hide.comp.Toolbar(null,element.find(".layer-buttons"));
 		tabs = new hide.comp.Tabs(null,element.find(".tabs"));
+		tabs.allowMask();
 		currentVersion = undo.currentID;
 
 		levelProps = new hide.comp.PropsEditor(undo,null,element.find(".level-props"));