From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web10.13477.1632618050365082604 for ; Sat, 25 Sep 2021 18:00:51 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Sun, 26 Sep 2021 09:00:48 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: "'Gao, Zhichao'" , , "'Ni, Ray'" Cc: "'Wang, Jian J'" References: <20210909072541.3069-1-zhichao.gao@intel.com> <00df01d7b027$05683ed0$1038bc70$@byosoft.com.cn> <16A756C7FFB49908.14001@groups.io> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW1BBVENIIFYyXSBNZGVNb2R1bGVQa2cvQm9vdE1hbmFnZXJNZW51QXBwOiBMaW1pdCBzdHJpbmcgZHJhd2luZyB3aXRoaW4gb25lIGxpbmU=?= Date: Sun, 26 Sep 2021 09:00:47 +0800 Message-ID: <00ca01d7b271$f11039e0$d330ada0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHprulJBcDuw4/TYb2JG/6hKk8y4AGYi2INAYFDAqwBwqJGDgHTUwI/AnT7ezarSF418A== Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Zhichao: I am OK to use "..." as the end of string. I suggest to add the comments = to explain the different behavior for BootManagerMenuApp and BootManagerUiL= ib in BZ.=20 Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: Gao, Zhichao > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B49=E6=9C=8824=E6=97=A5 = 14:16 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; Gao, Zhichao ; > gaoliming@byosoft.com.cn; Ni, Ray > =E6=8A=84=E9=80=81: Wang, Jian J > =E4=B8=BB=E9=A2=98: RE: [edk2-devel] [PATCH V2] MdeModulePkg/BootManagerM= enuApp: > Limit string drawing within one line >=20 > Hi Liming, >=20 > One more info I forgot to mention, the patch would make the long boot opt= ion > string show within one line with "..." at the end of the string. Which in= dicate > the boot description is not completed. >=20 > Thanks, > Zhichao >=20 > > -----Original Message----- > > From: devel@edk2.groups.io On Behalf Of Gao, > > Zhichao > > Sent: Thursday, September 23, 2021 11:47 AM > > To: devel@edk2.groups.io; gaoliming@byosoft.com.cn; Ni, Ray > > > > Cc: Wang, Jian J > > Subject: Re: [edk2-devel] [PATCH V2] > > MdeModulePkg/BootManagerMenuApp: Limit string drawing within one > line > > > > Hi Liming, > > > > Yes. Because the design of the BM app is not aimed to display the boot > > option over one line. And it is not using the setup browser engine. > > That would cause the difference. > > If we want to make them align, there are two options: > > 1. BM app to use the setup browser engine 2. add scroll bar logic for t= he > boot > > item > > > > Both above change is not simple and may cause new issues. It would be a > > new design other than a bug fix. > > > > Another solution is the patch V1 to limit the boot option description w= ithin > 72 > > characters. Ray pointed out it is not a good solution. > > > > BTW, I would remove the change-id in next patch. > > > > Thanks, > > Zhichao > > > > > -----Original Message----- > > > From: devel@edk2.groups.io On Behalf Of > > > gaoliming > > > Sent: Thursday, September 23, 2021 10:59 AM > > > To: devel@edk2.groups.io; Gao, Zhichao ; Ni, > > > Ray > > > Cc: Wang, Jian J > > > Subject: =E5=9B=9E=E5=A4=8D: [edk2-devel] [PATCH V2] > > > MdeModulePkg/BootManagerMenuApp: Limit string drawing within one > > line > > > > > > Zhichao: > > > With this change, the same boot option will be displayed differentl= y > > > in BootManagerApp and BootManager Page. Is it the designed behavior? > > > > > > Besides, please remove change-id from the commit message. > > > > > > Thanks > > > Liming > > > > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > > > > =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io =E4=BB=A3=E8=A1=A8 Gao, > > > Zhichao > > > > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B49=E6=9C=8822=E6= =97=A5 12:50 > > > > =E6=94=B6=E4=BB=B6=E4=BA=BA: Ni, Ray ; devel@edk2= .groups.io; Liming Gao > > > > > > > > =E6=8A=84=E9=80=81: Wang, Jian J > > > > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [PATCH V2] > > > MdeModulePkg/BootManagerMenuApp: > > > > Limit string drawing within one line > > > > > > > > Hi Liming, > > > > > > > > The solution is different with the first time we discussed on the > > > Bugzilla. Can > > > > you review if it is OK to you? > > > > > > > > Thanks, > > > > Zhichao > > > > > > > > > -----Original Message----- > > > > > From: Ni, Ray > > > > > Sent: Wednesday, September 22, 2021 11:28 AM > > > > > To: Gao, Zhichao ; devel@edk2.groups.io > > > > > Cc: Wang, Jian J ; Liming Gao > > > > > > > > > > Subject: RE: [PATCH V2] MdeModulePkg/BootManagerMenuApp: > Limit > > > > > string drawing within one line > > > > > > > > > > Reviewed-by: Ray Ni > > > > > > > > > > -----Original Message----- > > > > > From: Gao, Zhichao > > > > > Sent: Thursday, September 9, 2021 3:26 PM > > > > > To: devel@edk2.groups.io > > > > > Cc: Wang, Jian J ; Liming Gao > > > > > ; Ni, Ray > > > > > Subject: [PATCH V2] MdeModulePkg/BootManagerMenuApp: Limit > > > string > > > > > drawing within one line > > > > > > > > > > REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D3590 > > > > > > > > > > Limit the draw box always within the screen's column and row. > > > > > Limit the string drawing within one line. > > > > > > > > > > Change-Id: Ib7bd63cb07b23875a1e4f37ae80a422e1d5ed54f > > > > > Cc: Jian J Wang > > > > > Cc: Liming Gao > > > > > Cc: Ray Ni > > > > > Signed-off-by: Zhichao Gao > > > > > --- > > > > > > > > > > V2: > > > > > > > > > > Drop the change in UefiBootManagerLib in V1. > > > > > > > > > > Add the limitation in BootManagerMenuApp instead. > > > > > > > > > > > > > > > .../BootManagerMenuApp/BootManagerMenu.c | 72 > > > > > ++++++++++++++++++- > > > > > 1 file changed, 69 insertions(+), 3 deletions(-) > > > > > > > > > > diff --git > > > > > > > > > > a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu. > > > > > c > > > > > > > > > > b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu. > > > > > c > > > > > index 9e729074ec..d4bdeba073 100644 > > > > > --- > > > > > > > > > > a/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu. > > > > > c > > > > > +++ > > > > > > > > > > b/MdeModulePkg/Application/BootManagerMenuApp/BootManagerMenu. > > > > > c > > > > > @@ -1,7 +1,7 @@ > > > > > /** @file > > > > > > > > > > The application to show the Boot Manager Menu. > > > > > > > > > > > > > > > > > > > > -Copyright (c) 2011 - 2018, Intel Corporation. All rights > > > > > reserved.
> > > > > > > > > > +Copyright (c) 2011 - 2021, Intel Corporation. All rights > > > > > +reserved.
> > > > > > > > > > SPDX-License-Identifier: BSD-2-Clause-Patent > > > > > > > > > > > > > > > > > > > > **/ > > > > > > > > > > @@ -45,9 +45,56 @@ PrintStringAt ( > > > > > IN CHAR16 *String > > > > > > > > > > ) > > > > > > > > > > { > > > > > > > > > > + UINTN ScreenWidth; > > > > > > > > > > + UINTN ScreenRows; > > > > > > > > > > + CHAR16 *TurncateString; > > > > > > > > > > + EFI_STATUS Status; > > > > > > > > > > + UINTN ShowingLength; > > > > > > > > > > > > > > > > > > > > gST->ConOut->SetCursorPosition (gST->ConOut, Column, Row); > > > > > > > > > > - return Print (L"%s", String); > > > > > > > > > > + > > > > > > > > > > + gST->ConOut->QueryMode ( > > > > > > > > > > + gST->ConOut, > > > > > > > > > > + gST->ConOut->Mode->Mode, > > > > > > > > > > + &ScreenWidth, > > > > > > > > > > + &ScreenRows > > > > > > > > > > + ); > > > > > > > > > > + > > > > > > > > > > + if (Column > (ScreenWidth - 1) || Row > (ScreenRows - 1)) { > > > > > > > > > > + return 0; > > > > > > > > > > + } > > > > > > > > > > + > > > > > > > > > > + if ((StrLen (String) + Column) > (ScreenWidth - 1)) { > > > > > > > > > > + // > > > > > > > > > > + // | - ScreenWidth - | > > > > > > > > > > + // ...Column..................... > > > > > > > > > > + // TurncateString length should leave one character for draw > > > > > + box > > > and > > > > > > > > > > + // require one character for string end. > > > > > > > > > > + // > > > > > > > > > > + ShowingLength =3D ScreenWidth - Column - 1; > > > > > > > > > > + TurncateString =3D AllocatePool ((ShowingLength + 1) * sizeo= f > > > (CHAR16)); > > > > > > > > > > + > > > > > > > > > > + if (TurncateString =3D=3D NULL) { > > > > > > > > > > + return 0; > > > > > > > > > > + } > > > > > > > > > > + > > > > > > > > > > + Status =3D StrnCpyS (TurncateString, ShowingLength + 1, Stri= ng, > > > > > ShowingLength - 3); > > > > > > > > > > + > > > > > > > > > > + if (EFI_ERROR (Status)) { > > > > > > > > > > + FreePool (TurncateString); > > > > > > > > > > + return 0; > > > > > > > > > > + } > > > > > > > > > > + > > > > > > > > > > + *(TurncateString + ShowingLength - 3) =3D L'.'; > > > > > > > > > > + *(TurncateString + ShowingLength - 2) =3D L'.'; > > > > > > > > > > + *(TurncateString + ShowingLength - 1) =3D L'.'; > > > > > > > > > > + *(TurncateString + ShowingLength) =3D L'\0'; > > > > > > > > > > + ShowingLength =3D Print (L"%s", TurncateString); > > > > > > > > > > + FreePool (TurncateString); > > > > > > > > > > + return ShowingLength; > > > > > > > > > > + } else { > > > > > > > > > > + return Print (L"%s", String); > > > > > > > > > > + } > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > /** > > > > > > > > > > @@ -68,7 +115,22 @@ PrintCharAt ( > > > > > CHAR16 Character > > > > > > > > > > ) > > > > > > > > > > { > > > > > > > > > > + UINTN ScreenWidth; > > > > > > > > > > + UINTN ScreenRows; > > > > > > > > > > + > > > > > > > > > > gST->ConOut->SetCursorPosition (gST->ConOut, Column, Row); > > > > > > > > > > + > > > > > > > > > > + gST->ConOut->QueryMode ( > > > > > > > > > > + gST->ConOut, > > > > > > > > > > + gST->ConOut->Mode->Mode, > > > > > > > > > > + &ScreenWidth, > > > > > > > > > > + &ScreenRows > > > > > > > > > > + ); > > > > > > > > > > + > > > > > > > > > > + if (Column > (ScreenWidth - 1) || Row > (ScreenRows - 1)) { > > > > > > > > > > + return 0; > > > > > > > > > > + } > > > > > > > > > > + > > > > > > > > > > return Print (L"%c", Character); > > > > > > > > > > } > > > > > > > > > > > > > > > > > > > > @@ -193,7 +255,11 @@ InitializeBootMenuScreen ( > > > > > > > > > > > > > > > MaxPrintRows =3D Row - 6; > > > > > > > > > > UnSelectableItmes =3D TITLE_TOKEN_COUNT + 2 + > > > > HELP_TOKEN_COUNT + 2; > > > > > > > > > > - BootMenuData->MenuScreen.Width =3D MaxStrWidth + 8; > > > > > > > > > > + if (MaxStrWidth + 8 > Column) { > > > > > > > > > > + BootMenuData->MenuScreen.Width =3D Column; > > > > > > > > > > + } else { > > > > > > > > > > + BootMenuData->MenuScreen.Width =3D MaxStrWidth + 8; > > > > > > > > > > + } > > > > > > > > > > if (BootMenuData->ItemCount + UnSelectableItmes > > MaxPrintRows) > > > > > { > > > > > > > > > > BootMenuData->MenuScreen.Height =3D MaxPrintRows; > > > > > > > > > > BootMenuData->ScrollBarControl.HasScrollBar =3D TRUE; > > > > > > > > > > -- > > > > > 2.31.1.windows.1 > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > >=20 > >