From: skeezix Date: Wed, 2 Feb 2011 15:52:40 +0000 (-0500) Subject: mmenu fixes -- ensuring tab visibility when going to subcat-folder and back up to... X-Git-Tag: sz_beta3~91 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a9b6c61a8632c8f43947303bf0787598f50ee014;p=pandora-libraries.git mmenu fixes -- ensuring tab visibility when going to subcat-folder and back up to far-tab-scrolled parent tab --- diff --git a/minimenu/mmui.c b/minimenu/mmui.c index 94d2e9b..3602711 100644 --- a/minimenu/mmui.c +++ b/minimenu/mmui.c @@ -1431,7 +1431,7 @@ void ui_process_input ( pnd_dbusnotify_handle dbh, pnd_notify_handle nh ) { //fprintf ( stderr, "sel %s next %s\n", ui_selected -> ref -> title_en, ui_selected -> next -> ref -> title_en ); // are we already matching the same char? and next item is also same char? - if ( app && ui_selected && + if ( app && ui_selected && ui_selected -> next && ui_selected -> ref -> title_en && ui_selected -> next -> ref -> title_en && toupper ( ui_selected -> ref -> title_en [ 0 ] ) == toupper ( ui_selected -> next -> ref -> title_en [ 0 ] ) && toupper ( ui_selected -> ref -> title_en [ 0 ] ) == toupper ( event.key.keysym.sym ) @@ -1721,11 +1721,19 @@ void ui_push_backup ( void ) { // set to first cat! ui_category = 0; + // republish cats .. shoudl just be the one category_publish ( CFNORMAL, NULL ); if ( pcatname ) { ui_category = category_index ( pcatname ); + + // ensure tab visible? + unsigned int tab_width = pnd_conf_get_as_int ( g_conf, "tabs.tab_width" ); + if ( ui_category > ui_catshift + ( ui_display_context.screen_width / tab_width ) - 1 ) { + ui_catshift = ui_category - ( ui_display_context.screen_width / tab_width ) + 1; + } + } } // dir or subcat? @@ -1762,6 +1770,8 @@ void ui_push_exec ( void ) { // set to first cat! ui_category = 0; + ui_catshift = 0; + // republish cats .. shoudl just be the one category_publish ( CFBYNAME, ui_selected -> ref -> object_path );