From 426021f1548b3f3513c4bc82127fffdd5dda84ab Mon Sep 17 00:00:00 2001 From: Adam Harrison Date: Sat, 11 Oct 2025 01:41:57 -0400 Subject: Added in 3.0 differences. --- plugins/plugin_manager/plugin_view.lua | 49 ++++++++-------------------------- 1 file changed, 11 insertions(+), 38 deletions(-) (limited to 'plugins/plugin_manager/plugin_view.lua') diff --git a/plugins/plugin_manager/plugin_view.lua b/plugins/plugin_manager/plugin_view.lua index 0755a30..1798c97 100644 --- a/plugins/plugin_manager/plugin_view.lua +++ b/plugins/plugin_manager/plugin_view.lua @@ -21,7 +21,6 @@ end local plugin_view = nil -PluginView.menu = ContextMenu() function PluginView:new() PluginView.super.new(self) @@ -54,34 +53,6 @@ function PluginView:get_name() end -local root_view_update = RootView.update -function RootView:update(...) - root_view_update(self, ...) - PluginView.menu:update() -end - - -local root_view_draw = RootView.draw -function RootView:draw(...) - root_view_draw(self, ...) - PluginView.menu:draw() -end - - -local root_view_on_mouse_moved = RootView.on_mouse_moved -function RootView:on_mouse_moved(...) - if PluginView.menu:on_mouse_moved(...) then return end - return root_view_on_mouse_moved(self, ...) -end - - -local on_view_mouse_pressed = RootView.on_view_mouse_pressed -function RootView.on_view_mouse_pressed(button, x, y, clicks) - local handled = PluginView.menu:on_mouse_pressed(button, x, y, clicks) - return handled or on_view_mouse_pressed(button, x, y, clicks) -end - - function PluginView:on_mouse_pressed(button, mx, my, clicks) if PluginView.super.on_mouse_pressed(self, button, mx, my, clicks) then return true end local lh = style.font:get_height() + style.padding.y @@ -461,14 +432,16 @@ keymap.add { } -PluginView.menu:register(function() return core.active_view:is(PluginView) end, { - { text = "Install", command = "plugin-manager:install-hovered" }, - { text = "Uninstall", command = "plugin-manager:uninstall-hovered" }, - { text = "View Source", command = "plugin-manager:view-source-hovered" }, - { text = "View README", command = "plugin-manager:view-readme-hovered" }, - ContextMenu.DIVIDER, - { text = "Refresh Listing", command = "plugin-manager:refresh-all" }, - { text = "Upgrade All", command = "plugin-manager:upgrade-all" }, -}) +function PluginView:on_context_menu() + return { items = { + { text = "Install", command = "plugin-manager:install-hovered" }, + { text = "Uninstall", command = "plugin-manager:uninstall-hovered" }, + { text = "View Source", command = "plugin-manager:view-source-hovered" }, + { text = "View README", command = "plugin-manager:view-readme-hovered" }, + ContextMenu.DIVIDER, + { text = "Refresh Listing", command = "plugin-manager:refresh-all" }, + { text = "Upgrade All", command = "plugin-manager:upgrade-all" } + } } +end return PluginView -- cgit v1.2.3