]> code.delx.au - refind/blobdiff - refind/menu.c
Misc small changes, mostly to refind-mkdefault
[refind] / refind / menu.c
index 63bf9fc6ecc0c9125475ecb5ce6f15e24314bf9a..4fa93b15d576b6ec8ebf94f7ea16cf999db3d995 100644 (file)
  * 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 <http://www.gnu.org/licenses/>.
+ */
 
 #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,