mirror of
https://github.com/Insality/druid
synced 2025-09-27 18:12:21 +02:00
Add simple swipe component
This commit is contained in:
@@ -33,8 +33,8 @@ nodes {
|
||||
w: 1.0
|
||||
}
|
||||
size {
|
||||
x: 1.0
|
||||
y: 1.0
|
||||
x: 600.0
|
||||
y: 900.0
|
||||
z: 0.0
|
||||
w: 1.0
|
||||
}
|
||||
@@ -65,7 +65,7 @@ nodes {
|
||||
clipping_inverted: false
|
||||
alpha: 1.0
|
||||
template_node_child: false
|
||||
size_mode: SIZE_MODE_AUTO
|
||||
size_mode: SIZE_MODE_MANUAL
|
||||
}
|
||||
nodes {
|
||||
position {
|
||||
|
@@ -39,11 +39,24 @@ local function init_top_panel(self)
|
||||
end
|
||||
|
||||
|
||||
local function init_swipe_control(self)
|
||||
self.druid:new_swipe("root", function(_, side)
|
||||
if side == "left" then
|
||||
on_control_button(self, 1)
|
||||
end
|
||||
if side == "right" then
|
||||
on_control_button(self, -1)
|
||||
end
|
||||
end)
|
||||
end
|
||||
|
||||
|
||||
function init(self)
|
||||
druid.set_default_style(default_style)
|
||||
self.druid = druid.new(self)
|
||||
|
||||
init_top_panel(self)
|
||||
init_swipe_control(self)
|
||||
self.page = 1
|
||||
main_page.setup_page(self)
|
||||
text_page.setup_page(self)
|
||||
|
Reference in New Issue
Block a user