From 0b6b27633164ff8b7ff226c36a95aa003d528e0e Mon Sep 17 00:00:00 2001 From: skeezix Date: Fri, 2 Apr 2010 20:52:28 -0400 Subject: [PATCH] minimenu; added special handling for leftmost tab (Sel/Unselected versions) .. so now 4 cases for tab skinners: leftmost sel/unsel, and all the others sel/unsel. If need a special case for rightmost tabs, let me know :) --- minimenu/TODO.txt | 5 ++--- minimenu/mmui.c | 27 +++++++++++++++++++++++---- minimenu/mmui.h | 2 ++ minimenu/skin/default/mmskin.conf | 6 ++++-- 4 files changed, 31 insertions(+), 9 deletions(-) diff --git a/minimenu/TODO.txt b/minimenu/TODO.txt index d36c241..e19cfdf 100644 --- a/minimenu/TODO.txt +++ b/minimenu/TODO.txt @@ -3,12 +3,11 @@ - full-replacement PXML is one option, another is - apply override to all sections that match -- by unique-id, so apply override to all sub-apps that apply? -- libpnd: appdata-dir-name? - -- BJ dpad for demo - add font and fontcolour control to conf - About screen and shoutouts // konami code? +- add check.. if bad skin reported by mmenu, have mmwrapper set it back to default? or mm itself do it? + - some ultra primtive frame draw, so the 'detail menu' and any 'sub menus' can draw their own frame rather than depand on skin frame to exist - deploy.. diff --git a/minimenu/mmui.c b/minimenu/mmui.c index 90288e8..25abb82 100644 --- a/minimenu/mmui.c +++ b/minimenu/mmui.c @@ -195,7 +195,9 @@ mm_imgcache_t g_imagecache [ IMG_TRUEMAX ] = { { IMG_DETAIL_BG, "graphics.IMG_DETAIL_BG" }, { IMG_SELECTED_ALPHAMASK, "graphics.IMG_SELECTED_ALPHAMASK" }, { IMG_TAB_SEL, "graphics.IMG_TAB_SEL" }, + { IMG_TAB_SEL_L, "graphics.IMG_TAB_SEL_L" }, { IMG_TAB_UNSEL, "graphics.IMG_TAB_UNSEL" }, + { IMG_TAB_UNSEL_L, "graphics.IMG_TAB_UNSEL_L" }, { IMG_TAB_LINE, "graphics.IMG_TAB_LINE" }, { IMG_TAB_LINEL, "graphics.IMG_TAB_LINEL" }, { IMG_TAB_LINER, "graphics.IMG_TAB_LINER" }, @@ -423,11 +425,28 @@ void ui_render ( void ) { { SDL_Surface *s; - if ( col == ui_category ) { - s = g_imagecache [ IMG_TAB_SEL ].i; + + // if this is the first (leftmost) tab, we use different artwork + // than if the other tabs (so skinner can link lines up nicely.) + if ( col == ui_catshift ) { + // leftmost tab, special case + + if ( col == ui_category ) { + s = g_imagecache [ IMG_TAB_SEL_L ].i; + } else { + s = g_imagecache [ IMG_TAB_UNSEL_L ].i; + } + } else { - s = g_imagecache [ IMG_TAB_UNSEL ].i; - } + // normal (not leftmost) tab + + if ( col == ui_category ) { + s = g_imagecache [ IMG_TAB_SEL ].i; + } else { + s = g_imagecache [ IMG_TAB_UNSEL ].i; + } + + } // first col, or not first col? // draw tab src.x = 0; diff --git a/minimenu/mmui.h b/minimenu/mmui.h index e3efc8f..4e6b2dd 100644 --- a/minimenu/mmui.h +++ b/minimenu/mmui.h @@ -17,7 +17,9 @@ typedef enum { IMG_DETAIL_BG, IMG_SELECTED_ALPHAMASK, IMG_TAB_SEL, + IMG_TAB_SEL_L, IMG_TAB_UNSEL, + IMG_TAB_UNSEL_L, IMG_TAB_LINE, IMG_TAB_LINEL, IMG_TAB_LINER, diff --git a/minimenu/skin/default/mmskin.conf b/minimenu/skin/default/mmskin.conf index d29c8be..04ad2ad 100644 --- a/minimenu/skin/default/mmskin.conf +++ b/minimenu/skin/default/mmskin.conf @@ -91,8 +91,10 @@ IMG_DETAIL_PANEL detailpane2.png IMG_DETAIL_BG detailpanebg.png IMG_SELECTED_ALPHAMASK select.png IMG_SELECTED_HILITE hilite.png -IMG_TAB_SEL tab_sel_tall.png -IMG_TAB_UNSEL tab_unsel.png +IMG_TAB_SEL tab_sel_tall.png # tab to be used, when not far left +IMG_TAB_SEL_L tab_sel_tall.png # tab to be used for far left tab, selected +IMG_TAB_UNSEL tab_unsel.png # tab to be used when not far left +IMG_TAB_UNSEL_L tab_unsel.png # tab to be used for far left tab, unselected IMG_TAB_LINE tabline.png # line under the unselected tab, but not left/right corners IMG_TAB_LINEL tablinel.png # line under unselected tab on far left IMG_TAB_LINER tabliner.png # line under unselected tab on far right -- 2.39.2