Correct wrong text size length with proportional font, and hang with SVG in some cases

This commit is contained in:
asava 2020-05-04 19:05:29 +03:00
parent ce9538bb4e
commit 4d89b2d976
2 changed files with 12 additions and 3 deletions

View File

@ -1681,7 +1681,7 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
for (INTN i = ScrollState.FirstVisible, j = 0; i <= ScrollState.LastVisible; i++, j++) {
REFIT_ABSTRACT_MENU_ENTRY *Entry = &Entries[i];
ResultString = Entry->Title; //create a copy to modify later
if (!ThemeX.TypeSVG && ResultString.length() > MenuMaxTextLen) {
if (!ThemeX.TypeSVG && !ThemeX.Proportional && ResultString.length() > MenuMaxTextLen) {
ResultString = ResultString.subString(0,MenuMaxTextLen-3) + L".."_XSW;
}
TitleLen = ResultString.length();
@ -1764,7 +1764,7 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
REFIT_ABSTRACT_MENU_ENTRY *EntryC = &Entries[ScrollState.CurrentSelection];
ResultString = EntryL->Title;
if (!ThemeX.TypeSVG && ResultString.length() > MenuMaxTextLen) {
if (!ThemeX.TypeSVG && !ThemeX.Proportional && ResultString.length() > MenuMaxTextLen) {
ResultString = ResultString.subString(0,MenuMaxTextLen-3) + L".."_XSW;
}
TitleLen = ResultString.length();
@ -1826,7 +1826,7 @@ VOID REFIT_MENU_SCREEN::GraphicsMenuStyle(IN UINTN Function, IN CONST CHAR16 *Pa
// current selection
ResultString = EntryC->Title;
if (!ThemeX.TypeSVG && ResultString.length() > MenuMaxTextLen) {
if (!ThemeX.TypeSVG && !ThemeX.Proportional && ResultString.length() > MenuMaxTextLen) {
ResultString = ResultString.subString(0,MenuMaxTextLen-3) + L".."_XSW;
}
TitleLen = ResultString.length();

View File

@ -840,6 +840,15 @@ void XTheme::InitBar()
ScrollEndImage.LoadXImage(ThemeDir, "scrollbar\\scroll_end");
UpButtonImage.LoadXImage(ThemeDir, "scrollbar\\up_button");
DownButtonImage.LoadXImage(ThemeDir, "scrollbar\\down_button");
} else {
ScrollbarBackgroundImage.setEmpty();
BarStartImage.setEmpty();
BarEndImage.setEmpty();
ScrollbarImage.setEmpty();
ScrollStartImage.setEmpty();
ScrollEndImage.setEmpty();
UpButtonImage.setEmpty();
DownButtonImage.setEmpty();
}
//some help with embedded scroll