Update properties panel

This commit is contained in:
Insality
2025-08-10 00:56:08 +03:00
parent 097963bdb3
commit a94121a1c6
2 changed files with 30 additions and 9 deletions

View File

@@ -33,21 +33,34 @@ nodes {
} }
} }
nodes { nodes {
position {
x: 200.0
}
size { size {
x: 400.0 x: 400.0
y: 40.0 y: 40.0
} }
color {
x: 0.173
y: 0.184
z: 0.204
}
type: TYPE_BOX type: TYPE_BOX
texture: "druid/ui_circle_16"
id: "header" id: "header"
pivot: PIVOT_N pivot: PIVOT_NE
parent: "root" parent: "root"
inherit_alpha: true inherit_alpha: true
size_mode: SIZE_MODE_AUTO slice9 {
visible: false x: 8.0
y: 8.0
z: 8.0
w: 8.0
}
} }
nodes { nodes {
position { position {
x: -192.0 x: -392.0
y: -8.0 y: -8.0
} }
scale { scale {
@@ -85,7 +98,7 @@ nodes {
} }
nodes { nodes {
position { position {
x: 192.0 x: -8.0
y: -4.0 y: -4.0
} }
color { color {
@@ -103,7 +116,7 @@ nodes {
} }
nodes { nodes {
position { position {
x: 152.0 x: -48.0
y: -4.0 y: -4.0
} }
color { color {
@@ -121,7 +134,7 @@ nodes {
} }
nodes { nodes {
position { position {
x: 112.0 x: -88.0
y: -4.0 y: -4.0
} }
scale { scale {

View File

@@ -39,6 +39,7 @@ function M:init()
self.contaienr_scroll_content = self.container_scroll_view:add_container("scroll_content") self.contaienr_scroll_content = self.container_scroll_view:add_container("scroll_content")
self.default_size = self.container:get_size() self.default_size = self.container:get_size()
self.header_size = gui.get_size(self:get_node("header"))
-- To have ability to go back to previous scene, collections of all properties to rebuild -- To have ability to go back to previous scene, collections of all properties to rebuild
self.scenes = {} self.scenes = {}
@@ -362,11 +363,18 @@ end
function M:set_hidden(is_hidden) function M:set_hidden(is_hidden)
self._is_hidden = is_hidden self._is_hidden = is_hidden
local hidden_size = gui.get_size(self:get_node("header")) local node_header = self:get_node("header")
local new_size = self._is_hidden and hidden_size or self.default_size local new_size = self._is_hidden and self.header_size or self.default_size
self.container:set_size(new_size.x, new_size.y, gui.PIVOT_N) self.container:set_size(new_size.x, new_size.y, gui.PIVOT_N)
local hidden_width = self.header_size.y + 8
gui.set(node_header, "size.x", self._is_hidden and hidden_width or self.header_size.x)
gui.set_visible(node_header, self._is_hidden)
gui.set_visible(self.root, not self._is_hidden)
gui.set_enabled(self.text_header.node, not self._is_hidden)
gui.set_enabled(self.content, not self._is_hidden) gui.set_enabled(self.content, not self._is_hidden)
gui.set_enabled(self.button_refresh.node, not self._is_hidden) gui.set_enabled(self.button_refresh.node, not self._is_hidden)