drawer.lua (344220) | drawer.lua (352349) |
---|---|
1-- 2-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3-- 4-- Copyright (c) 2015 Pedro Souza <pedrosouza@freebsd.org> 5-- Copyright (c) 2018 Kyle Evans <kevans@FreeBSD.org> 6-- All rights reserved. 7-- 8-- Redistribution and use in source and binary forms, with or without --- 12 unchanged lines hidden (view full) --- 21-- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23-- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25-- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26-- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27-- SUCH DAMAGE. 28-- | 1-- 2-- SPDX-License-Identifier: BSD-2-Clause-FreeBSD 3-- 4-- Copyright (c) 2015 Pedro Souza <pedrosouza@freebsd.org> 5-- Copyright (c) 2018 Kyle Evans <kevans@FreeBSD.org> 6-- All rights reserved. 7-- 8-- Redistribution and use in source and binary forms, with or without --- 12 unchanged lines hidden (view full) --- 21-- FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 22-- DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS 23-- OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) 24-- HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 25-- LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY 26-- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF 27-- SUCH DAMAGE. 28-- |
29-- $FreeBSD: stable/11/stand/lua/drawer.lua 344220 2019-02-17 02:39:17Z kevans $ | 29-- $FreeBSD: stable/11/stand/lua/drawer.lua 352349 2019-09-15 02:48:15Z kevans $ |
30-- 31 32local color = require("color") 33local config = require("config") 34local core = require("core") 35local screen = require("screen") 36 37local drawer = {} --- 101 unchanged lines hidden (view full) --- 139 screen.setcursor(x, y + effective_line_num) 140 printc(menuEntryName(menudef, e)) 141 end 142 ::continue:: 143 end 144 return alias_table 145end 146 | 30-- 31 32local color = require("color") 33local config = require("config") 34local core = require("core") 35local screen = require("screen") 36 37local drawer = {} --- 101 unchanged lines hidden (view full) --- 139 screen.setcursor(x, y + effective_line_num) 140 printc(menuEntryName(menudef, e)) 141 end 142 ::continue:: 143 end 144 return alias_table 145end 146 |
147local function defaultframe() 148 if core.isSerialConsole() then 149 return "ascii" 150 end 151 return "double" 152end 153 |
|
147local function drawbox() 148 local x = menu_position.x - 3 149 local y = menu_position.y - 1 150 local w = frame_size.w 151 local h = frame_size.h 152 | 154local function drawbox() 155 local x = menu_position.x - 3 156 local y = menu_position.y - 1 157 local w = frame_size.w 158 local h = frame_size.h 159 |
153 local framestyle = loader.getenv("loader_menu_frame") or "double" | 160 local framestyle = loader.getenv("loader_menu_frame") or defaultframe() |
154 local framespec = drawer.frame_styles[framestyle] 155 -- If we don't have a framespec for the current frame style, just don't 156 -- draw a box. 157 if framespec == nil then 158 return 159 end 160 161 local hl = framespec.horizontal --- 238 unchanged lines hidden --- | 161 local framespec = drawer.frame_styles[framestyle] 162 -- If we don't have a framespec for the current frame style, just don't 163 -- draw a box. 164 if framespec == nil then 165 return 166 end 167 168 local hl = framespec.horizontal --- 238 unchanged lines hidden --- |