mirror of
https://git.hardenedbsd.org/hardenedbsd/HardenedBSD.git
synced 2024-11-27 03:11:52 +01:00
lualoader: Clear up some possible naming confusion
In the original lualoader project, 'escapef' and 'escapeb' were chosen for 'escape fg' and 'escape bg'. We've carried on this naming convention, and as our use of attributes grow the likeliness of 'escapeb'/'resetb' being confused upon glance for 'escape bold'/'reset bold' increases. Fix this by renaming these four functions to {escape,reset}{fg,bg} rather than {escape,reset}{f,b} for clarity. Reported by: dteske
This commit is contained in:
parent
7961a77148
commit
8ce1744f82
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=331304
@ -58,28 +58,28 @@ end
|
||||
|
||||
color.disabled = not color.isEnabled()
|
||||
|
||||
function color.escapef(color_value)
|
||||
function color.escapefg(color_value)
|
||||
if color.disabled then
|
||||
return color_value
|
||||
end
|
||||
return core.KEYSTR_CSI .. "3" .. color_value .. "m"
|
||||
end
|
||||
|
||||
function color.resetf()
|
||||
function color.resetfg()
|
||||
if color.disabled then
|
||||
return ''
|
||||
end
|
||||
return core.KEYSTR_CSI .. "39m"
|
||||
end
|
||||
|
||||
function color.escapeb(color_value)
|
||||
function color.escapebg(color_value)
|
||||
if color.disabled then
|
||||
return color_value
|
||||
end
|
||||
return core.KEYSTR_CSI .. "4" .. color_value .. "m"
|
||||
end
|
||||
|
||||
function color.resetb()
|
||||
function color.resetbg()
|
||||
if color.disabled then
|
||||
return ''
|
||||
end
|
||||
|
@ -46,11 +46,11 @@ local return_menu_entry = {
|
||||
|
||||
local function OnOff(str, value)
|
||||
if value then
|
||||
return str .. color.escapef(color.GREEN) .. "On" ..
|
||||
color.escapef(color.WHITE)
|
||||
return str .. color.escapefg(color.GREEN) .. "On" ..
|
||||
color.escapefg(color.WHITE)
|
||||
else
|
||||
return str .. color.escapef(color.RED) .. "off" ..
|
||||
color.escapef(color.WHITE)
|
||||
return str .. color.escapefg(color.RED) .. "off" ..
|
||||
color.escapefg(color.WHITE)
|
||||
end
|
||||
end
|
||||
|
||||
@ -115,12 +115,12 @@ menu.boot_environments = {
|
||||
local bootenv_name = ""
|
||||
local name_color
|
||||
if is_default then
|
||||
name_color = color.escapef(color.GREEN)
|
||||
name_color = color.escapefg(color.GREEN)
|
||||
else
|
||||
name_color = color.escapef(color.BLUE)
|
||||
name_color = color.escapefg(color.BLUE)
|
||||
end
|
||||
bootenv_name = bootenv_name .. name_color ..
|
||||
choice .. color.resetf()
|
||||
choice .. color.resetfg()
|
||||
return color.highlight("A").."ctive: " ..
|
||||
bootenv_name .. " (" .. idx .. " of " ..
|
||||
#all_choices .. ")"
|
||||
@ -300,13 +300,13 @@ menu.welcome = {
|
||||
local kernel_name = ""
|
||||
local name_color
|
||||
if is_default then
|
||||
name_color = color.escapef(color.GREEN)
|
||||
name_color = color.escapefg(color.GREEN)
|
||||
kernel_name = "default/"
|
||||
else
|
||||
name_color = color.escapef(color.BLUE)
|
||||
name_color = color.escapefg(color.BLUE)
|
||||
end
|
||||
kernel_name = kernel_name .. name_color ..
|
||||
choice .. color.resetf()
|
||||
choice .. color.resetfg()
|
||||
return color.highlight("K") .. "ernel: " ..
|
||||
kernel_name .. " (" .. idx .. " of " ..
|
||||
#all_choices .. ")"
|
||||
|
@ -56,14 +56,14 @@ function screen.setforeground(color_value)
|
||||
if color.disabled then
|
||||
return color_value
|
||||
end
|
||||
printc(color.escapef(color_value))
|
||||
printc(color.escapefg(color_value))
|
||||
end
|
||||
|
||||
function screen.setbackground(color_value)
|
||||
if color.disabled then
|
||||
return color_value
|
||||
end
|
||||
printc(color.escapeb(color_value))
|
||||
printc(color.escapebg(color_value))
|
||||
end
|
||||
|
||||
function screen.defcolor()
|
||||
|
Loading…
Reference in New Issue
Block a user