From 7505c1606715a5e08102a64f715e6161d4de9568 Mon Sep 17 00:00:00 2001 From: skeezix Date: Tue, 23 Mar 2010 14:05:38 -0400 Subject: [PATCH] mininmenu fix -- tablineR will always be used on far right, not 'just right of selection tab'; doh. minimenu change -- conf option to enable/disable the All tab --- deployment/etc/pandora/conf/mmenu.conf | 1 + minimenu/mmenu.c | 12 ++++++++---- minimenu/mmenu.conf | 1 + minimenu/mmui.c | 8 ++++---- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/deployment/etc/pandora/conf/mmenu.conf b/deployment/etc/pandora/conf/mmenu.conf index f15336b..4d0fc58 100644 --- a/deployment/etc/pandora/conf/mmenu.conf +++ b/deployment/etc/pandora/conf/mmenu.conf @@ -128,6 +128,7 @@ IMG_ARROW_DOWN arrowdown.png IMG_ARROW_SCROLLBAR arrowscroller.png [categories] +do_all_cat 1 # if >0, will show an All category; if 0, skip it, just your cats. # Normally for mmenu, an encountered category is just used as is. 5 cats exist, you get 5 tabs. # If map_on is >0, then category transforms will occur # @NEWCAT oldcat1:oldcat2 <- means oldcat1, if found, will map to NEWCAT. "@" is discarded. diff --git a/minimenu/mmenu.c b/minimenu/mmenu.c index dec0d8b..23dfeb8 100644 --- a/minimenu/mmenu.c +++ b/minimenu/mmenu.c @@ -242,7 +242,9 @@ int main ( int argc, char *argv[] ) { } // create all cat - category_push ( g_x11_present ? CATEGORY_ALL " (X11)" : CATEGORY_ALL " (No X11)", NULL ); + if ( pnd_conf_get_as_int_d ( g_conf, "categories.do_all_cat", 1 ) ) { + category_push ( g_x11_present ? CATEGORY_ALL " (X11)" : CATEGORY_ALL " (No X11)", NULL ); + } // set up category mappings if ( pnd_conf_get_as_int_d ( g_conf, "categories.map_on", 0 ) ) { @@ -402,9 +404,11 @@ void applications_scan ( void ) { // push to All category // we do this first, so first category is always All - if ( ! category_push ( g_x11_present ? CATEGORY_ALL " (X11)" : CATEGORY_ALL " (No X11)", iter ) ) { - pnd_log ( pndn_warning, " Couldn't categorize to All: '%s'\n", IFNULL(iter -> title_en, "No Name") ); - } + if ( pnd_conf_get_as_int_d ( g_conf, "categories.do_all_cat", 1 ) ) { + if ( ! category_push ( g_x11_present ? CATEGORY_ALL " (X11)" : CATEGORY_ALL " (No X11)", iter ) ) { + pnd_log ( pndn_warning, " Couldn't categorize to All: '%s'\n", IFNULL(iter -> title_en, "No Name") ); + } + } // all? // main categories if ( iter -> main_category && pnd_conf_get_as_int_d ( g_conf, "tabs.top_maincat", 1 ) ) { diff --git a/minimenu/mmenu.conf b/minimenu/mmenu.conf index 6ca6ca6..9a2dc00 100644 --- a/minimenu/mmenu.conf +++ b/minimenu/mmenu.conf @@ -128,6 +128,7 @@ IMG_ARROW_DOWN arrowdown.png IMG_ARROW_SCROLLBAR arrowscroller.png [categories] +do_all_cat 1 # if >0, will show an All category; if 0, skip it, just your cats. # Normally for mmenu, an encountered category is just used as is. 5 cats exist, you get 5 tabs. # If map_on is >0, then category transforms will occur # @NEWCAT oldcat1:oldcat2 <- means oldcat1, if found, will map to NEWCAT. "@" is discarded. diff --git a/minimenu/mmui.c b/minimenu/mmui.c index d0d3f78..1e23d30 100644 --- a/minimenu/mmui.c +++ b/minimenu/mmui.c @@ -361,6 +361,7 @@ void ui_render ( unsigned int render_mask ) { unsigned int text_offset_y = pnd_conf_get_as_int ( g_conf, "tabs.text_offset_y" ); unsigned int text_width = pnd_conf_get_as_int ( g_conf, "tabs.text_width" ); unsigned int maxtab = ( screen_width / tab_width ) < g_categorycount ? ( screen_width / tab_width ) + ui_catshift : g_categorycount + ui_catshift; + unsigned int maxtabspot = ( screen_width / tab_width ); // draw tabs with categories for ( col = ui_catshift; @@ -400,7 +401,7 @@ void ui_render ( unsigned int render_mask ) { } else { if ( col - ui_catshift == 0 ) { s = g_imagecache [ IMG_TAB_LINEL ].i; - } else if ( col - ui_catshift == maxtab - 1 ) { + } else if ( col - ui_catshift == maxtabspot - 1 ) { s = g_imagecache [ IMG_TAB_LINER ].i; } else { s = g_imagecache [ IMG_TAB_LINE ].i; @@ -428,13 +429,12 @@ void ui_render ( unsigned int render_mask ) { } // for // draw tab lines under where tabs would be if we had categories - maxtab = ( screen_width / tab_width ); - for ( /* foo */; col < maxtab; col++ ) { + for ( /* foo */; col < maxtabspot; col++ ) { SDL_Surface *s; if ( col - ui_catshift == 0 ) { s = g_imagecache [ IMG_TAB_LINEL ].i; - } else if ( col - ui_catshift == maxtab - 1 ) { + } else if ( col - ui_catshift == maxtabspot - 1 ) { s = g_imagecache [ IMG_TAB_LINER ].i; } else { s = g_imagecache [ IMG_TAB_LINE ].i; -- 2.39.5