From aed643893e7bb2739eda40653f8d643158d808c0 Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Mon, 14 Jun 2021 09:23:04 -0400 Subject: [PATCH 1/2] Fixed contextmenu to play nice with dragging nodes. --- data/plugins/contextmenu.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/plugins/contextmenu.lua b/data/plugins/contextmenu.lua index a23d59cf..6320c5fc 100644 --- a/data/plugins/contextmenu.lua +++ b/data/plugins/contextmenu.lua @@ -246,7 +246,7 @@ function RootView:on_mouse_pressed(button, x,y, clicks) if button == "middle" or node.hovered_close == idx then node:close_view(self.root_node, node.views[idx]) else - self.dragged_node = idx + self.dragged_node = { node, idx or #node.views } node:set_active_view(node.views[idx]) end else From 2fc245eb696a6495e302d780a291e66217ba8abc Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Mon, 14 Jun 2021 20:33:15 -0400 Subject: [PATCH 2/2] Added in an interface to the scale plugin. --- data/plugins/scale.lua | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/data/plugins/scale.lua b/data/plugins/scale.lua index 11064235..5a1a69bd 100644 --- a/data/plugins/scale.lua +++ b/data/plugins/scale.lua @@ -58,6 +58,9 @@ local function set_scale(scale) core.redraw = true end +local function get_scale() + return current_scale +end local on_mouse_wheel = RootView.on_mouse_wheel @@ -98,3 +101,10 @@ keymap.add { ["ctrl+="] = "scale:increase", } +return { + ["set"] = set_scale, + ["get"] = get_scale, + ["increase"] = inc_scale, + ["decrease"] = dec_scale, + ["reset"] = res_scale +}