aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorjgmdev <jgmdev@gmail.com>2022-03-11 05:16:44 -0400
committerjgmdev <jgmdev@gmail.com>2022-05-22 13:16:10 -0400
commit2d3b785cd8bf7398cd6c72cfa6d35c34a3e9e396 (patch)
treeb4e2da35a607e4030f51923146bb8cfa7af9fb28 /plugins
parent5101cc11bd9be38b2e35b939853d1c97d2e1ef12 (diff)
downloadlite-xl-plugins-2d3b785cd8bf7398cd6c72cfa6d35c34a3e9e396.tar.gz
lite-xl-plugins-2d3b785cd8bf7398cd6c72cfa6d35c34a3e9e396.zip
opacity: added some notifications
Diffstat (limited to 'plugins')
-rw-r--r--plugins/opacity.lua14
1 files changed, 12 insertions, 2 deletions
diff --git a/plugins/opacity.lua b/plugins/opacity.lua
index be09bc4..f3a9d81 100644
--- a/plugins/opacity.lua
+++ b/plugins/opacity.lua
@@ -1,4 +1,5 @@
-- mod-version:3 --lite-xl 2.1
+local core = require "core"
local common = require "core.common"
local command = require "core.command"
local keymap = require "core.keymap"
@@ -11,7 +12,7 @@ local default_opacity = 1
local current_opacity = default_opacity
local function set_opacity(opacity)
- if not opacity_on then opacity_on = true end
+ if not opacity_on then return end
current_opacity = common.clamp(opacity, 0.2, 1)
system.set_window_opacity(current_opacity)
end
@@ -30,8 +31,10 @@ end
local function tog_opacity()
opacity_on = not opacity_on
if opacity_on then
+ core.log("Opacity: on")
system.set_window_opacity(current_opacity)
else
+ core.log("Opacity: off")
system.set_window_opacity(default_opacity)
end
end
@@ -53,7 +56,14 @@ command.add(nil, {
["opacity:reset" ] = function() res_opacity() end,
["opacity:decrease"] = function() dec_opacity() end,
["opacity:increase"] = function() inc_opacity() end,
- ["opacity:toggle mouse wheel use"] = function() use_mousewheel = not use_mousewheel end,
+ ["opacity:toggle mouse wheel use"] = function()
+ use_mousewheel = not use_mousewheel
+ if use_mousewheel then
+ core.log("Opacity (shift + mouse wheel): on")
+ else
+ core.log("Opacity (shift + mouse wheel): off")
+ end
+ end,
})
keymap.add {