aboutsummaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorjgmdev <jgmdev@gmail.com>2023-01-12 21:50:26 -0400
committerjgmdev <jgmdev@gmail.com>2023-01-12 21:51:33 -0400
commit306fb17d9476e87c46bb926a1d42aebc9988332e (patch)
treeefd745680bd710c70b2c9eebcd6e5f1ab3977da5 /plugins
parent97509fc27cda4c2a423513a33287865fdb283cd6 (diff)
downloadlite-xl-plugins-306fb17d9476e87c46bb926a1d42aebc9988332e.tar.gz
lite-xl-plugins-306fb17d9476e87c46bb926a1d42aebc9988332e.zip
settings: added color config widget support
Diffstat (limited to 'plugins')
-rw-r--r--plugins/settings.lua14
1 files changed, 13 insertions, 1 deletions
diff --git a/plugins/settings.lua b/plugins/settings.lua
index d6c524e..d3af077 100644
--- a/plugins/settings.lua
+++ b/plugins/settings.lua
@@ -30,6 +30,7 @@ local ItemsList = require "libraries.widget.itemslist"
local KeybindingDialog = require "libraries.widget.keybinddialog"
local Fonts = require "libraries.widget.fonts"
local FilePicker = require "libraries.widget.filepicker"
+local ColorPicker = require "libraries.widget.colorpicker"
local MessageBox = require "libraries.widget.messagebox"
---@class plugins.settings
@@ -53,7 +54,8 @@ settings.type = {
BUTTON = 6,
FONT = 7,
FILE = 8,
- DIRECTORY = 9
+ DIRECTORY = 9,
+ COLOR = 10
}
---@alias settings.types
@@ -65,6 +67,8 @@ settings.type = {
---| `settings.type.BUTTON`
---| `settings.type.FONT`
---| `settings.type.FILE`
+---| `settings.type.DIRECTORY`
+---| `settings.type.COLOR`
---Represents a setting to render on a settings pane.
---@class settings.option
@@ -1261,6 +1265,14 @@ local function add_control(pane, option, plugin_name)
file.filters = option.filters or {}
widget = file
found = true
+
+ elseif option.type == settings.type.COLOR then
+ ---@type widget.label
+ Label(pane, option.label .. ":")
+ ---@type widget.colorpicker
+ local color = ColorPicker(pane, option_value)
+ widget = color
+ found = true
end
if widget and type(path) ~= "nil" then