1local res = {
2	{
3		name = "style",
4		label = "Style",
5		description = "Set the drawing method for windowed UI elements (on-creation)",
6		set = {"soft", "textured", "none"},
7		kind = "value",
8		initial = function()
9			return gconfig_get("shadow_style");
10		end,
11		handler = function(ctx, val)
12			gconfig_set("shadow_style", val);
13		end
14	},
15	{
16		name = "focus",
17		label = "Focus Weight",
18		description = "Set the shadow opacity when its owner is in focus",
19		kind = "value",
20		initial = function()
21			return tostring(gconfig_get("shadow_focus"));
22		end,
23		validator = gen_valid_num(0, 1),
24		handler = function(ctx, val)
25			gconfig_set("shadow_focus", tonumber(val));
26		end
27	},
28	{
29		name = "defocus",
30		label = "Defocus Weight",
31		description = "Set the shadow opacity when its owner is not in focus",
32		kind = "value",
33		initial = function()
34			return tostring(gconfig_get("shadow_defocus"));
35		end,
36		validator = gen_valid_num(0, 1),
37		handler = function(ctx, val)
38			gconfig_set("shadow_defocus", tonumber(val));
39		end
40	},
41	{
42		name = "offset",
43		label = "Offset",
44		description = "Set the shadow region offset",
45		kind = "value",
46		initial = function()
47			return string.format("%.2d %.2d %.2d %.2d",
48				gconfig_get("shadow_t"), gconfig_get("shadow_l"),
49				gconfig_get("shadow_d"), gconfig_get("shadow_r")
50			);
51		end,
52		hint = "(t l d r) px (w + l|r, h + t|d)",
53		validator = suppl_valid_typestr("ffff", 0.0, 100.0, 0.0),
54		handler = function(ctx, val)
55			local elem = string.split(val, " ");
56			if (#elem ~= 4) then
57				return;
58			end
59			gconfig_set("shadow_t", math.floor(tonumber(elem[1])));
60			gconfig_set("shadow_l", math.floor(tonumber(elem[2])));
61			gconfig_set("shadow_d", math.floor(tonumber(elem[3])));
62			gconfig_set("shadow_r", math.floor(tonumber(elem[4])));
63		end
64	},
65	{
66		name = "shader",
67		label = "Shader",
68		kind = "action",
69		submenu = true,
70		description = "Shader UI settings",
71		alias = "/global/settings/visual/shaders/ui/dropshadow"
72	},
73	{
74		name = "color",
75		label = "Color",
76		kind = "value",
77		description = "Set the shadow base color"
78	},
79};
80
81suppl_append_color_menu(
82	gconfig_get("shadow_color"), res[#res],
83	function(fmt, r, g, b)
84		gconfig_set("shadow_color", {r * 0.003921, g * 0.003921, b * 0.003921});
85	end);
86
87return res;
88