|
|
|
@ -1820,7 +1820,7 @@ VOID HelpRefit(VOID)
|
|
|
|
|
[2] checkbox
|
|
|
|
|
[3] checkbox_checked
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#if !USE_XTHEME
|
|
|
|
|
VOID InitSelection(VOID)
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
@ -1971,7 +1971,7 @@ VOID InitSelection(VOID)
|
|
|
|
|
}
|
|
|
|
|
// DBG("selections inited\n");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
//
|
|
|
|
|
// Scrolling functions
|
|
|
|
|
//
|
|
|
|
@ -3274,12 +3274,25 @@ VOID DrawBCSText(IN CONST CHAR16 *Text, IN INTN XPos, IN INTN YPos, IN UINT8 XAl
|
|
|
|
|
StrnCatS(BCSText, MaxTextLen + 1, L"..", EllipsisLen);
|
|
|
|
|
// redundant, used for safety measures
|
|
|
|
|
BCSText[MaxTextLen] = '\0';
|
|
|
|
|
|
|
|
|
|
#if USE_XTHEME
|
|
|
|
|
XStringW BCSTextX;
|
|
|
|
|
BCSTextX.takeValueFrom(BCSText);
|
|
|
|
|
DrawTextXY(BCSTextX, XPos, YPos, XAlign);
|
|
|
|
|
#else
|
|
|
|
|
DrawTextXY(BCSText, XPos, YPos, XAlign);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
FreePool(BCSText);
|
|
|
|
|
} else {
|
|
|
|
|
// draw full text
|
|
|
|
|
#if USE_XTHEME
|
|
|
|
|
XStringW TextX;
|
|
|
|
|
TextX.takeValueFrom(Text);
|
|
|
|
|
DrawTextXY(TextX, XPos, YPos, XAlign);
|
|
|
|
|
#else
|
|
|
|
|
DrawTextXY(Text, XPos, YPos, XAlign);
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -3400,7 +3413,7 @@ VOID FreeScrollBar(VOID)
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if !USE_XTHEME
|
|
|
|
|
VOID InitBar(VOID)
|
|
|
|
|
{
|
|
|
|
|
if (ThemeDir) {
|
|
|
|
@ -3486,6 +3499,7 @@ VOID InitBar(VOID)
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
VOID SetBar(INTN PosX, INTN UpPosY, INTN DownPosY, IN SCROLL_STATE *State)
|
|
|
|
|
{
|
|
|
|
@ -3641,7 +3655,7 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
|
|
|
|
|
InitAnime();
|
|
|
|
|
SwitchToGraphicsAndClear();
|
|
|
|
|
|
|
|
|
|
EntriesPosY = ((UGAHeight - (int)(LAYOUT_TOTAL_HEIGHT * ThemeX.Scale)) >> 1) + (int)(LayoutBannerOffset * ThemeX.Scale) + (TextHeight << 1);
|
|
|
|
|
EntriesPosY = ((UGAHeight - (int)(LAYOUT_TOTAL_HEIGHT * ThemeX.Scale)) >> 1) + (int)(ThemeX.LayoutBannerOffset * ThemeX.Scale) + (TextHeight << 1);
|
|
|
|
|
|
|
|
|
|
VisibleHeight = ((UGAHeight - EntriesPosY) / TextHeight) - InfoLines.size() - 2;/* - GlobalConfig.PruneScrollRows; */
|
|
|
|
|
//DBG("MENU_FUNCTION_INIT 1 EntriesPosY=%d VisibleHeight=%d\n", EntriesPosY, VisibleHeight);
|
|
|
|
@ -3663,7 +3677,7 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
|
|
|
|
|
// determine width of the menu - not working
|
|
|
|
|
//MenuWidth = 80; // minimum
|
|
|
|
|
MenuWidth = (int)(LAYOUT_TEXT_WIDTH * ThemeX.Scale); //500
|
|
|
|
|
DrawMenuText(NULL, 0, 0, 0, 0);
|
|
|
|
|
// DrawMenuText(NULL, 0, 0, 0, 0);
|
|
|
|
|
|
|
|
|
|
if (!TitleImage.isEmpty()) {
|
|
|
|
|
if (MenuWidth > (INTN)(UGAWidth - (int)(TITLEICON_SPACING * ThemeX.Scale) - TitleImage.GetWidth())) {
|
|
|
|
@ -3681,7 +3695,7 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
|
|
|
|
|
// initial painting
|
|
|
|
|
egMeasureText(Title.data(), &ItemWidth, NULL);
|
|
|
|
|
if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_MENU_TITLE)) {
|
|
|
|
|
DrawTextXY(Title.data(), (UGAWidth >> 1), EntriesPosY - TextHeight * 2, X_IS_CENTER);
|
|
|
|
|
DrawTextXY(Title, (UGAWidth >> 1), EntriesPosY - TextHeight * 2, X_IS_CENTER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (!TitleImage.isEmpty()) {
|
|
|
|
@ -3700,14 +3714,14 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (InfoLines.size() > 0) {
|
|
|
|
|
DrawMenuText(NULL, 0, 0, 0, 0);
|
|
|
|
|
for (i = 0; i < (INTN)InfoLines.size(); i++) {
|
|
|
|
|
// DrawMenuText(NULL, 0, 0, 0, 0);
|
|
|
|
|
for (UINTN i = 0; i < InfoLines.size(); i++) {
|
|
|
|
|
DrawMenuText(InfoLines[i], 0, EntriesPosX, EntriesPosY, 0xFFFF);
|
|
|
|
|
EntriesPosY += TextHeight;
|
|
|
|
|
}
|
|
|
|
|
EntriesPosY += TextHeight; // also add a blank line
|
|
|
|
|
}
|
|
|
|
|
InitBar();
|
|
|
|
|
ThemeX.InitBar();
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
@ -3716,7 +3730,7 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MENU_FUNCTION_PAINT_ALL:
|
|
|
|
|
DrawMenuText(NULL, 0, 0, 0, 0); //should clean every line to avoid artefacts
|
|
|
|
|
// DrawMenuText(NULL, 0, 0, 0, 0); //should clean every line to avoid artefacts
|
|
|
|
|
// DBG("PAINT_ALL: EntriesPosY=%d MaxVisible=%d\n", EntriesPosY, ScrollState.MaxVisible);
|
|
|
|
|
// DBG("DownButton.Height=%d TextHeight=%d\n", DownButton.Height, TextHeight);
|
|
|
|
|
t2 = EntriesPosY + (ScrollState.MaxVisible + 1) * TextHeight - DownButton.Height;
|
|
|
|
@ -3752,8 +3766,8 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
|
|
|
|
|
REFIT_INPUT_DIALOG* inputDialogEntry = Entry->getREFIT_INPUT_DIALOG();
|
|
|
|
|
if (inputDialogEntry->Item && inputDialogEntry->Item->ItemType == BoolValue) {
|
|
|
|
|
Entry->Place.Width = StrLen(ResultString) * ScaledWidth;
|
|
|
|
|
DrawMenuText(L" ", 0, EntriesPosX, Entry->Place.YPos, 0xFFFF);
|
|
|
|
|
DrawMenuText(ResultString, (i == ScrollState.CurrentSelection) ? (MenuWidth) : 0,
|
|
|
|
|
DrawMenuText(XStringWP(L" "), 0, EntriesPosX, Entry->Place.YPos, 0xFFFF);
|
|
|
|
|
DrawMenuText(XStringW().takeValueFrom(ResultString), (i == ScrollState.CurrentSelection) ? (MenuWidth) : 0,
|
|
|
|
|
ctrlTextX,
|
|
|
|
|
Entry->Place.YPos, 0xFFFF);
|
|
|
|
|
ThemeX.Buttons[(((REFIT_INPUT_DIALOG*)(Entry))->Item->BValue)?3:2].Draw(ctrlX, ctrlY);
|
|
|
|
@ -3767,13 +3781,13 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
|
|
|
|
|
StrCatS(ResultString, TITLE_MAX_LEN, L" ");
|
|
|
|
|
Entry->Place.Width = StrLen(ResultString) * ScaledWidth;
|
|
|
|
|
// Slice - suppose to use Row as Cursor in text
|
|
|
|
|
DrawMenuText(ResultString, (i == ScrollState.CurrentSelection) ? MenuWidth : 0,
|
|
|
|
|
DrawMenuText(XStringW().takeValueFrom(ResultString), (i == ScrollState.CurrentSelection) ? MenuWidth : 0,
|
|
|
|
|
EntriesPosX,
|
|
|
|
|
Entry->Place.YPos, TitleLen + Entry->Row);
|
|
|
|
|
}
|
|
|
|
|
} else if (Entry->getREFIT_MENU_CHECKBIT()) {
|
|
|
|
|
DrawMenuText(L" ", 0, EntriesPosX, Entry->Place.YPos, 0xFFFF); //clean the place
|
|
|
|
|
DrawMenuText(ResultString, (i == ScrollState.CurrentSelection) ? (MenuWidth) : 0,
|
|
|
|
|
DrawMenuText(XStringW().takeValueFrom(" "), 0, EntriesPosX, Entry->Place.YPos, 0xFFFF); //clean the place
|
|
|
|
|
DrawMenuText(XStringW().takeValueFrom(ResultString), (i == ScrollState.CurrentSelection) ? (MenuWidth) : 0,
|
|
|
|
|
ctrlTextX,
|
|
|
|
|
Entry->Place.YPos, 0xFFFF);
|
|
|
|
|
ThemeX.Buttons[(((REFIT_INPUT_DIALOG*)(Entry))->Item->IValue & Entry->Row)?3:2].Draw(ctrlX, ctrlY);
|
|
|
|
@ -3789,7 +3803,7 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
|
|
|
|
|
OldChosenItem = OldChosenAudio;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DrawMenuText(ResultString,
|
|
|
|
|
DrawMenuText(XStringW().takeValueFrom(ResultString),
|
|
|
|
|
(i == ScrollState.CurrentSelection) ? MenuWidth : 0,
|
|
|
|
|
// clovy EntriesPosX + (TextHeight + (INTN)(TEXT_XMARGIN * GlobalConfig.Scale)),
|
|
|
|
|
ctrlTextX,
|
|
|
|
@ -3797,7 +3811,7 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
|
|
|
|
|
ThemeX.Buttons[(Entry->Row == OldChosenItem)?1:0].Draw(ctrlX, ctrlY);
|
|
|
|
|
} else {
|
|
|
|
|
//DBG("paint entry %d title=%ls\n", i, Entries[i]->Title);
|
|
|
|
|
DrawMenuText(ResultString,
|
|
|
|
|
DrawMenuText(XStringW().takeValueFrom(ResultString),
|
|
|
|
|
(i == ScrollState.CurrentSelection) ? MenuWidth : 0,
|
|
|
|
|
EntriesPosX, Entry->Place.YPos, 0xFFFF);
|
|
|
|
|
}
|
|
|
|
@ -3833,7 +3847,7 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
|
|
|
|
|
REFIT_INPUT_DIALOG* inputDialogEntry = (REFIT_INPUT_DIALOG*)EntryL;
|
|
|
|
|
if (inputDialogEntry->Item->ItemType == BoolValue) {
|
|
|
|
|
//clovy
|
|
|
|
|
DrawMenuText(ResultString, 0,
|
|
|
|
|
DrawMenuText(XStringW().takeValueFrom(ResultString), 0,
|
|
|
|
|
ctrlTextX,
|
|
|
|
|
EntryL->Place.YPos, 0xFFFF);
|
|
|
|
|
ThemeX.Buttons[(inputDialogEntry->Item->BValue)?3:2].Draw(ctrlX, EntryL->Place.YPos + PlaceCentre);
|
|
|
|
@ -3843,7 +3857,7 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
|
|
|
|
|
StrCatS(ResultString, TITLE_MAX_LEN, ((REFIT_INPUT_DIALOG*)(EntryL))->Item->SValue +
|
|
|
|
|
((REFIT_INPUT_DIALOG*)(EntryL))->Item->LineShift);
|
|
|
|
|
StrCatS(ResultString, TITLE_MAX_LEN, L" ");
|
|
|
|
|
DrawMenuText(ResultString, 0, EntriesPosX,
|
|
|
|
|
DrawMenuText(XStringW().takeValueFrom(ResultString), 0, EntriesPosX,
|
|
|
|
|
EntriesPosY + (ScrollState.LastSelection - ScrollState.FirstVisible) * TextHeight,
|
|
|
|
|
TitleLen + EntryL->Row);
|
|
|
|
|
}
|
|
|
|
@ -3860,19 +3874,19 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// clovy
|
|
|
|
|
DrawMenuText(ResultString, 0, ctrlTextX,
|
|
|
|
|
DrawMenuText(XStringW().takeValueFrom(ResultString), 0, ctrlTextX,
|
|
|
|
|
EntriesPosY + (ScrollState.LastSelection - ScrollState.FirstVisible) * TextHeight, 0xFFFF);
|
|
|
|
|
ThemeX.Buttons[(EntryL->Row == OldChosenItem)?3:2].Draw(ctrlX, EntryL->Place.YPos + PlaceCentre1);
|
|
|
|
|
} else if (EntryL->getREFIT_MENU_CHECKBIT()) {
|
|
|
|
|
// clovy
|
|
|
|
|
DrawMenuText(ResultString, 0, ctrlTextX,
|
|
|
|
|
DrawMenuText(XStringW().takeValueFrom(ResultString), 0, ctrlTextX,
|
|
|
|
|
EntryL->Place.YPos, 0xFFFF);
|
|
|
|
|
ThemeX.Buttons[(EntryL->getREFIT_MENU_CHECKBIT()->Item->IValue & EntryL->Row) ?3:2].Draw(ctrlX, EntryL->Place.YPos + PlaceCentre);
|
|
|
|
|
|
|
|
|
|
// DBG("ce:X=%d, Y=%d, ImageY=%d\n", EntriesPosX + (INTN)(TEXT_XMARGIN * GlobalConfig.Scale),
|
|
|
|
|
// EntryL->Place.YPos, EntryL->Place.YPos + PlaceCentre);
|
|
|
|
|
} else {
|
|
|
|
|
DrawMenuText(EntryL->Title, 0, EntriesPosX,
|
|
|
|
|
DrawMenuText(XStringW().takeValueFrom(EntryL->Title), 0, EntriesPosX,
|
|
|
|
|
EntriesPosY + (ScrollState.LastSelection - ScrollState.FirstVisible) * TextHeight, 0xFFFF);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -3894,7 +3908,7 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
|
|
|
|
|
if ( EntryC->getREFIT_INPUT_DIALOG() ) {
|
|
|
|
|
REFIT_INPUT_DIALOG* inputDialogEntry = (REFIT_INPUT_DIALOG*)EntryC;
|
|
|
|
|
if (inputDialogEntry->Item->ItemType == BoolValue) {
|
|
|
|
|
DrawMenuText(ResultString, MenuWidth,
|
|
|
|
|
DrawMenuText(XStringW().takeValueFrom(ResultString), MenuWidth,
|
|
|
|
|
ctrlTextX,
|
|
|
|
|
inputDialogEntry->Place.YPos, 0xFFFF);
|
|
|
|
|
ThemeX.Buttons[(inputDialogEntry->Item->BValue)?3:2].Draw(ctrlX, inputDialogEntry->Place.YPos + PlaceCentre);
|
|
|
|
@ -3902,24 +3916,24 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
|
|
|
|
|
StrCatS(ResultString, TITLE_MAX_LEN, inputDialogEntry->Item->SValue +
|
|
|
|
|
inputDialogEntry->Item->LineShift);
|
|
|
|
|
StrCatS(ResultString, TITLE_MAX_LEN, L" ");
|
|
|
|
|
DrawMenuText(ResultString, MenuWidth, EntriesPosX,
|
|
|
|
|
DrawMenuText(XStringW().takeValueFrom(ResultString), MenuWidth, EntriesPosX,
|
|
|
|
|
EntriesPosY + (ScrollState.CurrentSelection - ScrollState.FirstVisible) * TextHeight,
|
|
|
|
|
TitleLen + inputDialogEntry->Row);
|
|
|
|
|
}
|
|
|
|
|
} else if (EntryC->getREFIT_MENU_SWITCH()) {
|
|
|
|
|
StrCpyS(ResultString, TITLE_MAX_LEN, EntryC->Title);
|
|
|
|
|
DrawMenuText(ResultString, MenuWidth,
|
|
|
|
|
DrawMenuText(XStringW().takeValueFrom(ResultString), MenuWidth,
|
|
|
|
|
ctrlTextX,
|
|
|
|
|
EntriesPosY + (ScrollState.CurrentSelection - ScrollState.FirstVisible) * TextHeight,
|
|
|
|
|
0xFFFF);
|
|
|
|
|
ThemeX.Buttons[(EntryC->Row == OldChosenItem)?1:0].Draw(ctrlX, EntryC->Place.YPos + PlaceCentre1);
|
|
|
|
|
} else if (EntryC->getREFIT_MENU_CHECKBIT()) {
|
|
|
|
|
DrawMenuText(ResultString, MenuWidth,
|
|
|
|
|
DrawMenuText(XStringW().takeValueFrom(ResultString), MenuWidth,
|
|
|
|
|
ctrlTextX,
|
|
|
|
|
EntryC->Place.YPos, 0xFFFF);
|
|
|
|
|
ThemeX.Buttons[(EntryC->getREFIT_MENU_CHECKBIT()->Item->IValue & EntryC->Row)?3:2].Draw(ctrlX, EntryC->Place.YPos + PlaceCentre);
|
|
|
|
|
}else{
|
|
|
|
|
DrawMenuText(EntryC->Title, MenuWidth, EntriesPosX,
|
|
|
|
|
DrawMenuText(XStringW().takeValueFrom(EntryC->Title), MenuWidth, EntriesPosX,
|
|
|
|
|
EntriesPosY + (ScrollState.CurrentSelection - ScrollState.FirstVisible) * TextHeight,
|
|
|
|
|
0xFFFF);
|
|
|
|
|
}
|
|
|
|
@ -3934,7 +3948,7 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
|
|
|
|
|
|
|
|
|
|
case MENU_FUNCTION_PAINT_TIMEOUT: //ever be here?
|
|
|
|
|
X = (UGAWidth - StrLen(ParamText) * ScaledWidth) >> 1;
|
|
|
|
|
DrawMenuText(ParamText, 0, X, TimeoutPosY, 0xFFFF);
|
|
|
|
|
DrawMenuText(XStringW().takeValueFrom(ParamText), 0, X, TimeoutPosY, 0xFFFF);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -4508,7 +4522,9 @@ VOID REFIT_MENU_SCREEN::DrawMainMenuLabel(IN CONST CHAR16 *Text, IN INTN XPos, I
|
|
|
|
|
ThemeX.FillRectAreaOfScreen((OldX - (OldTextWidth >> 1) - (BadgeDim + 16)),
|
|
|
|
|
(OldY - ((BadgeDim - TextHeight) >> 1)), 128, 128);
|
|
|
|
|
}
|
|
|
|
|
DrawTextXY(XStringW().takeValueFrom(Text), XPos, YPos, X_IS_CENTER);
|
|
|
|
|
XStringW TextX;
|
|
|
|
|
TextX.takeValueFrom(Text);
|
|
|
|
|
DrawTextXY(TextX, XPos, YPos, X_IS_CENTER);
|
|
|
|
|
|
|
|
|
|
//show inline badge
|
|
|
|
|
if (!(ThemeX.BootCampStyle) &&
|
|
|
|
@ -4580,7 +4596,67 @@ VOID REFIT_MENU_SCREEN::CountItems()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#if USE_XTHEME
|
|
|
|
|
VOID DrawTextCorner(UINTN TextC, UINT8 Align)
|
|
|
|
|
{
|
|
|
|
|
INTN Xpos;
|
|
|
|
|
// CHAR16 *Text = NULL;
|
|
|
|
|
XStringW Text;
|
|
|
|
|
|
|
|
|
|
if (
|
|
|
|
|
// HIDEUI_ALL - included
|
|
|
|
|
((TextC == TEXT_CORNER_REVISION) && ((ThemeX.HideUIFlags & HIDEUI_FLAG_REVISION) != 0)) ||
|
|
|
|
|
((TextC == TEXT_CORNER_HELP) && ((ThemeX.HideUIFlags & HIDEUI_FLAG_HELP) != 0)) ||
|
|
|
|
|
((TextC == TEXT_CORNER_OPTIMUS) && (ThemeX.ShowOptimus == FALSE))
|
|
|
|
|
) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (TextC) {
|
|
|
|
|
case TEXT_CORNER_REVISION:
|
|
|
|
|
// Display Clover boot volume
|
|
|
|
|
if (SelfVolume->VolLabel && SelfVolume->VolLabel[0] != L'#') {
|
|
|
|
|
// Text = PoolPrint(L"%s, booted from %s", gFirmwareRevision, SelfVolume->VolLabel);
|
|
|
|
|
Text = XStringW() + gFirmwareRevision + ", booted from " + SelfVolume->VolLabel;
|
|
|
|
|
}
|
|
|
|
|
if (Text.isEmpty() ) {
|
|
|
|
|
Text = XStringW() + gFirmwareRevision + " " + SelfVolume->VolName);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case TEXT_CORNER_HELP:
|
|
|
|
|
Text = XStringW() + "F1:Help";
|
|
|
|
|
break;
|
|
|
|
|
case TEXT_CORNER_OPTIMUS:
|
|
|
|
|
if (gGraphics[0].Vendor != Intel) {
|
|
|
|
|
Text = XStringW() + "Discrete";
|
|
|
|
|
} else {
|
|
|
|
|
Text = XStringW() + "Intel";
|
|
|
|
|
}
|
|
|
|
|
// Text = (NGFX == 2)?L"Intel":L"Discrete";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
switch (Align) {
|
|
|
|
|
case X_IS_LEFT:
|
|
|
|
|
Xpos = (INTN)(TextHeight * 0.75f);
|
|
|
|
|
break;
|
|
|
|
|
case X_IS_RIGHT:
|
|
|
|
|
Xpos = UGAWidth - (INTN)(TextHeight * 0.7f);//2
|
|
|
|
|
break;
|
|
|
|
|
case X_IS_CENTER:
|
|
|
|
|
Xpos = UGAWidth >> 1;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
Text.setEmpty();
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// DBG("draw text %ls at (%d, %d)\n", Text, Xpos, UGAHeight - 5 - TextHeight),
|
|
|
|
|
// clovy DrawTextXY(Text, Xpos, UGAHeight - 5 - TextHeight, Align);
|
|
|
|
|
DrawTextXY(Text, Xpos, UGAHeight - (INTN)(TextHeight * 1.5f), Align);
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
VOID DrawTextCorner(UINTN TextC, UINT8 Align)
|
|
|
|
|
{
|
|
|
|
|
INTN Xpos;
|
|
|
|
@ -4602,7 +4678,7 @@ VOID DrawTextCorner(UINTN TextC, UINT8 Align)
|
|
|
|
|
Text = PoolPrint(L"%s, booted from %s", gFirmwareRevision, SelfVolume->VolLabel);
|
|
|
|
|
}
|
|
|
|
|
if ( !Text ) {
|
|
|
|
|
Text = PoolPrint(L"%s", gFirmwareRevision, SelfVolume->VolName);
|
|
|
|
|
Text = PoolPrint(L"%s", gFirmwareRevision, SelfVolume->VolName);
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
case TEXT_CORNER_HELP:
|
|
|
|
@ -4614,7 +4690,7 @@ VOID DrawTextCorner(UINTN TextC, UINT8 Align)
|
|
|
|
|
} else {
|
|
|
|
|
Text = PoolPrint(L"Intel");
|
|
|
|
|
}
|
|
|
|
|
// Text = (NGFX == 2)?L"Intel":L"Discrete";
|
|
|
|
|
// Text = (NGFX == 2)?L"Intel":L"Discrete";
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
return;
|
|
|
|
@ -4631,34 +4707,31 @@ VOID DrawTextCorner(UINTN TextC, UINT8 Align)
|
|
|
|
|
Xpos = UGAWidth >> 1;
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
if ( Text ) FreePool(Text);
|
|
|
|
|
if ( Text ) FreePool(Text);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
// DBG("draw text %ls at (%d, %d)\n", Text, Xpos, UGAHeight - 5 - TextHeight),
|
|
|
|
|
// clovy DrawTextXY(Text, Xpos, UGAHeight - 5 - TextHeight, Align);
|
|
|
|
|
// clovy DrawTextXY(Text, Xpos, UGAHeight - 5 - TextHeight, Align);
|
|
|
|
|
DrawTextXY(Text, Xpos, UGAHeight - (INTN)(TextHeight * 1.5f), Align);
|
|
|
|
|
if ( Text ) FreePool(Text);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#if USE_XTHEME
|
|
|
|
|
VOID REFIT_MENU_SCREEN::MainMenuVerticalStyle(IN UINTN Function, IN CONST CHAR16 *ParamText)
|
|
|
|
|
{
|
|
|
|
|
INTN i;
|
|
|
|
|
INTN row0PosYRunning;
|
|
|
|
|
INTN VisibleHeight = 0; //assume vertical layout
|
|
|
|
|
INTN MessageHeight = 20;
|
|
|
|
|
#if USE_XTHEME
|
|
|
|
|
|
|
|
|
|
if (ThemeX.TypeSVG && textFace[1].valid) {
|
|
|
|
|
MessageHeight = (INTN)(textFace[1].size * RowHeightFromTextHeight * ThemeX.Scale);
|
|
|
|
|
} else {
|
|
|
|
|
MessageHeight = (INTN)(TextHeight * RowHeightFromTextHeight * ThemeX.Scale);
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
if (GlobalConfig.TypeSVG && textFace[1].valid) {
|
|
|
|
|
MessageHeight = (INTN)(textFace[1].size * RowHeightFromTextHeight * GlobalConfig.Scale);
|
|
|
|
|
} else {
|
|
|
|
|
MessageHeight = (INTN)(TextHeight * RowHeightFromTextHeight * GlobalConfig.Scale);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
switch (Function) {
|
|
|
|
|
|
|
|
|
@ -4668,6 +4741,156 @@ VOID REFIT_MENU_SCREEN::MainMenuVerticalStyle(IN UINTN Function, IN CONST CHAR16
|
|
|
|
|
SwitchToGraphicsAndClear();
|
|
|
|
|
//BltClearScreen(FALSE);
|
|
|
|
|
//adjustable by theme.plist?
|
|
|
|
|
EntriesPosY = (int)(LAYOUT_Y_EDGE * ThemeX.Scale);
|
|
|
|
|
EntriesGap = (int)(ThemeX.TileYSpace * ThemeX.Scale);
|
|
|
|
|
EntriesWidth = ThemeX.MainEntriesSize + (int)(16 * ThemeX.Scale);
|
|
|
|
|
EntriesHeight = ThemeX.MainEntriesSize + (int)(16 * ThemeX.Scale);
|
|
|
|
|
//
|
|
|
|
|
VisibleHeight = (UGAHeight - EntriesPosY - (int)(LAYOUT_Y_EDGE * ThemeX.Scale) + EntriesGap) / (EntriesHeight + EntriesGap);
|
|
|
|
|
EntriesPosX = UGAWidth - EntriesWidth - (int)((BAR_WIDTH + LAYOUT_X_EDGE) * ThemeX.Scale);
|
|
|
|
|
TimeoutPosY = UGAHeight - (int)(LAYOUT_Y_EDGE * ThemeX.Scale) - MessageHeight * 2; //optimus + timeout texts
|
|
|
|
|
|
|
|
|
|
CountItems();
|
|
|
|
|
InitScroll(row0Count, Entries.size(), VisibleHeight, 0);
|
|
|
|
|
row0PosX = EntriesPosX;
|
|
|
|
|
row0PosY = EntriesPosY;
|
|
|
|
|
row1PosX = (UGAWidth + EntriesGap - (ThemeX.row1TileSize + (int)(TILE1_XSPACING * ThemeX.Scale)) * row1Count) >> 1;
|
|
|
|
|
textPosY = TimeoutPosY - (int)(ThemeX.TileYSpace * ThemeX.Scale) - MessageHeight; //message text
|
|
|
|
|
row1PosY = textPosY - ThemeX.row1TileSize - (int)(ThemeX.TileYSpace * ThemeX.Scale) - ThemeX.LayoutTextOffset;
|
|
|
|
|
if (!itemPosX) {
|
|
|
|
|
itemPosX = (__typeof__(itemPosX))AllocatePool(sizeof(UINT64) * Entries.size());
|
|
|
|
|
itemPosY = (__typeof__(itemPosY))AllocatePool(sizeof(UINT64) * Entries.size());
|
|
|
|
|
}
|
|
|
|
|
row0PosYRunning = row0PosY;
|
|
|
|
|
row1PosXRunning = row1PosX;
|
|
|
|
|
|
|
|
|
|
// DBG("EntryCount =%d\n", Entries.size());
|
|
|
|
|
for (i = 0; i < (INTN)Entries.size(); i++) {
|
|
|
|
|
if (Entries[i].Row == 0) {
|
|
|
|
|
itemPosX[i] = row0PosX;
|
|
|
|
|
itemPosY[i] = row0PosYRunning;
|
|
|
|
|
row0PosYRunning += EntriesHeight + EntriesGap;
|
|
|
|
|
} else {
|
|
|
|
|
itemPosX[i] = row1PosXRunning;
|
|
|
|
|
itemPosY[i] = row1PosY;
|
|
|
|
|
row1PosXRunning += ThemeX.row1TileSize + (int)(ThemeX.TileXSpace * ThemeX.Scale);
|
|
|
|
|
// DBG("next item in row1 at x=%d\n", row1PosXRunning);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
// initial painting
|
|
|
|
|
ThemeX.InitSelection();
|
|
|
|
|
|
|
|
|
|
// Update FilmPlace only if not set by InitAnime
|
|
|
|
|
if (FilmPlace.Width == 0 || FilmPlace.Height == 0) {
|
|
|
|
|
// CopyMem(&FilmPlace, &BannerPlace, sizeof(BannerPlace));
|
|
|
|
|
FilmPlace = BannerPlace;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ThemeX.InitBar();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MENU_FUNCTION_CLEANUP:
|
|
|
|
|
FreePool(itemPosX);
|
|
|
|
|
itemPosX = NULL;
|
|
|
|
|
FreePool(itemPosY);
|
|
|
|
|
itemPosY = NULL;
|
|
|
|
|
HidePointer();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MENU_FUNCTION_PAINT_ALL:
|
|
|
|
|
SetBar(EntriesPosX + EntriesWidth + (int)(10 * ThemeX.Scale),
|
|
|
|
|
EntriesPosY, UGAHeight - (int)(LAYOUT_Y_EDGE * ThemeX.Scale), &ScrollState);
|
|
|
|
|
for (i = 0; i <= ScrollState.MaxIndex; i++) {
|
|
|
|
|
if (Entries[i].Row == 0) {
|
|
|
|
|
if ((i >= ScrollState.FirstVisible) && (i <= ScrollState.LastVisible)) {
|
|
|
|
|
DrawMainMenuEntry(&Entries[i], (i == ScrollState.CurrentSelection)?1:0,
|
|
|
|
|
itemPosX[i - ScrollState.FirstVisible], itemPosY[i - ScrollState.FirstVisible]);
|
|
|
|
|
}
|
|
|
|
|
} else { //row1
|
|
|
|
|
DrawMainMenuEntry(&Entries[i], (i == ScrollState.CurrentSelection)?1:0,
|
|
|
|
|
itemPosX[i], itemPosY[i]);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)){
|
|
|
|
|
DrawMainMenuLabel(Entries[ScrollState.CurrentSelection].Title,
|
|
|
|
|
(UGAWidth >> 1), textPosY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ScrollingBar(); //&ScrollState);
|
|
|
|
|
DrawTextCorner(TEXT_CORNER_REVISION, X_IS_LEFT);
|
|
|
|
|
DrawTextCorner(TEXT_CORNER_OPTIMUS, X_IS_CENTER);
|
|
|
|
|
MouseBirth();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MENU_FUNCTION_PAINT_SELECTION:
|
|
|
|
|
HidePointer();
|
|
|
|
|
if (Entries[ScrollState.LastSelection].Row == 0) {
|
|
|
|
|
DrawMainMenuEntry(&Entries[ScrollState.LastSelection], FALSE,
|
|
|
|
|
itemPosX[ScrollState.LastSelection - ScrollState.FirstVisible],
|
|
|
|
|
itemPosY[ScrollState.LastSelection - ScrollState.FirstVisible]);
|
|
|
|
|
} else {
|
|
|
|
|
DrawMainMenuEntry(&Entries[ScrollState.LastSelection], FALSE,
|
|
|
|
|
itemPosX[ScrollState.LastSelection],
|
|
|
|
|
itemPosY[ScrollState.LastSelection]);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (Entries[ScrollState.CurrentSelection].Row == 0) {
|
|
|
|
|
DrawMainMenuEntry(&Entries[ScrollState.CurrentSelection], TRUE,
|
|
|
|
|
itemPosX[ScrollState.CurrentSelection - ScrollState.FirstVisible],
|
|
|
|
|
itemPosY[ScrollState.CurrentSelection - ScrollState.FirstVisible]);
|
|
|
|
|
} else {
|
|
|
|
|
DrawMainMenuEntry(&Entries[ScrollState.CurrentSelection], TRUE,
|
|
|
|
|
itemPosX[ScrollState.CurrentSelection],
|
|
|
|
|
itemPosY[ScrollState.CurrentSelection]);
|
|
|
|
|
}
|
|
|
|
|
if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)) {
|
|
|
|
|
DrawMainMenuLabel(Entries[ScrollState.CurrentSelection].Title,
|
|
|
|
|
(UGAWidth >> 1), textPosY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
ScrollingBar(); //&ScrollState);
|
|
|
|
|
DrawTextCorner(TEXT_CORNER_REVISION, X_IS_LEFT);
|
|
|
|
|
DrawTextCorner(TEXT_CORNER_OPTIMUS, X_IS_CENTER);
|
|
|
|
|
MouseBirth();
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case MENU_FUNCTION_PAINT_TIMEOUT:
|
|
|
|
|
int hi = (ThemeX.HideBadges & HDBADGES_INLINE)?3:1;
|
|
|
|
|
HidePointer();
|
|
|
|
|
if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)) {
|
|
|
|
|
ThemeX.FillRectAreaOfScreen((UGAWidth >> 1), textPosY + MessageHeight * hi,
|
|
|
|
|
OldTimeoutTextWidth, TextHeight);
|
|
|
|
|
OldTimeoutTextWidth = DrawTextXY(XStringW().takeValueFrom(ParamText), (UGAWidth >> 1), textPosY + MessageHeight * hi, X_IS_CENTER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DrawTextCorner(TEXT_CORNER_REVISION, X_IS_LEFT);
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
VOID REFIT_MENU_SCREEN::MainMenuVerticalStyle(IN UINTN Function, IN CONST CHAR16 *ParamText)
|
|
|
|
|
{
|
|
|
|
|
INTN i;
|
|
|
|
|
INTN row0PosYRunning;
|
|
|
|
|
INTN VisibleHeight = 0; //assume vertical layout
|
|
|
|
|
INTN MessageHeight = 20;
|
|
|
|
|
|
|
|
|
|
if (GlobalConfig.TypeSVG && textFace[1].valid) {
|
|
|
|
|
MessageHeight = (INTN)(textFace[1].size * RowHeightFromTextHeight * GlobalConfig.Scale);
|
|
|
|
|
} else {
|
|
|
|
|
MessageHeight = (INTN)(TextHeight * RowHeightFromTextHeight * GlobalConfig.Scale);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
switch (Function) {
|
|
|
|
|
|
|
|
|
|
case MENU_FUNCTION_INIT:
|
|
|
|
|
egGetScreenSize(&UGAWidth, &UGAHeight);
|
|
|
|
|
InitAnime();
|
|
|
|
|
SwitchToGraphicsAndClear();
|
|
|
|
|
//BltClearScreen(FALSE);
|
|
|
|
|
//adjustable by theme.plist?
|
|
|
|
|
EntriesPosY = (int)(LAYOUT_Y_EDGE * GlobalConfig.Scale);
|
|
|
|
|
EntriesGap = (int)(GlobalConfig.TileYSpace * GlobalConfig.Scale);
|
|
|
|
|
EntriesWidth = GlobalConfig.MainEntriesSize + (int)(16 * GlobalConfig.Scale);
|
|
|
|
@ -4709,7 +4932,8 @@ VOID REFIT_MENU_SCREEN::MainMenuVerticalStyle(IN UINTN Function, IN CONST CHAR16
|
|
|
|
|
|
|
|
|
|
// Update FilmPlace only if not set by InitAnime
|
|
|
|
|
if (FilmPlace.Width == 0 || FilmPlace.Height == 0) {
|
|
|
|
|
CopyMem(&FilmPlace, &BannerPlace, sizeof(BannerPlace));
|
|
|
|
|
// CopyMem(&FilmPlace, &BannerPlace, sizeof(BannerPlace));
|
|
|
|
|
FilmPlace = BannerPlace;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
InitBar();
|
|
|
|
@ -4779,19 +5003,7 @@ VOID REFIT_MENU_SCREEN::MainMenuVerticalStyle(IN UINTN Function, IN CONST CHAR16
|
|
|
|
|
DrawTextCorner(TEXT_CORNER_OPTIMUS, X_IS_CENTER);
|
|
|
|
|
MouseBirth();
|
|
|
|
|
break;
|
|
|
|
|
#if USE_XTHEME
|
|
|
|
|
case MENU_FUNCTION_PAINT_TIMEOUT:
|
|
|
|
|
i = (ThemeX.HideBadges & HDBADGES_INLINE)?3:1;
|
|
|
|
|
HidePointer();
|
|
|
|
|
if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)){
|
|
|
|
|
ThemeX.FillRectAreaOfScreen((UGAWidth >> 1), textPosY + MessageHeight * i,
|
|
|
|
|
OldTimeoutTextWidth, TextHeight);
|
|
|
|
|
OldTimeoutTextWidth = DrawTextXY(XStringW().takeValueFrom(ParamText), (UGAWidth >> 1), textPosY + MessageHeight * i, X_IS_CENTER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DrawTextCorner(TEXT_CORNER_REVISION, X_IS_LEFT);
|
|
|
|
|
break;
|
|
|
|
|
#else
|
|
|
|
|
case MENU_FUNCTION_PAINT_TIMEOUT:
|
|
|
|
|
i = (GlobalConfig.HideBadges & HDBADGES_INLINE)?3:1;
|
|
|
|
|
HidePointer();
|
|
|
|
@ -4803,9 +5015,10 @@ VOID REFIT_MENU_SCREEN::MainMenuVerticalStyle(IN UINTN Function, IN CONST CHAR16
|
|
|
|
|
|
|
|
|
|
DrawTextCorner(TEXT_CORNER_REVISION, X_IS_LEFT);
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Main screen text.
|
|
|
|
@ -5115,61 +5328,27 @@ VOID REFIT_MENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *ParamT
|
|
|
|
|
DrawMainMenuEntry(&Entries[i], (i == ScrollState.CurrentSelection)?1:0,
|
|
|
|
|
itemPosX[i - ScrollState.FirstVisible], row0PosY);
|
|
|
|
|
// draw static text for the boot options, BootCampStyle
|
|
|
|
|
#if USE_XTHEME
|
|
|
|
|
if (ThemeX.BootCampStyle && !(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)) {
|
|
|
|
|
INTN textPosX = itemPosX[i - ScrollState.FirstVisible] + (row0TileSize / 2);
|
|
|
|
|
// clear the screen
|
|
|
|
|
|
|
|
|
|
ThemeX.FillRectAreaOfScreen(textPosX, textPosY, EntriesWidth + GlobalConfig.TileXSpace,
|
|
|
|
|
MessageHeight);
|
|
|
|
|
DrawBCSText(Entries[i].Title, textPosX, textPosY, X_IS_CENTER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
if (GlobalConfig.BootCampStyle && !(GlobalConfig.HideUIFlags & HIDEUI_FLAG_LABEL)) {
|
|
|
|
|
INTN textPosX = itemPosX[i - ScrollState.FirstVisible] + (row0TileSize / 2);
|
|
|
|
|
FillRectAreaOfScreen(textPosX, textPosY, EntriesWidth + GlobalConfig.TileXSpace,
|
|
|
|
|
MessageHeight, &MenuBackgroundPixel, X_IS_CENTER);
|
|
|
|
|
|
|
|
|
|
// draw the text
|
|
|
|
|
DrawBCSText(Entries[i].Title, textPosX, textPosY, X_IS_CENTER);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
DrawMainMenuEntry(&Entries[i], (i == ScrollState.CurrentSelection)?1:0,
|
|
|
|
|
itemPosX[i], row1PosY);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#if USE_XTHEME
|
|
|
|
|
// clear the text from the second row, required by the BootCampStyle
|
|
|
|
|
if ((ThemeX.BootCampStyle) && (Entries[ScrollState.LastSelection].Row == 1)
|
|
|
|
|
&& (Entries[ScrollState.CurrentSelection].Row == 0) && !(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)) {
|
|
|
|
|
ThemeX.FillRectAreaOfScreen((UGAWidth >> 1), FunctextPosY,
|
|
|
|
|
OldTextWidth, MessageHeight);
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
// clear the text from the second row, required by the BootCampStyle
|
|
|
|
|
if ((GlobalConfig.BootCampStyle) && (Entries[ScrollState.LastSelection].Row == 1)
|
|
|
|
|
&& (Entries[ScrollState.CurrentSelection].Row == 0) && !(GlobalConfig.HideUIFlags & HIDEUI_FLAG_LABEL)) {
|
|
|
|
|
FillRectAreaOfScreen((UGAWidth >> 1), FunctextPosY,
|
|
|
|
|
// clovy OldTextWidth, TextHeight, &MenuBackgroundPixel, X_IS_CENTER);
|
|
|
|
|
// clovy
|
|
|
|
|
OldTextWidth, MessageHeight, &MenuBackgroundPixel, X_IS_CENTER);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#if USE_XTHEME
|
|
|
|
|
if ((Entries[ScrollState.LastSelection].Row == 0) && (Entries[ScrollState.CurrentSelection].Row == 1)
|
|
|
|
|
&& ThemeX.BootCampStyle && !(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)) {
|
|
|
|
|
DrawMainMenuLabel(Entries[ScrollState.CurrentSelection].Title,
|
|
|
|
|
(UGAWidth >> 1), FunctextPosY);
|
|
|
|
|
}
|
|
|
|
|
if (!(ThemeX.BootCampStyle) && !(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)) {
|
|
|
|
|
DrawMainMenuLabel(Entries[ScrollState.CurrentSelection].Title,
|
|
|
|
|
(UGAWidth >> 1), textPosY);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
#else
|
|
|
|
|
if ((Entries[ScrollState.LastSelection].Row == 0) && (Entries[ScrollState.CurrentSelection].Row == 1)
|
|
|
|
|
&& GlobalConfig.BootCampStyle && !(GlobalConfig.HideUIFlags & HIDEUI_FLAG_LABEL)) {
|
|
|
|
|
DrawMainMenuLabel(Entries[ScrollState.CurrentSelection].Title,
|
|
|
|
@ -5183,7 +5362,7 @@ VOID REFIT_MENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *ParamT
|
|
|
|
|
DrawMainMenuLabel(Entries[ScrollState.CurrentSelection].Title,
|
|
|
|
|
(UGAWidth >> 1), textPosY);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
DrawTextCorner(TEXT_CORNER_HELP, X_IS_LEFT);
|
|
|
|
|
DrawTextCorner(TEXT_CORNER_OPTIMUS, X_IS_CENTER);
|
|
|
|
|
DrawTextCorner(TEXT_CORNER_REVISION, X_IS_RIGHT);
|
|
|
|
@ -5210,17 +5389,7 @@ VOID REFIT_MENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *ParamT
|
|
|
|
|
DrawMainMenuEntry(&Entries[ScrollState.CurrentSelection], TRUE,
|
|
|
|
|
itemPosX[ScrollState.CurrentSelection], row1PosY);
|
|
|
|
|
}
|
|
|
|
|
#if USE_XTHEME
|
|
|
|
|
if ((ThemeX.BootCampStyle) && (!(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL))
|
|
|
|
|
&& Entries[ScrollState.CurrentSelection].Row == 1) {
|
|
|
|
|
DrawMainMenuLabel(Entries[ScrollState.CurrentSelection].Title,
|
|
|
|
|
(UGAWidth >> 1), FunctextPosY);
|
|
|
|
|
}
|
|
|
|
|
if ((!(ThemeX.BootCampStyle)) && (!(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL))) {
|
|
|
|
|
DrawMainMenuLabel(Entries[ScrollState.CurrentSelection].Title,
|
|
|
|
|
(UGAWidth >> 1), textPosY);
|
|
|
|
|
}
|
|
|
|
|
#else
|
|
|
|
|
|
|
|
|
|
// create dynamic text for the second row if BootCampStyle is used
|
|
|
|
|
if ((GlobalConfig.BootCampStyle) && (!(GlobalConfig.HideUIFlags & HIDEUI_FLAG_LABEL))
|
|
|
|
|
&& Entries[ScrollState.CurrentSelection].Row == 1) {
|
|
|
|
@ -5233,7 +5402,7 @@ VOID REFIT_MENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *ParamT
|
|
|
|
|
DrawMainMenuLabel(Entries[ScrollState.CurrentSelection].Title,
|
|
|
|
|
(UGAWidth >> 1), textPosY);
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
DrawTextCorner(TEXT_CORNER_HELP, X_IS_LEFT);
|
|
|
|
|
DrawTextCorner(TEXT_CORNER_OPTIMUS, X_IS_CENTER);
|
|
|
|
|
DrawTextCorner(TEXT_CORNER_REVISION, X_IS_RIGHT);
|
|
|
|
@ -5242,25 +5411,7 @@ VOID REFIT_MENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *ParamT
|
|
|
|
|
DBG("can't bear mouse at sel! Status=%s\n", strerror(Status));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#if USE_XTHEME
|
|
|
|
|
case MENU_FUNCTION_PAINT_TIMEOUT:
|
|
|
|
|
i = (ThemeX.HideBadges & HDBADGES_INLINE)?3:1;
|
|
|
|
|
HidePointer();
|
|
|
|
|
if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_LABEL)){
|
|
|
|
|
ThemeX.FillRectAreaOfScreen((UGAWidth >> 1), FunctextPosY + MessageHeight * i,
|
|
|
|
|
OldTimeoutTextWidth, MessageHeight);
|
|
|
|
|
OldTimeoutTextWidth = DrawTextXY(XStringW().takeValueFrom(ParamText), (UGAWidth >> 1), FunctextPosY + MessageHeight * i, X_IS_CENTER);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
DrawTextCorner(TEXT_CORNER_HELP, X_IS_LEFT);
|
|
|
|
|
DrawTextCorner(TEXT_CORNER_OPTIMUS, X_IS_CENTER);
|
|
|
|
|
DrawTextCorner(TEXT_CORNER_REVISION, X_IS_RIGHT);
|
|
|
|
|
Status = MouseBirth();
|
|
|
|
|
if(EFI_ERROR(Status)) {
|
|
|
|
|
DBG("can't bear mouse at timeout! Status=%s\n", strerror(Status));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#else
|
|
|
|
|
case MENU_FUNCTION_PAINT_TIMEOUT:
|
|
|
|
|
i = (GlobalConfig.HideBadges & HDBADGES_INLINE)?3:1;
|
|
|
|
|
HidePointer();
|
|
|
|
@ -5278,7 +5429,7 @@ VOID REFIT_MENU_SCREEN::MainMenuStyle(IN UINTN Function, IN CONST CHAR16 *ParamT
|
|
|
|
|
DBG("can't bear mouse at timeout! Status=%s\n", strerror(Status));
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|