GLUI: Allow fullscreen thumbnail browsing (#17562)
This commit is contained in:
parent
135a228ac1
commit
106dc5d8b7
|
@ -124,17 +124,12 @@ int action_switch_thumbnail(const char *path,
|
||||||
#ifdef HAVE_RGUI
|
#ifdef HAVE_RGUI
|
||||||
switch_enabled = !string_is_equal(menu_ident, "rgui");
|
switch_enabled = !string_is_equal(menu_ident, "rgui");
|
||||||
#endif
|
#endif
|
||||||
#ifdef HAVE_MATERIALUI
|
|
||||||
switch_enabled = switch_enabled && !string_is_equal(menu_ident, "glui");
|
|
||||||
#endif
|
|
||||||
|
|
||||||
if (!settings)
|
if (!settings)
|
||||||
return -1;
|
return -1;
|
||||||
|
|
||||||
/* RGUI has its own cycling for thumbnails in order to allow
|
/* RGUI has its own cycling for thumbnails in order to allow
|
||||||
* cycling all images in fullscreen mode.
|
* cycling all images in fullscreen mode.
|
||||||
* GLUI is a special case where thumbnail 'switch' corresponds to
|
|
||||||
* changing thumbnail view mode.
|
|
||||||
* For other menu drivers, we cycle through available thumbnail
|
* For other menu drivers, we cycle through available thumbnail
|
||||||
* types and skip if already visible. */
|
* types and skip if already visible. */
|
||||||
if (switch_enabled)
|
if (switch_enabled)
|
||||||
|
|
|
@ -151,6 +151,9 @@
|
||||||
#define MUI_BATTERY_PERCENT_MAX_LENGTH 12
|
#define MUI_BATTERY_PERCENT_MAX_LENGTH 12
|
||||||
#define MUI_TIMEDATE_MAX_LENGTH 255
|
#define MUI_TIMEDATE_MAX_LENGTH 255
|
||||||
|
|
||||||
|
/* Forward declarations */
|
||||||
|
extern int action_switch_thumbnail(const char *path, const char *label, unsigned type, size_t idx);
|
||||||
|
|
||||||
/* Defines the various types of supported menu
|
/* Defines the various types of supported menu
|
||||||
* list views
|
* list views
|
||||||
* - MUI_LIST_VIEW_DEFAULT is the standard for
|
* - MUI_LIST_VIEW_DEFAULT is the standard for
|
||||||
|
@ -1782,10 +1785,10 @@ static const materialui_theme_t *materialui_get_theme(enum materialui_color_them
|
||||||
0x0C0C0C, /* screen_fade */
|
0x0C0C0C, /* screen_fade */
|
||||||
0x202020, /* missing_thumbnail_icon */
|
0x202020, /* missing_thumbnail_icon */
|
||||||
0.0f, /* header_shadow_opacity */
|
0.0f, /* header_shadow_opacity */
|
||||||
0.5f, /* landscape_border_shadow_opacity */
|
0.0f, /* landscape_border_shadow_opacity */
|
||||||
0.0f, /* status_bar_shadow_opacity */
|
0.0f, /* status_bar_shadow_opacity */
|
||||||
0.0f, /* selection_marker_shadow_opacity */
|
0.0f, /* selection_marker_shadow_opacity */
|
||||||
0.5f /* screen_fade_opacity */
|
0.95f /* screen_fade_opacity */
|
||||||
};
|
};
|
||||||
|
|
||||||
static const materialui_theme_t materialui_theme_gray_light = {
|
static const materialui_theme_t materialui_theme_gray_light = {
|
||||||
|
@ -1829,13 +1832,12 @@ static const materialui_theme_t *materialui_get_theme(enum materialui_color_them
|
||||||
0x0C0C0C, /* screen_fade */
|
0x0C0C0C, /* screen_fade */
|
||||||
0x202020, /* missing_thumbnail_icon */
|
0x202020, /* missing_thumbnail_icon */
|
||||||
0.0f, /* header_shadow_opacity */
|
0.0f, /* header_shadow_opacity */
|
||||||
0.5f, /* landscape_border_shadow_opacity */
|
0.0f, /* landscape_border_shadow_opacity */
|
||||||
0.0f, /* status_bar_shadow_opacity */
|
0.0f, /* status_bar_shadow_opacity */
|
||||||
0.0f, /* selection_marker_shadow_opacity */
|
0.0f, /* selection_marker_shadow_opacity */
|
||||||
0.5f /* screen_fade_opacity */
|
0.95f /* screen_fade_opacity */
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
switch (color_theme)
|
switch (color_theme)
|
||||||
{
|
{
|
||||||
case MATERIALUI_THEME_BLUE:
|
case MATERIALUI_THEME_BLUE:
|
||||||
|
@ -3340,7 +3342,10 @@ static bool materialui_render_process_entry_playlist_desktop(
|
||||||
bool network_on_demand_thumbnails)
|
bool network_on_demand_thumbnails)
|
||||||
{
|
{
|
||||||
gfx_animation_t *p_anim = anim_get_ptr();
|
gfx_animation_t *p_anim = anim_get_ptr();
|
||||||
bool is_selected = (entry_idx == selection);
|
bool is_selected =
|
||||||
|
(entry_idx == selection)
|
||||||
|
|| (entry_idx == selection - 1)
|
||||||
|
|| (entry_idx == selection + 1);
|
||||||
/* We want to load (and keep in memory)
|
/* We want to load (and keep in memory)
|
||||||
* thumbnails for the currently selected
|
* thumbnails for the currently selected
|
||||||
* entry *and* the last entry for which
|
* entry *and* the last entry for which
|
||||||
|
@ -3348,9 +3353,11 @@ static bool materialui_render_process_entry_playlist_desktop(
|
||||||
* us to keep showing 'old' thumbnails in the
|
* us to keep showing 'old' thumbnails in the
|
||||||
* sidebar while waiting for new ones to load
|
* sidebar while waiting for new ones to load
|
||||||
* (otherwise the sidebar is left blank,
|
* (otherwise the sidebar is left blank,
|
||||||
* which looks ugly...) */
|
* which looks ugly...)
|
||||||
bool is_on_screen = is_selected ||
|
* Also load keep next and previous for
|
||||||
(entry_idx == mui->desktop_thumbnail_last_selection);
|
* smoother fullscreen thumbnail browsing */
|
||||||
|
bool is_on_screen = is_selected
|
||||||
|
|| (entry_idx == mui->desktop_thumbnail_last_selection);
|
||||||
|
|
||||||
/* Load thumbnails for selected (and last
|
/* Load thumbnails for selected (and last
|
||||||
* selected) entry and free thumbnails for
|
* selected) entry and free thumbnails for
|
||||||
|
@ -3376,8 +3383,8 @@ static bool materialui_render_process_entry_playlist_desktop(
|
||||||
* selected entry, then it has valid content
|
* selected entry, then it has valid content
|
||||||
* to display in the sidebar -> cache this as
|
* to display in the sidebar -> cache this as
|
||||||
* the 'last selected' entry */
|
* the 'last selected' entry */
|
||||||
if ((node->thumbnails.primary.status != GFX_THUMBNAIL_STATUS_UNKNOWN) &&
|
if ( (node->thumbnails.primary.status != GFX_THUMBNAIL_STATUS_UNKNOWN)
|
||||||
(node->thumbnails.secondary.status != GFX_THUMBNAIL_STATUS_UNKNOWN))
|
&& (node->thumbnails.secondary.status != GFX_THUMBNAIL_STATUS_UNKNOWN))
|
||||||
mui->desktop_thumbnail_last_selection = selection;
|
mui->desktop_thumbnail_last_selection = selection;
|
||||||
|
|
||||||
/* Fetch metadata for selected entry */
|
/* Fetch metadata for selected entry */
|
||||||
|
@ -6416,6 +6423,38 @@ static bool materialui_get_selected_thumbnails(
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void materialui_update_fullscreen_thumbnail_label(
|
||||||
|
materialui_handle_t *mui, struct menu_state *menu_st,
|
||||||
|
size_t selection)
|
||||||
|
{
|
||||||
|
menu_entry_t selected_entry;
|
||||||
|
const char *thumbnail_label = NULL;
|
||||||
|
|
||||||
|
/* Cache selected entry label
|
||||||
|
* (used as menu title when fullscreen thumbnails
|
||||||
|
* are shown) */
|
||||||
|
mui->fullscreen_thumbnail_label[0] = '\0';
|
||||||
|
|
||||||
|
/* > Get menu entry */
|
||||||
|
MENU_ENTRY_INITIALIZE(selected_entry);
|
||||||
|
selected_entry.flags |= MENU_ENTRY_FLAG_LABEL_ENABLED
|
||||||
|
| MENU_ENTRY_FLAG_RICH_LABEL_ENABLED;
|
||||||
|
menu_entry_get(&selected_entry, 0, selection, NULL, true);
|
||||||
|
|
||||||
|
/* > Get entry label */
|
||||||
|
if (!string_is_empty(selected_entry.label))
|
||||||
|
thumbnail_label = selected_entry.label;
|
||||||
|
else
|
||||||
|
thumbnail_label = selected_entry.path;
|
||||||
|
|
||||||
|
/* > Sanity check */
|
||||||
|
if (!string_is_empty(thumbnail_label))
|
||||||
|
strlcpy(
|
||||||
|
mui->fullscreen_thumbnail_label,
|
||||||
|
thumbnail_label,
|
||||||
|
sizeof(mui->fullscreen_thumbnail_label));
|
||||||
|
}
|
||||||
|
|
||||||
/* Disables the fullscreen thumbnail view, with
|
/* Disables the fullscreen thumbnail view, with
|
||||||
* an optional fade out animation */
|
* an optional fade out animation */
|
||||||
static void materialui_hide_fullscreen_thumbnails(
|
static void materialui_hide_fullscreen_thumbnails(
|
||||||
|
@ -6449,6 +6488,7 @@ static void materialui_hide_fullscreen_thumbnails(
|
||||||
|
|
||||||
/* Disable fullscreen thumbnails */
|
/* Disable fullscreen thumbnails */
|
||||||
mui->flags &= ~MUI_FLAG_SHOW_FULLSCREEN_THUMBNAILS;
|
mui->flags &= ~MUI_FLAG_SHOW_FULLSCREEN_THUMBNAILS;
|
||||||
|
gfx_thumbnail_set_stream_delay(mui->thumbnail_stream_delay);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Enables (and triggers a fade in of) the fullscreen
|
/* Enables (and triggers a fade in of) the fullscreen
|
||||||
|
@ -6461,14 +6501,13 @@ static void materialui_show_fullscreen_thumbnails(
|
||||||
gfx_animation_ctx_entry_t animation_entry;
|
gfx_animation_ctx_entry_t animation_entry;
|
||||||
gfx_thumbnail_t *primary_thumbnail = NULL;
|
gfx_thumbnail_t *primary_thumbnail = NULL;
|
||||||
gfx_thumbnail_t *secondary_thumbnail = NULL;
|
gfx_thumbnail_t *secondary_thumbnail = NULL;
|
||||||
uintptr_t alpha_tag = (uintptr_t)
|
uintptr_t alpha_tag = (uintptr_t)&mui->fullscreen_thumbnail_alpha;
|
||||||
&mui->fullscreen_thumbnail_alpha;
|
|
||||||
const char *thumbnail_label = NULL;
|
|
||||||
|
|
||||||
/* Before showing fullscreen thumbnails, must
|
/* Before showing fullscreen thumbnails, must
|
||||||
* ensure that any existing fullscreen thumbnail
|
* ensure that any existing fullscreen thumbnail
|
||||||
* view is disabled... */
|
* view is disabled... */
|
||||||
materialui_hide_fullscreen_thumbnails(mui, false);
|
materialui_hide_fullscreen_thumbnails(mui, false);
|
||||||
|
gfx_thumbnail_set_stream_delay(0);
|
||||||
|
|
||||||
/* Sanity check: Return immediately if this is a view
|
/* Sanity check: Return immediately if this is a view
|
||||||
* mode without thumbnails */
|
* mode without thumbnails */
|
||||||
|
@ -6487,12 +6526,12 @@ static void materialui_show_fullscreen_thumbnails(
|
||||||
* loaded/available */
|
* loaded/available */
|
||||||
if ( (primary_thumbnail->status == GFX_THUMBNAIL_STATUS_AVAILABLE)
|
if ( (primary_thumbnail->status == GFX_THUMBNAIL_STATUS_AVAILABLE)
|
||||||
&& ( (mui->flags & MUI_FLAG_SECONDARY_THUMBNAIL_ENABLED)
|
&& ( (mui->flags & MUI_FLAG_SECONDARY_THUMBNAIL_ENABLED)
|
||||||
&& ((secondary_thumbnail->status != GFX_THUMBNAIL_STATUS_MISSING)
|
&& (secondary_thumbnail->status != GFX_THUMBNAIL_STATUS_MISSING)
|
||||||
&& (secondary_thumbnail->status != GFX_THUMBNAIL_STATUS_AVAILABLE))))
|
&& (secondary_thumbnail->status != GFX_THUMBNAIL_STATUS_AVAILABLE)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
if ( (primary_thumbnail->status == GFX_THUMBNAIL_STATUS_MISSING)
|
if ( (primary_thumbnail->status == GFX_THUMBNAIL_STATUS_MISSING)
|
||||||
&& ((!(mui->flags & MUI_FLAG_SECONDARY_THUMBNAIL_ENABLED))
|
&& ( !(mui->flags & MUI_FLAG_SECONDARY_THUMBNAIL_ENABLED)
|
||||||
|| (secondary_thumbnail->status != GFX_THUMBNAIL_STATUS_AVAILABLE)))
|
|| (secondary_thumbnail->status != GFX_THUMBNAIL_STATUS_AVAILABLE)))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -6502,29 +6541,8 @@ static void materialui_show_fullscreen_thumbnails(
|
||||||
* and reset scroll acceleration */
|
* and reset scroll acceleration */
|
||||||
materialui_kill_scroll_animation(mui, menu_st);
|
materialui_kill_scroll_animation(mui, menu_st);
|
||||||
|
|
||||||
/* Cache selected entry label
|
/* Update thumbnail label */
|
||||||
* (used as menu title when fullscreen thumbnails
|
materialui_update_fullscreen_thumbnail_label(mui, menu_st, selection);
|
||||||
* are shown) */
|
|
||||||
mui->fullscreen_thumbnail_label[0] = '\0';
|
|
||||||
|
|
||||||
/* > Get menu entry */
|
|
||||||
MENU_ENTRY_INITIALIZE(selected_entry);
|
|
||||||
selected_entry.flags |= MENU_ENTRY_FLAG_LABEL_ENABLED
|
|
||||||
| MENU_ENTRY_FLAG_RICH_LABEL_ENABLED;
|
|
||||||
menu_entry_get(&selected_entry, 0, selection, NULL, true);
|
|
||||||
|
|
||||||
/* > Get entry label */
|
|
||||||
if (!string_is_empty(selected_entry.label))
|
|
||||||
thumbnail_label = selected_entry.label;
|
|
||||||
else
|
|
||||||
thumbnail_label = selected_entry.path;
|
|
||||||
|
|
||||||
/* > Sanity check */
|
|
||||||
if (!string_is_empty(thumbnail_label))
|
|
||||||
strlcpy(
|
|
||||||
mui->fullscreen_thumbnail_label,
|
|
||||||
thumbnail_label,
|
|
||||||
sizeof(mui->fullscreen_thumbnail_label));
|
|
||||||
|
|
||||||
/* Configure fade in animation */
|
/* Configure fade in animation */
|
||||||
animation_entry.easing_enum = EASING_OUT_QUAD;
|
animation_entry.easing_enum = EASING_OUT_QUAD;
|
||||||
|
@ -6569,6 +6587,10 @@ static void materialui_render_fullscreen_thumbnails(materialui_handle_t *mui,
|
||||||
float secondary_thumbnail_draw_width = 0.0f;
|
float secondary_thumbnail_draw_width = 0.0f;
|
||||||
float secondary_thumbnail_draw_height = 0.0f;
|
float secondary_thumbnail_draw_height = 0.0f;
|
||||||
|
|
||||||
|
/* Get dimensions of list view */
|
||||||
|
view_width = (int)video_width - (int)mui->nav_bar_layout_width;
|
||||||
|
view_height = (int)video_height - (int)mui->nav_bar_layout_height - (int)header_height;
|
||||||
|
|
||||||
/* Sanity check: Return immediately if this is a view
|
/* Sanity check: Return immediately if this is a view
|
||||||
* mode without thumbnails
|
* mode without thumbnails
|
||||||
* > Note: Baring inexplicable internal errors, this
|
* > Note: Baring inexplicable internal errors, this
|
||||||
|
@ -6577,19 +6599,10 @@ static void materialui_render_fullscreen_thumbnails(materialui_handle_t *mui,
|
||||||
|| (mui->list_view_type == MUI_LIST_VIEW_PLAYLIST))
|
|| (mui->list_view_type == MUI_LIST_VIEW_PLAYLIST))
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/* Paranoid safety check: ensure that current
|
|
||||||
* selection matches the entry selected when
|
|
||||||
* fullscreen thumbnails were enabled.
|
|
||||||
* This can only fail in extreme cases, if
|
|
||||||
* the user manages to change the selection
|
|
||||||
* while fullscreen thumbnails are fading out */
|
|
||||||
if (selection != mui->fullscreen_thumbnail_selection)
|
|
||||||
goto error;
|
|
||||||
|
|
||||||
/* Get thumbnails */
|
/* Get thumbnails */
|
||||||
if (!materialui_get_selected_thumbnails(
|
if (!materialui_get_selected_thumbnails(
|
||||||
mui, selection, &primary_thumbnail, &secondary_thumbnail))
|
mui, selection, &primary_thumbnail, &secondary_thumbnail))
|
||||||
goto error;
|
return;
|
||||||
|
|
||||||
/* Get number of 'active' thumbnails */
|
/* Get number of 'active' thumbnails */
|
||||||
show_primary_thumbnail =
|
show_primary_thumbnail =
|
||||||
|
@ -6605,15 +6618,32 @@ static void materialui_render_fullscreen_thumbnails(materialui_handle_t *mui,
|
||||||
if (show_secondary_thumbnail)
|
if (show_secondary_thumbnail)
|
||||||
num_thumbnails++;
|
num_thumbnails++;
|
||||||
|
|
||||||
/* Do nothing if both thumbnails are missing
|
/* Darken the screen a bit when images are not found
|
||||||
* > Note: Baring inexplicable internal errors, this
|
* to indicate fullscreen mode is still active */
|
||||||
* can never happen... */
|
if ( (num_thumbnails < 1)
|
||||||
if (num_thumbnails < 1)
|
&& (primary_thumbnail->status == GFX_THUMBNAIL_STATUS_MISSING)
|
||||||
goto error;
|
&& (secondary_thumbnail->status == GFX_THUMBNAIL_STATUS_MISSING))
|
||||||
|
{
|
||||||
|
gfx_display_set_alpha(
|
||||||
|
mui->colors.screen_fade,
|
||||||
|
mui->colors.screen_fade_opacity * mui->fullscreen_thumbnail_alpha / 2);
|
||||||
|
|
||||||
/* Get dimensions of list view */
|
/* Darken background */
|
||||||
view_width = (int)video_width - (int)mui->nav_bar_layout_width;
|
gfx_display_draw_quad(
|
||||||
view_height = (int)video_height - (int)mui->nav_bar_layout_height - (int)header_height;
|
p_disp,
|
||||||
|
userdata,
|
||||||
|
video_width,
|
||||||
|
video_height,
|
||||||
|
0,
|
||||||
|
header_height,
|
||||||
|
(unsigned)view_width,
|
||||||
|
(unsigned)view_height,
|
||||||
|
video_width,
|
||||||
|
video_height,
|
||||||
|
mui->colors.screen_fade,
|
||||||
|
NULL);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
/* Check screen orientation
|
/* Check screen orientation
|
||||||
* > When using portrait layouts, primary is shown
|
* > When using portrait layouts, primary is shown
|
||||||
|
@ -6633,9 +6663,9 @@ static void materialui_render_fullscreen_thumbnails(materialui_handle_t *mui,
|
||||||
* depend upon number of active thumbnails */
|
* depend upon number of active thumbnails */
|
||||||
if (num_thumbnails == 2)
|
if (num_thumbnails == 2)
|
||||||
{
|
{
|
||||||
thumbnail_box_height = (view_height - (int)(mui->margin * 6)) >> 1;
|
thumbnail_box_height = (view_height - (int)(mui->margin * 4)) >> 1;
|
||||||
primary_thumbnail_y = (int)header_height + (int)(mui->margin * 2);
|
primary_thumbnail_y = (int)header_height + (int)(mui->margin);
|
||||||
secondary_thumbnail_y = primary_thumbnail_y + thumbnail_box_height + (int)(mui->margin * 2);
|
secondary_thumbnail_y = primary_thumbnail_y + thumbnail_box_height + (int)(mui->margin);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -6647,24 +6677,24 @@ static void materialui_render_fullscreen_thumbnails(materialui_handle_t *mui,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Thumbnail bounding box height is fixed */
|
/* Thumbnail bounding box height is fixed */
|
||||||
thumbnail_box_height = view_height - (int)(mui->margin * 4);
|
thumbnail_box_height = view_height - (int)(mui->margin * 2);
|
||||||
|
|
||||||
/* Thumbnail y position is fixed */
|
/* Thumbnail y position is fixed */
|
||||||
primary_thumbnail_y = (int)header_height + (int)(mui->margin * 2);
|
primary_thumbnail_y = (int)header_height + (int)(mui->margin * 1);
|
||||||
secondary_thumbnail_y = primary_thumbnail_y;
|
secondary_thumbnail_y = primary_thumbnail_y;
|
||||||
|
|
||||||
/* Thumbnail bounding box width and x position
|
/* Thumbnail bounding box width and x position
|
||||||
* depend upon number of active thumbnails */
|
* depend upon number of active thumbnails */
|
||||||
if (num_thumbnails == 2)
|
if (num_thumbnails == 2)
|
||||||
{
|
{
|
||||||
thumbnail_box_width = (view_width - (int)(mui->margin * 6)) >> 1;
|
thumbnail_box_width = (view_width - (int)(mui->margin * 4)) >> 1;
|
||||||
primary_thumbnail_x = (int)(mui->margin * 2);
|
primary_thumbnail_x = (int)(mui->margin);
|
||||||
secondary_thumbnail_x = primary_thumbnail_x + thumbnail_box_width + (int)(mui->margin * 2);
|
secondary_thumbnail_x = primary_thumbnail_x + thumbnail_box_width + (int)(mui->margin * 2);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
thumbnail_box_width = view_width - (int)(mui->margin * 4);
|
thumbnail_box_width = view_width - (int)(mui->margin * 4);
|
||||||
primary_thumbnail_x = (int)(mui->margin * 2);
|
primary_thumbnail_x = (int)(mui->margin);
|
||||||
secondary_thumbnail_x = primary_thumbnail_x;
|
secondary_thumbnail_x = primary_thumbnail_x;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6689,11 +6719,6 @@ static void materialui_render_fullscreen_thumbnails(materialui_handle_t *mui,
|
||||||
primary_thumbnail,
|
primary_thumbnail,
|
||||||
thumbnail_box_width, thumbnail_box_height, 1.0f,
|
thumbnail_box_width, thumbnail_box_height, 1.0f,
|
||||||
&primary_thumbnail_draw_width, &primary_thumbnail_draw_height);
|
&primary_thumbnail_draw_width, &primary_thumbnail_draw_height);
|
||||||
|
|
||||||
/* Sanity check */
|
|
||||||
if ( (primary_thumbnail_draw_width <= 0.0f)
|
|
||||||
|| (primary_thumbnail_draw_height <= 0.0f))
|
|
||||||
goto error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (show_secondary_thumbnail)
|
if (show_secondary_thumbnail)
|
||||||
|
@ -6701,13 +6726,7 @@ static void materialui_render_fullscreen_thumbnails(materialui_handle_t *mui,
|
||||||
gfx_thumbnail_get_draw_dimensions(
|
gfx_thumbnail_get_draw_dimensions(
|
||||||
secondary_thumbnail,
|
secondary_thumbnail,
|
||||||
thumbnail_box_width, thumbnail_box_height, 1.0f,
|
thumbnail_box_width, thumbnail_box_height, 1.0f,
|
||||||
&secondary_thumbnail_draw_width,
|
&secondary_thumbnail_draw_width, &secondary_thumbnail_draw_height);
|
||||||
&secondary_thumbnail_draw_height);
|
|
||||||
|
|
||||||
/* Sanity check */
|
|
||||||
if ( (secondary_thumbnail_draw_width <= 0.0f)
|
|
||||||
|| (secondary_thumbnail_draw_height <= 0.0f))
|
|
||||||
goto error;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Adjust thumbnail draw positions to achieve
|
/* Adjust thumbnail draw positions to achieve
|
||||||
|
@ -6773,12 +6792,12 @@ static void materialui_render_fullscreen_thumbnails(materialui_handle_t *mui,
|
||||||
userdata,
|
userdata,
|
||||||
video_width,
|
video_width,
|
||||||
video_height,
|
video_height,
|
||||||
primary_thumbnail_x - (int)(mui->margin >> 1) +
|
primary_thumbnail_x - (int)(mui->margin >> 2) +
|
||||||
((thumbnail_box_width - (int)primary_thumbnail_draw_width) >> 1),
|
((thumbnail_box_width - (int)primary_thumbnail_draw_width) >> 1),
|
||||||
primary_thumbnail_y - (int)(mui->margin >> 1) +
|
primary_thumbnail_y - (int)(mui->margin >> 2) +
|
||||||
((thumbnail_box_height - (int)primary_thumbnail_draw_height) >> 1),
|
((thumbnail_box_height - (int)primary_thumbnail_draw_height) >> 1),
|
||||||
(unsigned)primary_thumbnail_draw_width + mui->margin,
|
(unsigned)primary_thumbnail_draw_width + (int)(mui->margin >> 1),
|
||||||
(unsigned)primary_thumbnail_draw_height + mui->margin,
|
(unsigned)primary_thumbnail_draw_height + (int)(mui->margin >> 1),
|
||||||
video_width,
|
video_width,
|
||||||
video_height,
|
video_height,
|
||||||
mui->colors.surface_background,
|
mui->colors.surface_background,
|
||||||
|
@ -6809,12 +6828,12 @@ static void materialui_render_fullscreen_thumbnails(materialui_handle_t *mui,
|
||||||
userdata,
|
userdata,
|
||||||
video_width,
|
video_width,
|
||||||
video_height,
|
video_height,
|
||||||
secondary_thumbnail_x - (int)(mui->margin >> 1) +
|
secondary_thumbnail_x - (int)(mui->margin >> 2) +
|
||||||
((thumbnail_box_width - (int)secondary_thumbnail_draw_width) >> 1),
|
((thumbnail_box_width - (int)secondary_thumbnail_draw_width) >> 1),
|
||||||
secondary_thumbnail_y - (int)(mui->margin >> 1) +
|
secondary_thumbnail_y - (int)(mui->margin >> 2) +
|
||||||
((thumbnail_box_height - (int)secondary_thumbnail_draw_height) >> 1),
|
((thumbnail_box_height - (int)secondary_thumbnail_draw_height) >> 1),
|
||||||
(unsigned)secondary_thumbnail_draw_width + mui->margin,
|
(unsigned)secondary_thumbnail_draw_width + (int)(mui->margin >> 1),
|
||||||
(unsigned)secondary_thumbnail_draw_height + mui->margin,
|
(unsigned)secondary_thumbnail_draw_height + (int)(mui->margin >> 1),
|
||||||
video_width,
|
video_width,
|
||||||
video_height,
|
video_height,
|
||||||
mui->colors.surface_background,
|
mui->colors.surface_background,
|
||||||
|
@ -6836,7 +6855,6 @@ static void materialui_render_fullscreen_thumbnails(materialui_handle_t *mui,
|
||||||
NULL);
|
NULL);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return;
|
return;
|
||||||
|
|
||||||
error:
|
error:
|
||||||
|
@ -7559,15 +7577,13 @@ static void materialui_status_bar_init(materialui_handle_t *mui,
|
||||||
sizeof(mui->status_bar.runtime_fallback_str) - _len);
|
sizeof(mui->status_bar.runtime_fallback_str) - _len);
|
||||||
|
|
||||||
_len = strlcpy(mui->status_bar.last_played_fallback_str,
|
_len = strlcpy(mui->status_bar.last_played_fallback_str,
|
||||||
msg_hash_to_str(
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED),
|
||||||
MENU_ENUM_LABEL_VALUE_PLAYLIST_SUBLABEL_LAST_PLAYED),
|
|
||||||
sizeof(mui->status_bar.last_played_fallback_str));
|
sizeof(mui->status_bar.last_played_fallback_str));
|
||||||
mui->status_bar.last_played_fallback_str[ _len] = ' ';
|
mui->status_bar.last_played_fallback_str[ _len] = ' ';
|
||||||
mui->status_bar.last_played_fallback_str[++_len] = '\0';
|
mui->status_bar.last_played_fallback_str[++_len] = '\0';
|
||||||
strlcpy(mui->status_bar.last_played_fallback_str + _len,
|
strlcpy(mui->status_bar.last_played_fallback_str + _len,
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISABLED),
|
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DISABLED),
|
||||||
sizeof(mui->status_bar.last_played_fallback_str) - _len
|
sizeof(mui->status_bar.last_played_fallback_str) - _len);
|
||||||
);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8421,6 +8437,10 @@ static void materialui_navigation_set(void *data, bool scroll)
|
||||||
else if (string_is_equal(mui->menu_title, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SETTINGS)))
|
else if (string_is_equal(mui->menu_title, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SETTINGS)))
|
||||||
mui->settings_selection_ptr = selection;
|
mui->settings_selection_ptr = selection;
|
||||||
|
|
||||||
|
/* Update possible fullscreen thumbnail label */
|
||||||
|
if (mui->flags & MUI_FLAG_SHOW_FULLSCREEN_THUMBNAILS)
|
||||||
|
materialui_update_fullscreen_thumbnail_label(mui, menu_st, selection);
|
||||||
|
|
||||||
if (!scroll)
|
if (!scroll)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
@ -9228,33 +9248,6 @@ static enum menu_action materialui_parse_menu_entry_action(
|
||||||
enum menu_action new_action = action;
|
enum menu_action new_action = action;
|
||||||
struct menu_state *menu_st = menu_state_get_ptr();
|
struct menu_state *menu_st = menu_state_get_ptr();
|
||||||
|
|
||||||
/* If fullscreen thumbnail view is active, any
|
|
||||||
* valid menu action will disable it... */
|
|
||||||
if (mui->flags & MUI_FLAG_SHOW_FULLSCREEN_THUMBNAILS)
|
|
||||||
{
|
|
||||||
if (action != MENU_ACTION_NOOP)
|
|
||||||
{
|
|
||||||
materialui_hide_fullscreen_thumbnails(mui, true);
|
|
||||||
|
|
||||||
/* ...and any action other than Select/OK
|
|
||||||
* is ignored
|
|
||||||
* > We allow pass-through of Select/OK since
|
|
||||||
* users may want to run content directly
|
|
||||||
* after viewing fullscreen thumbnails (i.e.
|
|
||||||
* the large images may pique their interest),
|
|
||||||
* and having to press RetroPad A or the Return
|
|
||||||
* key twice is navigationally confusing
|
|
||||||
* > Note that we can only do this for non-pointer
|
|
||||||
* input, though (when using a mouse/touchscreen,
|
|
||||||
* there just aren't enough distinct inputs types
|
|
||||||
* to single out a rational Select/OK action
|
|
||||||
* when fullscreen thumbnails are shown) */
|
|
||||||
if ( (action != MENU_ACTION_SELECT)
|
|
||||||
&& (action != MENU_ACTION_OK))
|
|
||||||
return MENU_ACTION_NOOP;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Scan user inputs */
|
/* Scan user inputs */
|
||||||
switch (action)
|
switch (action)
|
||||||
{
|
{
|
||||||
|
@ -9424,6 +9417,12 @@ static enum menu_action materialui_parse_menu_entry_action(
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MENU_ACTION_START:
|
case MENU_ACTION_START:
|
||||||
|
if (mui->flags & MUI_FLAG_SHOW_FULLSCREEN_THUMBNAILS)
|
||||||
|
{
|
||||||
|
materialui_hide_fullscreen_thumbnails(mui, true);
|
||||||
|
new_action = MENU_ACTION_NOOP;
|
||||||
|
break;
|
||||||
|
}
|
||||||
/* - If this is a playlist, attempt to show
|
/* - If this is a playlist, attempt to show
|
||||||
* fullscreen thumbnail view
|
* fullscreen thumbnail view
|
||||||
* - If this is not a playlist, perform default
|
* - If this is not a playlist, perform default
|
||||||
|
@ -9442,6 +9441,14 @@ static enum menu_action materialui_parse_menu_entry_action(
|
||||||
new_action = MENU_ACTION_NOOP;
|
new_action = MENU_ACTION_NOOP;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case MENU_ACTION_SEARCH:
|
||||||
|
/* Playlist thumbnail cycle */
|
||||||
|
if (mui->flags & MUI_FLAG_SHOW_FULLSCREEN_THUMBNAILS)
|
||||||
|
{
|
||||||
|
action_switch_thumbnail(NULL, NULL, 0, 0);
|
||||||
|
new_action = MENU_ACTION_NOOP;
|
||||||
|
}
|
||||||
|
break;
|
||||||
case MENU_ACTION_INFO:
|
case MENU_ACTION_INFO:
|
||||||
/* Well here's a fine piece of nonsense...
|
/* Well here's a fine piece of nonsense...
|
||||||
* > Whenever an 'info' action is performed,
|
* > Whenever an 'info' action is performed,
|
||||||
|
@ -9506,6 +9513,13 @@ static enum menu_action materialui_parse_menu_entry_action(
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case MENU_ACTION_CANCEL:
|
case MENU_ACTION_CANCEL:
|
||||||
|
if (mui->flags & MUI_FLAG_SHOW_FULLSCREEN_THUMBNAILS)
|
||||||
|
{
|
||||||
|
materialui_hide_fullscreen_thumbnails(mui, true);
|
||||||
|
new_action = MENU_ACTION_NOOP;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
/* If user hides navigation bar via the settings
|
/* If user hides navigation bar via the settings
|
||||||
* tab, pressing cancel (several times) will return
|
* tab, pressing cancel (several times) will return
|
||||||
* them to the top level settings menu - but since
|
* them to the top level settings menu - but since
|
||||||
|
@ -11304,6 +11318,13 @@ static void materialui_refresh_thumbnail_image(void *userdata, unsigned i)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void materialui_update_thumbnail_image(void *userdata)
|
||||||
|
{
|
||||||
|
struct menu_state *menu_st = menu_state_get_ptr();
|
||||||
|
materialui_refresh_thumbnail_image(userdata, menu_st->selection_ptr);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
menu_ctx_driver_t menu_ctx_mui = {
|
menu_ctx_driver_t menu_ctx_mui = {
|
||||||
NULL,
|
NULL,
|
||||||
materialui_get_message,
|
materialui_get_message,
|
||||||
|
@ -11338,7 +11359,7 @@ menu_ctx_driver_t menu_ctx_mui = {
|
||||||
"glui",
|
"glui",
|
||||||
materialui_environ,
|
materialui_environ,
|
||||||
NULL,
|
NULL,
|
||||||
NULL,
|
materialui_update_thumbnail_image,
|
||||||
materialui_refresh_thumbnail_image,
|
materialui_refresh_thumbnail_image,
|
||||||
NULL,
|
NULL,
|
||||||
gfx_display_osk_ptr_at_pos,
|
gfx_display_osk_ptr_at_pos,
|
||||||
|
|
|
@ -101,7 +101,7 @@
|
||||||
#define SIDEBAR_ENTRY_ICON_PADDING 15
|
#define SIDEBAR_ENTRY_ICON_PADDING 15
|
||||||
#define SIDEBAR_GRADIENT_HEIGHT 28
|
#define SIDEBAR_GRADIENT_HEIGHT 28
|
||||||
|
|
||||||
#define FULLSCREEN_THUMBNAIL_PADDING 32
|
#define FULLSCREEN_THUMBNAIL_PADDING 20
|
||||||
|
|
||||||
#define CURSOR_SIZE 64
|
#define CURSOR_SIZE 64
|
||||||
/* Cursor becomes active when it moves more
|
/* Cursor becomes active when it moves more
|
||||||
|
@ -1579,6 +1579,7 @@ static float ozone_last_framebuffer_opacity = -1.0f;
|
||||||
static void ozone_cursor_animation_cb(void *userdata);
|
static void ozone_cursor_animation_cb(void *userdata);
|
||||||
static void ozone_selection_changed(ozone_handle_t *ozone, bool allow_animation);
|
static void ozone_selection_changed(ozone_handle_t *ozone, bool allow_animation);
|
||||||
static void ozone_unload_thumbnail_textures(void *data);
|
static void ozone_unload_thumbnail_textures(void *data);
|
||||||
|
extern int action_switch_thumbnail(const char *path, const char *label, unsigned type, size_t idx);
|
||||||
|
|
||||||
static INLINE uint8_t ozone_count_lines(const char *str)
|
static INLINE uint8_t ozone_count_lines(const char *str)
|
||||||
{
|
{
|
||||||
|
@ -7219,40 +7220,37 @@ static void ozone_draw_fullscreen_thumbnails(
|
||||||
if ( (ozone->animations.fullscreen_thumbnail_alpha > 0.0f)
|
if ( (ozone->animations.fullscreen_thumbnail_alpha > 0.0f)
|
||||||
|| (ozone->flags2 & OZONE_FLAG2_WANT_FULLSCREEN_THUMBNAILS))
|
|| (ozone->flags2 & OZONE_FLAG2_WANT_FULLSCREEN_THUMBNAILS))
|
||||||
{
|
{
|
||||||
gfx_thumbnail_t *right_thumbnail = &ozone->thumbnails.right;
|
|
||||||
gfx_thumbnail_t *left_thumbnail = &ozone->thumbnails.left;
|
|
||||||
unsigned width = video_width;
|
|
||||||
unsigned height = video_height;
|
|
||||||
int view_width = (int)width;
|
|
||||||
gfx_display_t *p_disp = (gfx_display_t*)disp_userdata;
|
gfx_display_t *p_disp = (gfx_display_t*)disp_userdata;
|
||||||
|
gfx_thumbnail_t *right_thumbnail = &ozone->thumbnails.left;
|
||||||
int view_height = (int)height
|
gfx_thumbnail_t *left_thumbnail = &ozone->thumbnails.right;
|
||||||
- ozone->dimensions.header_height
|
|
||||||
- ozone->dimensions.footer_height
|
|
||||||
- ozone->dimensions.spacer_1px;
|
|
||||||
int thumbnail_margin = ozone->dimensions.fullscreen_thumbnail_padding;
|
|
||||||
bool show_right_thumbnail = false;
|
|
||||||
bool show_left_thumbnail = false;
|
|
||||||
unsigned num_thumbnails = 0;
|
|
||||||
float right_thumbnail_draw_width = 0.0f;
|
float right_thumbnail_draw_width = 0.0f;
|
||||||
float right_thumbnail_draw_height = 0.0f;
|
float right_thumbnail_draw_height = 0.0f;
|
||||||
float left_thumbnail_draw_width = 0.0f;
|
float left_thumbnail_draw_width = 0.0f;
|
||||||
float left_thumbnail_draw_height = 0.0f;
|
float left_thumbnail_draw_height = 0.0f;
|
||||||
float background_alpha = 0.85f;
|
float background_alpha = 0.95f;
|
||||||
static float background_color[16] = {
|
static float background_color[16] = {
|
||||||
0.0f, 0.0f, 0.0f, 1.0f,
|
0.0f, 0.0f, 0.0f, 1.0f,
|
||||||
0.0f, 0.0f, 0.0f, 1.0f,
|
0.0f, 0.0f, 0.0f, 1.0f,
|
||||||
0.0f, 0.0f, 0.0f, 1.0f,
|
0.0f, 0.0f, 0.0f, 1.0f,
|
||||||
0.0f, 0.0f, 0.0f, 1.0f,
|
0.0f, 0.0f, 0.0f, 1.0f,
|
||||||
};
|
};
|
||||||
int frame_width = (int)((float)thumbnail_margin / 3.0f);
|
|
||||||
float frame_color[16];
|
float frame_color[16];
|
||||||
float separator_color[16];
|
float separator_color[16];
|
||||||
int thumbnail_box_width;
|
int view_width = (int)video_width;
|
||||||
int thumbnail_box_height;
|
int view_height = (int)video_height
|
||||||
int right_thumbnail_x;
|
- ozone->dimensions.header_height
|
||||||
int left_thumbnail_x;
|
- ozone->dimensions.footer_height
|
||||||
int thumbnail_y;
|
- ozone->dimensions.spacer_1px;
|
||||||
|
int thumbnail_padding = ozone->dimensions.fullscreen_thumbnail_padding;
|
||||||
|
int frame_width = (int)((float)thumbnail_padding / 4.0f);
|
||||||
|
int thumbnail_box_width = 0;
|
||||||
|
int thumbnail_box_height = 0;
|
||||||
|
int right_thumbnail_x = 0;
|
||||||
|
int left_thumbnail_x = 0;
|
||||||
|
int thumbnail_y = 0;
|
||||||
|
uint8_t num_thumbnails = 0;
|
||||||
|
bool show_right_thumbnail = false;
|
||||||
|
bool show_left_thumbnail = false;
|
||||||
|
|
||||||
/* Sanity check: Return immediately if this is
|
/* Sanity check: Return immediately if this is
|
||||||
* a menu without thumbnails and we are not currently
|
* a menu without thumbnails and we are not currently
|
||||||
|
@ -7298,10 +7296,10 @@ static void ozone_draw_fullscreen_thumbnails(
|
||||||
video_height,
|
video_height,
|
||||||
0,
|
0,
|
||||||
ozone->dimensions.header_height + ozone->dimensions.spacer_1px,
|
ozone->dimensions.header_height + ozone->dimensions.spacer_1px,
|
||||||
width,
|
view_width,
|
||||||
(unsigned)view_height,
|
(unsigned)view_height,
|
||||||
width,
|
video_width,
|
||||||
height,
|
video_height,
|
||||||
background_color,
|
background_color,
|
||||||
NULL);
|
NULL);
|
||||||
return;
|
return;
|
||||||
|
@ -7321,23 +7319,23 @@ static void ozone_draw_fullscreen_thumbnails(
|
||||||
|
|
||||||
/* > Thumbnail bounding box height + y position
|
/* > Thumbnail bounding box height + y position
|
||||||
* are fixed */
|
* are fixed */
|
||||||
thumbnail_box_height = view_height - (thumbnail_margin * 2);
|
thumbnail_box_height = view_height - (thumbnail_padding * 2);
|
||||||
thumbnail_y = ozone->dimensions.header_height + thumbnail_margin
|
thumbnail_y = ozone->dimensions.header_height + thumbnail_padding
|
||||||
+ ozone->dimensions.spacer_1px;
|
+ ozone->dimensions.spacer_1px;
|
||||||
|
|
||||||
/* Thumbnail bounding box width and x position
|
/* Thumbnail bounding box width and x position
|
||||||
* depend upon number of active thumbnails */
|
* depend upon number of active thumbnails */
|
||||||
if (num_thumbnails == 2)
|
if (num_thumbnails == 2)
|
||||||
{
|
{
|
||||||
thumbnail_box_width = (view_width - (thumbnail_margin * 3) - frame_width) >> 1;
|
thumbnail_box_width = (view_width - (thumbnail_padding * 3) - frame_width) >> 1;
|
||||||
left_thumbnail_x = thumbnail_margin;
|
left_thumbnail_x = thumbnail_padding;
|
||||||
right_thumbnail_x = left_thumbnail_x + thumbnail_box_width + frame_width
|
right_thumbnail_x = left_thumbnail_x + thumbnail_box_width + frame_width
|
||||||
+ thumbnail_margin;
|
+ thumbnail_padding;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
thumbnail_box_width = view_width - (thumbnail_margin * 2);
|
thumbnail_box_width = view_width - (thumbnail_padding * 2);
|
||||||
left_thumbnail_x = thumbnail_margin;
|
left_thumbnail_x = thumbnail_padding;
|
||||||
right_thumbnail_x = left_thumbnail_x;
|
right_thumbnail_x = left_thumbnail_x;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -7427,10 +7425,10 @@ static void ozone_draw_fullscreen_thumbnails(
|
||||||
video_height,
|
video_height,
|
||||||
0,
|
0,
|
||||||
ozone->dimensions.header_height + ozone->dimensions.spacer_1px,
|
ozone->dimensions.header_height + ozone->dimensions.spacer_1px,
|
||||||
width,
|
view_width,
|
||||||
(unsigned)view_height,
|
(unsigned)view_height,
|
||||||
width,
|
video_width,
|
||||||
height,
|
video_height,
|
||||||
background_color,
|
background_color,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -7442,10 +7440,10 @@ static void ozone_draw_fullscreen_thumbnails(
|
||||||
video_height,
|
video_height,
|
||||||
0,
|
0,
|
||||||
ozone->dimensions.header_height,
|
ozone->dimensions.header_height,
|
||||||
width,
|
view_width,
|
||||||
ozone->dimensions.spacer_1px,
|
ozone->dimensions.spacer_1px,
|
||||||
width,
|
video_width,
|
||||||
height,
|
video_height,
|
||||||
separator_color,
|
separator_color,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -7455,11 +7453,11 @@ static void ozone_draw_fullscreen_thumbnails(
|
||||||
video_width,
|
video_width,
|
||||||
video_height,
|
video_height,
|
||||||
0,
|
0,
|
||||||
height - ozone->dimensions.footer_height,
|
video_height - ozone->dimensions.footer_height,
|
||||||
width,
|
view_width,
|
||||||
ozone->dimensions.spacer_1px,
|
ozone->dimensions.spacer_1px,
|
||||||
width,
|
video_width,
|
||||||
height,
|
video_height,
|
||||||
separator_color,
|
separator_color,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -7482,8 +7480,8 @@ static void ozone_draw_fullscreen_thumbnails(
|
||||||
+ ((thumbnail_box_height - (int)right_thumbnail_draw_height) >> 1),
|
+ ((thumbnail_box_height - (int)right_thumbnail_draw_height) >> 1),
|
||||||
(unsigned)right_thumbnail_draw_width + (frame_width << 1),
|
(unsigned)right_thumbnail_draw_width + (frame_width << 1),
|
||||||
(unsigned)right_thumbnail_draw_height + (frame_width << 1),
|
(unsigned)right_thumbnail_draw_height + (frame_width << 1),
|
||||||
width,
|
video_width,
|
||||||
height,
|
video_height,
|
||||||
frame_color,
|
frame_color,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -7520,8 +7518,8 @@ static void ozone_draw_fullscreen_thumbnails(
|
||||||
+ ((thumbnail_box_height - (int)left_thumbnail_draw_height) >> 1),
|
+ ((thumbnail_box_height - (int)left_thumbnail_draw_height) >> 1),
|
||||||
(unsigned)left_thumbnail_draw_width + (frame_width << 1),
|
(unsigned)left_thumbnail_draw_width + (frame_width << 1),
|
||||||
(unsigned)left_thumbnail_draw_height + (frame_width << 1),
|
(unsigned)left_thumbnail_draw_height + (frame_width << 1),
|
||||||
width,
|
video_width,
|
||||||
height,
|
video_height,
|
||||||
frame_color,
|
frame_color,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
@ -8008,15 +8006,6 @@ static void ozone_set_thumbnail_delay(bool on)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Common thumbnail switch requires FILE_TYPE_RPL_ENTRY,
|
|
||||||
* which only works with playlists, therefore activate it
|
|
||||||
* manually for Quick Menu, Explore and Database */
|
|
||||||
extern int action_switch_thumbnail(
|
|
||||||
const char *path,
|
|
||||||
const char *label,
|
|
||||||
unsigned type,
|
|
||||||
size_t idx);
|
|
||||||
|
|
||||||
static enum menu_action ozone_parse_menu_entry_action(
|
static enum menu_action ozone_parse_menu_entry_action(
|
||||||
ozone_handle_t *ozone,
|
ozone_handle_t *ozone,
|
||||||
bool menu_navigation_wraparound_enable,
|
bool menu_navigation_wraparound_enable,
|
||||||
|
|
|
@ -2715,6 +2715,7 @@ static void rgui_render_fs_thumbnail(
|
||||||
unsigned fs_thumbnail_height = rgui->fs_thumbnail.height;
|
unsigned fs_thumbnail_height = rgui->fs_thumbnail.height;
|
||||||
uint16_t *src = NULL;
|
uint16_t *src = NULL;
|
||||||
uint16_t *dst = NULL;
|
uint16_t *dst = NULL;
|
||||||
|
uint8_t border_width = 1;
|
||||||
|
|
||||||
/* Ensure that thumbnail is centred
|
/* Ensure that thumbnail is centred
|
||||||
* > Have to perform some stupid tests here because we
|
* > Have to perform some stupid tests here because we
|
||||||
|
@ -2755,48 +2756,19 @@ static void rgui_render_fs_thumbnail(
|
||||||
memcpy(dst, src, width * sizeof(uint16_t));
|
memcpy(dst, src, width * sizeof(uint16_t));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Draw drop shadow, if required */
|
/* Draw border */
|
||||||
if (rgui->flags & RGUI_FLAG_SHADOW_ENABLE)
|
rgui_fill_rect(frame_buf_data, fb_width, fb_height,
|
||||||
{
|
fb_x_offset, fb_y_offset, width - border_width, border_width,
|
||||||
unsigned shadow_x;
|
0, 0, false);
|
||||||
unsigned shadow_y;
|
rgui_fill_rect(frame_buf_data, fb_width, fb_height,
|
||||||
unsigned shadow_width;
|
fb_x_offset + width - border_width, fb_y_offset, border_width, height - border_width,
|
||||||
unsigned shadow_height;
|
0, 0, false);
|
||||||
|
rgui_fill_rect(frame_buf_data, fb_width, fb_height,
|
||||||
/* Vertical component */
|
fb_x_offset + border_width, fb_y_offset + height - border_width, width - border_width, border_width,
|
||||||
if (fs_thumbnail_width < fb_width)
|
0, 0, false);
|
||||||
{
|
rgui_fill_rect(frame_buf_data, fb_width, fb_height,
|
||||||
shadow_width = fb_width - fs_thumbnail_width;
|
fb_x_offset, fb_y_offset + border_width, border_width, height - border_width,
|
||||||
if (shadow_width > 2)
|
0, 0, false);
|
||||||
shadow_width = 2;
|
|
||||||
shadow_height = (fs_thumbnail_height + 2 < fb_height)
|
|
||||||
? fs_thumbnail_height
|
|
||||||
: fb_height - 2;
|
|
||||||
|
|
||||||
shadow_x = fb_x_offset + fs_thumbnail_width;
|
|
||||||
shadow_y = fb_y_offset + 2;
|
|
||||||
|
|
||||||
rgui_color_rect(frame_buf_data, fb_width, fb_height,
|
|
||||||
shadow_x, shadow_y, shadow_width, shadow_height, rgui->colors.shadow_color);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Horizontal component */
|
|
||||||
if (fs_thumbnail_height < fb_height)
|
|
||||||
{
|
|
||||||
shadow_height = fb_height - fs_thumbnail_height;
|
|
||||||
if (shadow_height > 2)
|
|
||||||
shadow_height = 2;
|
|
||||||
shadow_width = (fs_thumbnail_width + 2 < fb_width)
|
|
||||||
? fs_thumbnail_width
|
|
||||||
: fb_width - 2;
|
|
||||||
|
|
||||||
shadow_x = fb_x_offset + 2;
|
|
||||||
shadow_y = fb_y_offset + fs_thumbnail_height;
|
|
||||||
|
|
||||||
rgui_color_rect(frame_buf_data, fb_width, fb_height,
|
|
||||||
shadow_x, shadow_y, shadow_width, shadow_height, rgui->colors.shadow_color);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -5244,7 +5216,7 @@ static void rgui_render(void *data, unsigned width, unsigned height,
|
||||||
if (use_smooth_ticker)
|
if (use_smooth_ticker)
|
||||||
{
|
{
|
||||||
ticker_smooth.selected = true;
|
ticker_smooth.selected = true;
|
||||||
ticker_smooth.field_width = (rgui->term_layout.width - 10) * rgui->font_width_stride;
|
ticker_smooth.field_width = (rgui->term_layout.width) * rgui->font_width_stride;
|
||||||
ticker_smooth.src_str = thumbnail_title;
|
ticker_smooth.src_str = thumbnail_title;
|
||||||
ticker_smooth.dst_str = thumbnail_title_buf;
|
ticker_smooth.dst_str = thumbnail_title_buf;
|
||||||
ticker_smooth.dst_str_len = sizeof(thumbnail_title_buf);
|
ticker_smooth.dst_str_len = sizeof(thumbnail_title_buf);
|
||||||
|
@ -5259,7 +5231,7 @@ static void rgui_render(void *data, unsigned width, unsigned height,
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
ticker.s = thumbnail_title_buf;
|
ticker.s = thumbnail_title_buf;
|
||||||
ticker.len = rgui->term_layout.width - 10;
|
ticker.len = rgui->term_layout.width;
|
||||||
ticker.str = thumbnail_title;
|
ticker.str = thumbnail_title;
|
||||||
ticker.selected = true;
|
ticker.selected = true;
|
||||||
|
|
||||||
|
@ -5274,13 +5246,13 @@ static void rgui_render(void *data, unsigned width, unsigned height,
|
||||||
|
|
||||||
/* Draw thumbnail title background */
|
/* Draw thumbnail title background */
|
||||||
rgui_fill_rect(rgui->frame_buf.data, fb_width, fb_height,
|
rgui_fill_rect(rgui->frame_buf.data, fb_width, fb_height,
|
||||||
title_x - 5, 0, title_width + 10, rgui->font_height_stride,
|
title_x - 5, 0, title_width + 10, rgui->font_height_stride - 1,
|
||||||
rgui->colors.bg_dark_color, rgui->colors.bg_light_color,
|
rgui->colors.bg_dark_color, rgui->colors.bg_light_color,
|
||||||
(rgui->flags & RGUI_FLAG_BG_THICKNESS) ? true : false);
|
(rgui->flags & RGUI_FLAG_BG_THICKNESS) ? true : false);
|
||||||
|
|
||||||
/* Draw thumbnail title */
|
/* Draw thumbnail title */
|
||||||
rgui_blit_line(rgui, fb_width, ticker_x_offset + title_x,
|
rgui_blit_line(rgui, fb_width, ticker_x_offset + title_x,
|
||||||
1, thumbnail_title_buf,
|
0, thumbnail_title_buf,
|
||||||
rgui->colors.hover_color, rgui->colors.shadow_color);
|
rgui->colors.hover_color, rgui->colors.shadow_color);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -6392,7 +6364,7 @@ static bool rgui_set_aspect_ratio(
|
||||||
|
|
||||||
/* Allocate thumbnail buffer */
|
/* Allocate thumbnail buffer */
|
||||||
rgui->fs_thumbnail.max_width = rgui->frame_buf.width;
|
rgui->fs_thumbnail.max_width = rgui->frame_buf.width;
|
||||||
rgui->fs_thumbnail.max_height = rgui->frame_buf.height - (unsigned)(rgui->font_height_stride * 2.0f) - 1;
|
rgui->fs_thumbnail.max_height = rgui->frame_buf.height - (unsigned)(rgui->font_height_stride * 2.0f) + 2;
|
||||||
rgui->fs_thumbnail.data = (uint16_t*)calloc(
|
rgui->fs_thumbnail.data = (uint16_t*)calloc(
|
||||||
rgui->fs_thumbnail.max_width * rgui->fs_thumbnail.max_height, sizeof(uint16_t));
|
rgui->fs_thumbnail.max_width * rgui->fs_thumbnail.max_height, sizeof(uint16_t));
|
||||||
|
|
||||||
|
|
|
@ -505,9 +505,14 @@ static float xmb_item_color[] = {
|
||||||
};
|
};
|
||||||
|
|
||||||
/* Forward declarations */
|
/* Forward declarations */
|
||||||
|
extern int action_switch_thumbnail(const char *path,
|
||||||
|
const char *label, unsigned type, size_t idx);
|
||||||
|
static int xmb_menu_entry_action(void *userdata,
|
||||||
|
menu_entry_t *entry, size_t i, enum menu_action action);
|
||||||
static bool xmb_load_image(void *userdata, void *data,
|
static bool xmb_load_image(void *userdata, void *data,
|
||||||
enum menu_image_type type);
|
enum menu_image_type type);
|
||||||
|
|
||||||
|
|
||||||
static INLINE float xmb_item_y(const xmb_handle_t *xmb,
|
static INLINE float xmb_item_y(const xmb_handle_t *xmb,
|
||||||
int i, size_t current)
|
int i, size_t current)
|
||||||
{
|
{
|
||||||
|
@ -5532,16 +5537,6 @@ static void xmb_set_thumbnail_delay(bool on)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Common thumbnail switch requires FILE_TYPE_RPL_ENTRY,
|
|
||||||
* which only works with playlists, therefore activate it
|
|
||||||
* manually for Quick Menu, Explore and Database */
|
|
||||||
extern int action_switch_thumbnail(const char *path,
|
|
||||||
const char *label, unsigned type, size_t idx);
|
|
||||||
|
|
||||||
static int xmb_menu_entry_action(
|
|
||||||
void *userdata, menu_entry_t *entry,
|
|
||||||
size_t i, enum menu_action action);
|
|
||||||
|
|
||||||
static enum menu_action xmb_parse_menu_entry_action(
|
static enum menu_action xmb_parse_menu_entry_action(
|
||||||
xmb_handle_t *xmb, enum menu_action action)
|
xmb_handle_t *xmb, enum menu_action action)
|
||||||
{
|
{
|
||||||
|
@ -7141,8 +7136,8 @@ static void xmb_draw_fullscreen_thumbnails(
|
||||||
goto error;
|
goto error;
|
||||||
|
|
||||||
/* Get thumbnail pointers */
|
/* Get thumbnail pointers */
|
||||||
right_thumbnail = &xmb->thumbnails.right;
|
right_thumbnail = &xmb->thumbnails.left;
|
||||||
left_thumbnail = &xmb->thumbnails.left;
|
left_thumbnail = &xmb->thumbnails.right;
|
||||||
|
|
||||||
/* Get number of 'active' thumbnails */
|
/* Get number of 'active' thumbnails */
|
||||||
show_right_thumbnail =
|
show_right_thumbnail =
|
||||||
|
|
Loading…
Reference in New Issue