Skip to content

Commit 7026c73

Browse files
committed
Property slider sync with all data list examples
Update scoped filters layout
1 parent d07f3f3 commit 7026c73

6 files changed

Lines changed: 37 additions & 9 deletions

File tree

example/components/panel_information/panel_information.gui

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -178,12 +178,12 @@ nodes {
178178
}
179179
nodes {
180180
scale {
181-
x: 0.75
182-
y: 0.75
181+
x: 0.7
182+
y: 0.7
183183
}
184184
size {
185-
x: 535.0
186-
y: 270.0
185+
x: 570.0
186+
y: 300.0
187187
}
188188
color {
189189
x: 0.463

example/examples/data_list/add_remove_clear/data_list_add_remove_clear.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,14 @@ function M:properties_control(properties_panel)
9494
gui.set_clipping_mode(view_node, value and gui.CLIPPING_MODE_STENCIL or gui.CLIPPING_MODE_NONE)
9595
end)
9696

97-
properties_panel:add_slider("ui_scroll", 0, function(value)
97+
local scroll_slider = properties_panel:add_slider("ui_scroll", 0, function(value)
9898
self.scroll:scroll_to_percent(vmath.vector3(0, 1 - value, 0), true)
9999
end)
100100

101+
self.data_list.on_scroll_progress_change:subscribe(function(_, progress)
102+
scroll_slider:set_value(1 - progress)
103+
end)
104+
101105
properties_panel:add_button("ui_add_element", function()
102106
self:add_item()
103107
end)

example/examples/data_list/basic/data_list_horizontal_basic.lua

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,14 @@ function M:properties_control(properties_panel)
4747
properties_panel:add_checkbox("ui_clipping", is_stencil, function(value)
4848
gui.set_clipping_mode(view_node, value and gui.CLIPPING_MODE_STENCIL or gui.CLIPPING_MODE_NONE)
4949
end)
50+
51+
local scroll_slider = properties_panel:add_slider("ui_scroll", 0, function(value)
52+
self.scroll:scroll_to_percent(vmath.vector3(value, 0, 0), true)
53+
end)
54+
55+
self.data_list.on_scroll_progress_change:subscribe(function(_, progress)
56+
scroll_slider:set_value(progress)
57+
end)
5058
end
5159

5260

example/examples/data_list/basic/data_list_matrix_basic.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,9 +65,13 @@ function M:properties_control(properties_panel)
6565
gui.set_clipping_mode(view_node, value and gui.CLIPPING_MODE_STENCIL or gui.CLIPPING_MODE_NONE)
6666
end)
6767

68-
properties_panel:add_slider("ui_scroll", 0, function(value)
68+
local scroll_slider = properties_panel:add_slider("ui_scroll", 0, function(value)
6969
self.scroll:scroll_to_percent(vmath.vector3(0, 1 - value, 0), true)
7070
end)
71+
72+
self.data_list.on_scroll_progress_change:subscribe(function(_, progress)
73+
scroll_slider:set_value(1 - progress)
74+
end)
7175
end
7276

7377

example/examples/data_list/cache_with_component/cache_with_component.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -83,9 +83,13 @@ function M:properties_control(properties_panel)
8383
gui.set_clipping_mode(view_node, value and gui.CLIPPING_MODE_STENCIL or gui.CLIPPING_MODE_NONE)
8484
end)
8585

86-
properties_panel:add_slider("ui_scroll", 0, function(value)
86+
local scroll_slider = properties_panel:add_slider("ui_scroll", 0, function(value)
8787
self.scroll:scroll_to_percent(vmath.vector3(0, 1 - value, 0), true)
8888
end)
89+
90+
self.data_list.on_scroll_progress_change:subscribe(function(_, progress)
91+
scroll_slider:set_value(1 - progress)
92+
end)
8993
end
9094

9195

example/examples/gamepad/scoped_filters/scoped_filters.gui

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,14 @@ nodes {
3131
template: "/example/templates/button_text_green.gui"
3232
}
3333
nodes {
34+
size {
35+
x: 400.0
36+
y: 90.0
37+
}
3438
type: TYPE_BOX
3539
id: "btn_lock_all/root"
3640
parent: "btn_lock_all"
41+
overridden_fields: 4
3742
template_node_child: true
3843
}
3944
nodes {
@@ -228,15 +233,18 @@ nodes {
228233
z: 0.761
229234
}
230235
type: TYPE_TEXT
231-
text: "Two filter levels at once.\nThe top button filters the whole example: only the left panel stays alive.\nEach panel filters itself: only Button A stays alive inside it.\nThe filters stack, and none of them leaks outside of its owner."
236+
text: "Two filter levels at once.\n"
237+
"The top button filters the whole example: only the left panel stays alive.\n"
238+
"Each panel filters itself: only Button A stays alive inside it.\n"
239+
"The filters stack, and none of them leaks outside of its owner."
232240
font: "text_bold"
233241
id: "hint"
234242
pivot: PIVOT_N
243+
line_break: true
235244
parent: "root"
236245
inherit_alpha: true
237246
outline_alpha: 0.0
238247
shadow_alpha: 0.0
239-
line_break: true
240248
}
241249
material: "/builtins/materials/gui.material"
242250
adjust_reference: ADJUST_REFERENCE_PARENT

0 commit comments

Comments
 (0)