mininmenu fix -- tablineR will always be used on far right, not 'just right of select...
authorskeezix <skeezix@flotsam-vm.(none)>
Tue, 23 Mar 2010 18:05:38 +0000 (14:05 -0400)
committerskeezix <skeezix@flotsam-vm.(none)>
Tue, 23 Mar 2010 18:05:38 +0000 (14:05 -0400)
minimenu change -- conf option to enable/disable the All tab

deployment/etc/pandora/conf/mmenu.conf
minimenu/mmenu.c
minimenu/mmenu.conf
minimenu/mmui.c

index f15336b..4d0fc58 100644 (file)
@@ -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.
index dec0d8b..23dfeb8 100644 (file)
@@ -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 ) ) {
index 6ca6ca6..9a2dc00 100644 (file)
@@ -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.
index d0d3f78..1e23d30 100644 (file)
@@ -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;