Implement proper layout of toolbar

This commit is contained in:
Francesco Abbate
2021-02-15 00:36:39 +01:00
parent 5851a04098
commit b836c2e1e6
4 changed files with 62 additions and 32 deletions
-6
View File
@@ -74,12 +74,6 @@ function ToolbarView:on_mouse_moved(px, py, ...)
end
end
-- init
if false then
local view = ToolbarView()
local node = core.root_view:get_active_node()
node:split("up", view, true)
end
-- register commands and keymap
--[[command.add(nil, {
+9 -1
View File
@@ -188,6 +188,9 @@ function TreeView:update()
if self.init_size then
self.size.x = dest
self.init_size = false
-- FIXME: bring back the visibility toggle and animation
-- else
-- self:move_towards(self.size, "x", dest)
end
TreeView.super.update(self)
@@ -249,7 +252,12 @@ end
-- init
local view = TreeView()
local node = core.root_view:get_active_node()
local treeview_node = node:split("left", view, true, true)
local treeview_node = node:split("left", view, {x = true}, true)
local toolbar_plugin, ToolbarView = core.try(require, "plugins.toolbarview")
if toolbar_plugin then
treeview_node:split("down", ToolbarView(), {y = true})
end
-- register commands and keymap