From owner-svn-src-head@freebsd.org Sat Mar 3 18:25:51 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 75F03F2FBBF; Sat, 3 Mar 2018 18:25:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 1E4F66EDD8; Sat, 3 Mar 2018 18:25:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 17C911E2E; Sat, 3 Mar 2018 18:25:51 +0000 (UTC) (envelope-from kevans@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id w23IPoVo071791; Sat, 3 Mar 2018 18:25:50 GMT (envelope-from kevans@FreeBSD.org) Received: (from kevans@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id w23IPoFv071790; Sat, 3 Mar 2018 18:25:50 GMT (envelope-from kevans@FreeBSD.org) Message-Id: <201803031825.w23IPoFv071790@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: kevans set sender to kevans@FreeBSD.org using -f From: Kyle Evans Date: Sat, 3 Mar 2018 18:25:50 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r330346 - head/stand/lua X-SVN-Group: head X-SVN-Commit-Author: kevans X-SVN-Commit-Paths: head/stand/lua X-SVN-Commit-Revision: 330346 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Mar 2018 18:25:51 -0000 Author: kevans Date: Sat Mar 3 18:25:50 2018 New Revision: 330346 URL: https://svnweb.freebsd.org/changeset/base/330346 Log: lualoader: Shift menu+brand even for logo=none with customized pos Modified: head/stand/lua/drawer.lua Modified: head/stand/lua/drawer.lua ============================================================================== --- head/stand/lua/drawer.lua Sat Mar 3 18:13:14 2018 (r330345) +++ head/stand/lua/drawer.lua Sat Mar 3 18:25:50 2018 (r330346) @@ -43,7 +43,6 @@ local fbsd_logo_v local orb_color local orb local none -local none_shifted = false local function menuEntryName(drawing_menu, entry) local name_handler = drawer.menu_name_handlers[entry.entry_type] @@ -57,15 +56,6 @@ local function menuEntryName(drawing_menu, entry) return entry.name end -local function shiftBrandText(shift) - drawer.brand_position.x = drawer.brand_position.x + shift.x - drawer.brand_position.y = drawer.brand_position.y + shift.y - drawer.menu_position.x = drawer.menu_position.x + shift.x - drawer.menu_position.y = drawer.menu_position.y + shift.y - drawer.box_pos_dim.x = drawer.box_pos_dim.x + shift.x - drawer.box_pos_dim.y = drawer.box_pos_dim.y + shift.y -end - fbsd_logo = { " ______ ____ _____ _____ ", " | ____| | _ \\ / ____| __ \\ ", @@ -208,6 +198,8 @@ drawer.brand_position = {x = 2, y = 1} drawer.logo_position = {x = 46, y = 4} drawer.menu_position = {x = 5, y = 10} drawer.frame_size = {w = 42, h = 13} +drawer.default_shift = {x = 0, y = 0} +drawer.shift = drawer.default_shift drawer.branddefs = { -- Indexed by valid values for loader_brand in loader.conf(5). Valid @@ -299,6 +291,9 @@ function drawer.drawmenu(menudef) local x = drawer.menu_position.x local y = drawer.menu_position.y + x = x + drawer.shift.x + y = y + drawer.shift.y + -- print the menu and build the alias table local alias_table = {} local entry_num = 0 @@ -358,6 +353,9 @@ function drawer.drawbox() local tr = framespec.top_right local br = framespec.bottom_right + x = x + drawer.shift.x + y = y + drawer.shift.y + screen.setcursor(x, y); printc(tl) screen.setcursor(x, y + h); printc(bl) screen.setcursor(x + w, y); printc(tr) @@ -419,6 +417,9 @@ function drawer.drawbrand() if graphic == nil then graphic = fbsd_logo end + + x = x + drawer.shift.x + y = y + drawer.shift.y drawer.draw(x, y, graphic) end @@ -434,13 +435,7 @@ function drawer.drawlogo() -- Lookup local logodef = drawer.logodefs[logo] - if logodef ~= nil and logodef.graphic == none then - -- centre brand and text if no logo - if not none_shifted then - shiftBrandText(logodef.shift) - none_shifted = true - end - elseif logodef == nil or logodef.graphic == nil or + if logodef == nil or logodef.graphic == nil or (not colored and logodef.requires_color) then -- Choose a sensible default if colored then @@ -449,10 +444,21 @@ function drawer.drawlogo() logodef = drawer.logodefs["orbbw"] end end - if logodef.shift ~= nil then + + if logodef ~= nil and logodef.graphic == none then + drawer.shift = logodef.shift + else + drawer.shift = drawer.default_shift + end + + x = x + drawer.shift.x + y = y + drawer.shift.y + + if logdef ~= nil and logodef.shift ~= nil then x = x + logodef.shift.x y = y + logodef.shift.y end + drawer.draw(x, y, logodef.graphic) end