1return 2{ 3 { 4 name = "thickness", 5 label = "Thickness", 6 kind = "value", 7 description = "Visible portion of the border area in tiled modes", 8 hint = function() return 9 string.format("(0..%d px)", gconfig_get("borderw")) end, 10 validator = function(val) 11 return gen_valid_num(0, gconfig_get("borderw"))(val); 12 end, 13 initial = function() return tostring(gconfig_get("bordert")); end, 14 handler = function(ctx, val) 15 local num = tonumber(val); 16 gconfig_set("bordert", tonumber(val)); 17 active_display():rebuild_border(); 18 for k,v in pairs(active_display().spaces) do 19 v:resize(); 20 end 21 end 22 }, 23 { 24 name = "thickness_float", 25 label = "Thickness (Float)", 26 kind = "value", 27 description = "Visible portion of the border area in float mode", 28 hint = function() return 29 string.format("(0..%d px)", gconfig_get("borderw_float")) end, 30 validator = function(val) 31 return gen_valid_num(0, gconfig_get("borderw_float"))(val); 32 end, 33 initial = function() return tostring(gconfig_get("bordert_float")); end, 34 handler = function(ctx, val) 35 local num = tonumber(val); 36 gconfig_set("bordert_float", tonumber(val)); 37 active_display():rebuild_border(); 38 for k,v in pairs(active_display().spaces) do 39 v:resize(); 40 end 41 end 42 }, 43 { 44 name = "area", 45 label = "Area", 46 kind = "value", 47 hint = "(0..100 px)", 48 initial = function() return tostring(gconfig_get("borderw")); end, 49 validator = gen_valid_num(0, 100), 50 description = "Set the reserved (visible+nonvisible) border area", 51 handler = function(ctx, val) 52 gconfig_set("borderw", tonumber(val)); 53 active_display():rebuild_border(); 54 for wnd in all_windows(nil, true) do 55 wnd:resize(wnd.width, wnd.height); 56 end 57 for k,v in pairs(active_display().spaces) do 58 v:resize(); 59 end 60 end 61 }, 62 { 63 name = "area_float", 64 label = "Area (Float)", 65 kind = "value", 66 hint = "(0..100 px)", 67 initial = function() return tostring(gconfig_get("borderw_float")); end, 68 validator = gen_valid_num(0, 100), 69 description = "Set the reserved (visible+nonvisible) border area", 70 handler = function(ctx, val) 71 gconfig_set("borderw_float", tonumber(val)); 72 active_display():rebuild_border(); 73 for wnd in all_windows(nil, true) do 74 wnd:resize(wnd.width, wnd.height) 75 end 76 for k,v in pairs(active_display().spaces) do 77 v:resize(); 78 end 79 end 80 }, 81 { 82 name = "color", 83 label = "Color", 84 kind = "value", 85 hint = "(r g b)[0..255]", 86 widget = "special:colorpick_r8g8b8", 87 initial = function() 88 local bc = gconfig_get("border_color"); 89 return string.format("%.0f %.0f %.0f", bc[1], bc[2], bc[3]); 90 end, 91 validator = suppl_valid_typestr("fff", 0, 255, 0), 92 description = "The color used as the active border color state", 93 handler = function(ctx, val) 94 local tbl = suppl_unpack_typestr("fff", val, 0, 255); 95 for wnd in all_windows(nil, true) do 96 image_color(wnd.border, tbl[1], tbl[2], tbl[3]); 97 end 98 gconfig_set("border_color", tbl); 99 end, 100 }, 101}; 102