X-Git-Url: https://code.delx.au/refind/blobdiff_plain/22024d99cdd226ab82566c7973c6a34a47d26c37..b04a842814ccc991ed93a52acbd7ac27768be686:/refind/menu.c diff --git a/refind/menu.c b/refind/menu.c index 63bf9fc..4fa93b1 100644 --- a/refind/menu.c +++ b/refind/menu.c @@ -34,13 +34,26 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ /* - * Modifications copyright (c) 2012 Roderick W. Smith + * Modifications copyright (c) 2012-2015 Roderick W. Smith * * Modifications distributed under the terms of the GNU General Public - * License (GPL) version 3 (GPLv3), a copy of which must be distributed - * with this source code or binaries made from it. + * License (GPL) version 3 (GPLv3), or (at your option) any later version. * */ +/* + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ #include "global.h" #include "screen.h" @@ -49,6 +62,8 @@ #include "config.h" #include "libeg.h" #include "libegint.h" +#include "line_edit.h" +#include "mystrings.h" #include "../include/refit_call_wrapper.h" #include "../include/egemb_back_selected_small.h" @@ -955,17 +970,15 @@ static VOID DrawMainMenuEntry(REFIT_MENU_ENTRY *Entry, BOOLEAN selected, UINTN X { EG_IMAGE *Background; - if (SelectionImages != NULL) { - if (selected) { - Background = egCropImage(GlobalConfig.ScreenBackground, XPos, YPos, + if (selected) { + Background = egCropImage(GlobalConfig.ScreenBackground, XPos, YPos, + SelectionImages[Entry->Row]->Width, SelectionImages[Entry->Row]->Height); + egComposeImage(Background, SelectionImages[Entry->Row], 0, 0); + BltImageCompositeBadge(Background, Entry->Image, Entry->BadgeImage, XPos, YPos); + } else { // Image not selected; copy background + egDrawImageWithTransparency(Entry->Image, Entry->BadgeImage, XPos, YPos, SelectionImages[Entry->Row]->Width, SelectionImages[Entry->Row]->Height); - egComposeImage(Background, SelectionImages[Entry->Row], 0, 0); - BltImageCompositeBadge(Background, Entry->Image, Entry->BadgeImage, XPos, YPos); - } else { // Image not selected; copy background - egDrawImageWithTransparency(Entry->Image, Entry->BadgeImage, XPos, YPos, - SelectionImages[Entry->Row]->Width, SelectionImages[Entry->Row]->Height); - } // if/else - } // if + } // if/else } // VOID DrawMainMenuEntry() static VOID PaintAll(IN REFIT_MENU_SCREEN *Screen, IN SCROLL_STATE *State, UINTN *itemPosX,