aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorjgmdev <jgmdev@gmail.com>2022-06-22 00:35:41 -0400
committerjgmdev <jgmdev@gmail.com>2022-06-22 00:36:08 -0400
commit93bf73faead3573744b3e07aea999ab106777870 (patch)
treecda9739007c239d3f0d5554748a800baa72fa0ab /plugins
parent62f4e30c8106244a4cd1b380f00159198ebc140f (diff)
downloadlite-xl-plugins-93bf73faead3573744b3e07aea999ab106777870.tar.gz
lite-xl-plugins-93bf73faead3573744b3e07aea999ab106777870.zip
settings: dont make toolbarview a requirement
Diffstat (limited to 'plugins')
-rw-r--r--plugins/settings.lua22
1 files changed, 12 insertions, 10 deletions
diff --git a/plugins/settings.lua b/plugins/settings.lua
index 2032ddd..2114a36 100644
--- a/plugins/settings.lua
+++ b/plugins/settings.lua
@@ -18,7 +18,6 @@ local ListBox = require "widget.listbox"
local FoldingBook = require "widget.foldingbook"
local FontsList = require "widget.fontslist"
local ItemsList = require "widget.itemslist"
-local ToolbarView = require "plugins.toolbarview"
local KeybindingDialog = require "widget.keybinddialog"
local settings = {}
@@ -1716,15 +1715,18 @@ keymap.add {
--------------------------------------------------------------------------------
-- Overwrite toolbar preferences command to open the settings gui
--------------------------------------------------------------------------------
-local toolbarview_on_mouse_moved = ToolbarView.on_mouse_moved
-function ToolbarView:on_mouse_moved(px, py, ...)
- toolbarview_on_mouse_moved(self, px, py, ...)
- if
- self.hovered_item
- and
- self.hovered_item.command == "core:open-user-module"
- then
- self.hovered_item.command = "ui:settings"
+if config.plugins.toolbarview ~= false then
+ local ToolbarView = require "plugins.toolbarview"
+ local toolbarview_on_mouse_moved = ToolbarView.on_mouse_moved
+ function ToolbarView:on_mouse_moved(px, py, ...)
+ toolbarview_on_mouse_moved(self, px, py, ...)
+ if
+ self.hovered_item
+ and
+ self.hovered_item.command == "core:open-user-module"
+ then
+ self.hovered_item.command = "ui:settings"
+ end
end
end