aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--manifest.json6
-rw-r--r--plugins/settings.lua14
2 files changed, 16 insertions, 4 deletions
diff --git a/manifest.json b/manifest.json
index e919107..86bce40 100644
--- a/manifest.json
+++ b/manifest.json
@@ -1060,7 +1060,7 @@
},
{
"description": "Provides a GUI to manage core and plugin settings, bindings and select color theme *([video](https://user-images.githubusercontent.com/1702572/169743674-ececae24-f6b7-4ff2-bfa2-c4762cd327d9.mp4))*. (depends on [`widget`](https://github.com/lite-xl/lite-xl-widgets))",
- "version": "0.4",
+ "version": "0.5",
"path": "plugins/settings.lua",
"id": "settings",
"mod_version": "3"
@@ -1212,8 +1212,8 @@
},
{
"description": "Plugin library that provides a set of re-usable components to more easily write UI elements for your plugins",
- "version": "0.1",
- "remote": "https://github.com/lite-xl/lite-xl-widgets:a632bfdf7c66bacc272fe2c962621cd9860058e1",
+ "version": "0.2",
+ "remote": "https://github.com/lite-xl/lite-xl-widgets:46ed39168cea8db3f792c0346dd37c74141cfba4",
"mod_version": "3",
"id": "widget"
},
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