@@ -589,10 +589,9 @@ struct ozone_handle
589589 float scroll_y ;
590590 float scroll_y_sidebar ;
591591
592+ float alpha ;
592593 float list_alpha ;
593-
594594 float messagebox_alpha ;
595-
596595 float sidebar_text_alpha ;
597596 float thumbnail_bar_position ;
598597
@@ -3518,6 +3517,8 @@ static void ozone_draw_sidebar(
35183517 if (dispctx && dispctx -> blend_begin )
35193518 dispctx -> blend_begin (userdata );
35203519
3520+ text_alpha *= ozone -> animations .alpha ;
3521+
35213522 for (i = 0 ; i < (unsigned )(ozone -> system_tab_end + 1 ); i ++ )
35223523 {
35233524 float * col = NULL ;
@@ -3527,6 +3528,8 @@ static void ozone_draw_sidebar(
35273528 if (!(col = selected ? ozone -> theme -> text_selected : ozone -> theme -> entries_icon ))
35283529 col = ozone -> pure_white ;
35293530
3531+ gfx_display_set_alpha (col , ozone -> animations .alpha );
3532+
35303533 /* Icon */
35313534 ozone_draw_icon (
35323535 p_disp ,
@@ -3657,6 +3660,8 @@ static void ozone_draw_sidebar(
36573660 if (!(col = (selected ? ozone -> theme -> text_selected : ozone -> theme -> entries_icon )))
36583661 col = ozone -> pure_white ;
36593662
3663+ gfx_display_set_alpha (col , ozone -> animations .alpha );
3664+
36603665 /* Icon */
36613666 ozone_draw_icon (
36623667 p_disp ,
@@ -3763,11 +3768,6 @@ static bool ozone_is_main_menu_playlist(void *userdata)
37633768 ozone_handle_t * ozone = (ozone_handle_t * )userdata ;
37643769 menu_entry_t entry ;
37653770
3766- if ( (ozone -> depth != 3 )
3767- || (ozone -> flags & OZONE_FLAG_IS_DB_MANAGER_LIST )
3768- || (ozone -> flags & OZONE_FLAG_IS_FILE_LIST ))
3769- return false;
3770-
37713771 MENU_ENTRY_INITIALIZE (entry );
37723772 menu_entry_get (& entry , 0 , 0 , NULL , true);
37733773 return entry .type == FILE_TYPE_RPL_ENTRY ;
@@ -4069,15 +4069,15 @@ static void ozone_sidebar_update_collapse(ozone_handle_t *ozone,
40694069 if (ozone_get_horizontal_selection_type (ozone ) == MENU_EXPLORE_TAB )
40704070 is_playlist = true;
40714071
4072- /* Playlists under "Main Menu" don't need sidebar animations */
4073- if (is_playlist && ozone -> depth > 2 )
4074- goto end ;
4072+ /* Do not animate sidebar above first depth level */
4073+ if (ozone -> depth > 1 )
4074+ allow_animation = false ;
40754075
40764076 /* To collapse or not to collapse */
40774077 collapse = ozone_want_collapse (ozone , ozone_collapse_sidebar , is_playlist );
40784078
40794079 /* Skip if already at wanted state */
4080- if ( (collapse && ozone -> sidebar_collapsed )
4080+ if ( ( collapse && ozone -> sidebar_collapsed )
40814081 || (!collapse && !ozone -> sidebar_collapsed ))
40824082 goto end ;
40834083
@@ -4112,9 +4112,7 @@ static void ozone_sidebar_update_collapse(ozone_handle_t *ozone,
41124112 {
41134113 if (allow_animation )
41144114 {
4115- ozone -> sidebar_collapsed = false;
4116-
4117- entry .cb = NULL ;
4115+ entry .cb = NULL ;
41184116
41194117 /* Text alpha */
41204118 entry .subject = & ozone -> animations .sidebar_text_alpha ;
@@ -4127,6 +4125,8 @@ static void ozone_sidebar_update_collapse(ozone_handle_t *ozone,
41274125 entry .target_value = ozone -> dimensions .sidebar_width_normal ;
41284126
41294127 gfx_animation_push (& entry );
4128+
4129+ ozone -> sidebar_collapsed = false;
41304130 }
41314131 else
41324132 {
@@ -5735,6 +5735,7 @@ static void ozone_draw_entries(
57355735 }
57365736
57375737 x_offset += (int )sidebar_offset ;
5738+ alpha *= ozone -> animations .alpha ;
57385739 alpha_uint32 = (uint32_t )(alpha * 255.0f );
57395740
57405741 /* Borders layer */
@@ -5920,7 +5921,7 @@ static void ozone_draw_entries(
59205921 if (use_smooth_ticker )
59215922 {
59225923 ticker_smooth .selected = entry_selected && (!(ozone -> flags & OZONE_FLAG_CURSOR_IN_SIDEBAR ));
5923- ticker_smooth .field_width = entry_width - entry_padding - ozone -> dimensions .entry_icon_padding * 6 ;
5924+ ticker_smooth .field_width = entry_width - ozone -> dimensions .entry_icon_padding * 6 ;
59245925 ticker_smooth .src_str = entry_rich_label ;
59255926 ticker_smooth .dst_str = rich_label ;
59265927 ticker_smooth .dst_str_len = sizeof (rich_label );
@@ -5932,7 +5933,7 @@ static void ozone_draw_entries(
59325933 ticker .s = rich_label ;
59335934 ticker .str = entry_rich_label ;
59345935 ticker .selected = entry_selected && (!(ozone -> flags & OZONE_FLAG_CURSOR_IN_SIDEBAR ));
5935- ticker .len = (entry_width - entry_padding - ozone -> dimensions .entry_icon_padding ) / ozone -> fonts .entries_label .glyph_width ;
5936+ ticker .len = (entry_width - ozone -> dimensions .entry_icon_padding * 6 ) / ozone -> fonts .entries_label .glyph_width ;
59365937
59375938 gfx_animation_ticker (& ticker );
59385939 }
@@ -6033,7 +6034,19 @@ static void ozone_draw_entries(
60336034 if (pl_entry
60346035 && !string_is_empty (pl_entry -> db_name )
60356036 && (db_node = RHMAP_GET_STR (ozone -> playlist_db_node_map , pl_entry -> db_name )))
6036- texture = db_node -> content_icon ;
6037+ {
6038+ switch (show_history_icons )
6039+ {
6040+ case PLAYLIST_SHOW_HISTORY_ICONS_MAIN :
6041+ texture = db_node -> icon ;
6042+ break ;
6043+ case PLAYLIST_SHOW_HISTORY_ICONS_CONTENT :
6044+ texture = db_node -> content_icon ;
6045+ break ;
6046+ default :
6047+ break ;
6048+ }
6049+ }
60376050 }
60386051 else if (ozone -> depth == 2 && entry .type == FILE_TYPE_PLAYLIST_COLLECTION )
60396052 {
@@ -9697,6 +9710,7 @@ static void ozone_context_reset(void *data, bool is_threaded)
96979710 ozone -> animations .cursor_alpha = 1.0f ;
96989711 ozone -> animations .scroll_y = 0.0f ;
96999712 ozone -> animations .list_alpha = 1.0f ;
9713+ ozone -> animations .alpha = 1.0f ;
97009714
97019715 /* Thumbnails */
97029716 ozone_update_thumbnail_image (ozone );
@@ -10517,8 +10531,7 @@ static void ozone_render(void *data,
1051710531 menu_st -> selection_ptr = i ;
1051810532
1051910533 /* If this is a playlist, must update thumbnails */
10520- if ( ((ozone -> flags & OZONE_FLAG_IS_PLAYLIST )
10521- && (ozone -> depth == 1 || ozone -> depth == 3 ))
10534+ if ( (ozone -> flags & OZONE_FLAG_IS_PLAYLIST )
1052210535 || (ozone -> flags & OZONE_FLAG_IS_EXPLORE_LIST ))
1052310536 {
1052410537 ozone -> flags &= ~OZONE_FLAG_SKIP_THUMBNAIL_RESET ;
@@ -10555,8 +10568,7 @@ static void ozone_render(void *data,
1055510568 settings -> uints .menu_remember_selection );
1055610569 }
1055710570 /* If this is a playlist, must update thumbnails */
10558- else if ((ozone -> flags & OZONE_FLAG_IS_PLAYLIST )
10559- && (ozone -> depth == 1 || ozone -> depth == 3 ))
10571+ else if (ozone -> flags & OZONE_FLAG_IS_PLAYLIST )
1056010572 {
1056110573 ozone_set_thumbnail_content (ozone , "" );
1056210574 ozone_update_thumbnail_image (ozone );
@@ -10738,6 +10750,8 @@ static void ozone_draw_header(
1073810750 if (header_margin < header_margin_min )
1073910751 header_margin = header_margin_min ;
1074010752
10753+ gfx_display_set_alpha (col , ozone -> animations .alpha );
10754+
1074110755 /* Initial ticker configuration */
1074210756 if (use_smooth_ticker )
1074310757 {
@@ -11774,8 +11788,7 @@ static void ozone_selection_changed(ozone_handle_t *ozone, bool allow_animation)
1177411788 bool update_thumbnails = false;
1177511789
1177611790 /* Playlist updates */
11777- if ( (ozone -> flags & OZONE_FLAG_IS_PLAYLIST )
11778- && (ozone -> depth == 1 || ozone -> depth == 3 ))
11791+ if (ozone -> flags & OZONE_FLAG_IS_PLAYLIST )
1177911792 {
1178011793 ozone_set_thumbnail_content (ozone , "" );
1178111794 update_thumbnails = true;
@@ -12014,6 +12027,8 @@ static void ozone_frame(void *data, video_frame_info_t *video_info)
1201412027 else
1201512028 background_color = ozone -> theme -> background ;
1201612029
12030+ gfx_display_set_alpha (background_color , ozone -> animations .alpha );
12031+
1201712032 gfx_display_draw_quad (p_disp ,
1201812033 userdata ,
1201912034 video_width ,
@@ -12667,7 +12682,7 @@ static void ozone_populate_entries(
1266712682 * and savestate slots */
1266812683 if (
1266912684 ( (ozone -> flags & OZONE_FLAG_WANT_THUMBNAIL_BAR ))
12670- && ( (( ozone -> flags & OZONE_FLAG_IS_PLAYLIST ) && ( ozone -> depth == 1 || ozone -> depth == 3 ) )
12685+ && ( ( ozone -> flags & OZONE_FLAG_IS_PLAYLIST )
1267112686 || ((ozone -> flags & OZONE_FLAG_IS_DB_MANAGER_LIST ) && (ozone -> depth >= 4 ))
1267212687 || (ozone -> flags & OZONE_FLAG_IS_EXPLORE_LIST )
1267312688 || (ozone -> flags & OZONE_FLAG_IS_FILE_LIST )
@@ -12700,6 +12715,23 @@ static void ozone_toggle(void *userdata, bool menu_on)
1270012715 if (!ozone )
1270112716 return ;
1270212717
12718+ /* Fade in animation */
12719+ if (menu_on )
12720+ {
12721+ struct gfx_animation_ctx_entry entry ;
12722+
12723+ ozone -> animations .alpha = 0.0f ;
12724+
12725+ entry .cb = NULL ;
12726+ entry .duration = ANIMATION_PUSH_ENTRY_DURATION * 1.25f ;
12727+ entry .easing_enum = OZONE_EASING_ALPHA ;
12728+ entry .subject = & ozone -> animations .alpha ;
12729+ entry .tag = (uintptr_t )NULL ;
12730+ entry .target_value = 1.0f ;
12731+
12732+ gfx_animation_push (& entry );
12733+ }
12734+
1270312735 /* Have to reset this, otherwise savestate
1270412736 * thumbnail won't update after selecting
1270512737 * 'save state' option */
@@ -13052,7 +13084,6 @@ static int ozone_pointer_up(void *userdata,
1305213084 /* If this is a playlist and the selection
1305313085 * has changed, must update thumbnails */
1305413086 else if ( (ozone -> flags & OZONE_FLAG_IS_PLAYLIST )
13055- && (ozone -> depth == 1 )
1305613087 && (ptr != selection ))
1305713088 {
1305813089 ozone_set_thumbnail_content (ozone , "" );
0 commit comments