mirror of
https://github.com/libretro/RetroArch
synced 2025-01-31 15:32:59 +00:00
added variable for the horizontal padding of sidebar entries
This commit is contained in:
parent
bf43b61070
commit
8435fc5542
@ -478,6 +478,7 @@ static void ozone_context_reset(void *data, bool is_threaded)
|
||||
ozone->ui_dimensions.entry_padding = ENTRY_PADDING * scale;
|
||||
|
||||
ozone->ui_dimensions.sidebar_entry_height = ENTRY_HEIGHT * scale;
|
||||
ozone->ui_dimensions.sidebar_padding_horizontal = SIDEBAR_X_PADDING * scale;
|
||||
ozone->ui_dimensions.sidebar_padding_vertical = SIDEBAR_Y_PADDING * scale;
|
||||
ozone->ui_dimensions.sidebar_entry_padding_vertical = ENTRY_Y_PADDING * scale;
|
||||
}
|
||||
|
@ -42,6 +42,7 @@ typedef struct ozone_handle ozone_handle_t;
|
||||
#define SIDEBAR_WIDTH 408
|
||||
#define ENTRY_PADDING 67
|
||||
|
||||
#define SIDEBAR_X_PADDING 40
|
||||
#define SIDEBAR_Y_PADDING 20
|
||||
#define ENTRY_HEIGHT 50
|
||||
#define ENTRY_Y_PADDING 10
|
||||
@ -169,6 +170,7 @@ struct ozone_handle
|
||||
int entry_padding;
|
||||
|
||||
int sidebar_entry_height;
|
||||
int sidebar_padding_horizontal;
|
||||
int sidebar_padding_vertical;
|
||||
int sidebar_entry_padding_vertical;
|
||||
} ui_dimensions;
|
||||
|
@ -157,10 +157,12 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
|
||||
|
||||
/* Cursor */
|
||||
if (ozone->cursor_in_sidebar)
|
||||
ozone_draw_cursor(ozone, video_info, ozone->sidebar_offset + 41, ozone->ui_dimensions.sidebar_width - 81, ozone->ui_dimensions.sidebar_entry_height + 2, selection_y + 1 + ozone->animations.scroll_y_sidebar, ozone->animations.cursor_alpha);
|
||||
ozone_draw_cursor(ozone, video_info, ozone->sidebar_offset + ozone->ui_dimensions.sidebar_padding_horizontal, ozone->ui_dimensions.sidebar_width - ozone->ui_dimensions.sidebar_padding_horizontal * 2,
|
||||
ozone->ui_dimensions.sidebar_entry_height + 2, selection_y + 1 + ozone->animations.scroll_y_sidebar, ozone->animations.cursor_alpha);
|
||||
|
||||
if (ozone->cursor_in_sidebar_old)
|
||||
ozone_draw_cursor(ozone, video_info, ozone->sidebar_offset + 41, ozone->ui_dimensions.sidebar_width - 81, ozone->ui_dimensions.sidebar_entry_height + 2, selection_old_y + 1 + ozone->animations.scroll_y_sidebar, 1-ozone->animations.cursor_alpha);
|
||||
ozone_draw_cursor(ozone, video_info, ozone->sidebar_offset + ozone->ui_dimensions.sidebar_padding_horizontal, ozone->ui_dimensions.sidebar_width - ozone->ui_dimensions.sidebar_padding_horizontal * 2,
|
||||
ozone->ui_dimensions.sidebar_entry_height + 2, selection_old_y + 1 + ozone->animations.scroll_y_sidebar, 1-ozone->animations.cursor_alpha);
|
||||
|
||||
/* Menu tabs */
|
||||
y = ozone->ui_dimensions.header_height + 1 + ozone->ui_dimensions.sidebar_padding_vertical;
|
||||
@ -174,13 +176,15 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
|
||||
unsigned icon = ozone_system_tabs_icons[ozone->tabs[i]];
|
||||
|
||||
/* Icon */
|
||||
ozone_draw_icon(video_info, 40, 40, ozone->tab_textures[icon], ozone->sidebar_offset + 41 + 10, y + ozone->ui_dimensions.sidebar_entry_height / 2 - 20 + ozone->animations.scroll_y_sidebar, video_info->width, video_info->height, 0, 1, (selected ? ozone->theme->text_selected : ozone->theme->entries_icon));
|
||||
ozone_draw_icon(video_info, 40, 40, ozone->tab_textures[icon], ozone->sidebar_offset + ozone->ui_dimensions.sidebar_padding_horizontal + 10,
|
||||
y + ozone->ui_dimensions.sidebar_entry_height / 2 - 20 + ozone->animations.scroll_y_sidebar, video_info->width, video_info->height, 0, 1, (selected ? ozone->theme->text_selected : ozone->theme->entries_icon));
|
||||
|
||||
value_idx = ozone_system_tabs_value[ozone->tabs[i]];
|
||||
title = msg_hash_to_str(value_idx);
|
||||
|
||||
/* Text */
|
||||
ozone_draw_text(video_info, ozone, title, ozone->sidebar_offset + 115 - 10, y + ozone->ui_dimensions.sidebar_entry_height / 2 + FONT_SIZE_SIDEBAR * 3/8 + ozone->animations.scroll_y_sidebar, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.sidebar, (selected ? ozone->theme->text_selected_rgba : ozone->theme->text_rgba), true);
|
||||
ozone_draw_text(video_info, ozone, title, ozone->sidebar_offset + ozone->ui_dimensions.sidebar_padding_horizontal + 65,
|
||||
y + ozone->ui_dimensions.sidebar_entry_height / 2 + FONT_SIZE_SIDEBAR * 3/8 + ozone->animations.scroll_y_sidebar, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.sidebar, (selected ? ozone->theme->text_selected_rgba : ozone->theme->text_rgba), true);
|
||||
|
||||
y += ozone->ui_dimensions.sidebar_entry_height + ozone->ui_dimensions.sidebar_entry_padding_vertical;
|
||||
}
|
||||
@ -206,7 +210,8 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
|
||||
goto console_iterate;
|
||||
|
||||
/* Icon */
|
||||
ozone_draw_icon(video_info, 40, 40, node->icon, ozone->sidebar_offset + 41 + 10 - 3, y + ozone->ui_dimensions.sidebar_entry_height / 2 - 20 + ozone->animations.scroll_y_sidebar, video_info->width, video_info->height, 0, 1, (selected ? ozone->theme->text_selected : ozone->theme->entries_icon));
|
||||
ozone_draw_icon(video_info, 40, 40, node->icon, ozone->sidebar_offset + ozone->ui_dimensions.sidebar_padding_horizontal + 10 - 3,
|
||||
y + ozone->ui_dimensions.sidebar_entry_height / 2 - 20 + ozone->animations.scroll_y_sidebar, video_info->width, video_info->height, 0, 1, (selected ? ozone->theme->text_selected : ozone->theme->entries_icon));
|
||||
|
||||
/* Text */
|
||||
ticker.idx = ozone->frame_count / 20;
|
||||
@ -217,8 +222,9 @@ void ozone_draw_sidebar(ozone_handle_t *ozone, video_frame_info_t *video_info)
|
||||
|
||||
menu_animation_ticker(&ticker);
|
||||
|
||||
ozone_draw_text(video_info, ozone, console_title, ozone->sidebar_offset + 115 - 10, y + ozone->ui_dimensions.sidebar_entry_height / 2 + FONT_SIZE_SIDEBAR * 3/8 +
|
||||
ozone->animations.scroll_y_sidebar, TEXT_ALIGN_LEFT, video_info->width, video_info->height, ozone->fonts.sidebar, (selected ? ozone->theme->text_selected_rgba : ozone->theme->text_rgba), true);
|
||||
ozone_draw_text(video_info, ozone, console_title, ozone->sidebar_offset + ozone->ui_dimensions.sidebar_padding_horizontal + 65,
|
||||
y + ozone->ui_dimensions.sidebar_entry_height / 2 + FONT_SIZE_SIDEBAR * 3/8 + ozone->animations.scroll_y_sidebar, TEXT_ALIGN_LEFT,
|
||||
video_info->width, video_info->height, ozone->fonts.sidebar, (selected ? ozone->theme->text_selected_rgba : ozone->theme->text_rgba), true);
|
||||
|
||||
console_iterate:
|
||||
y += ozone->ui_dimensions.sidebar_entry_height + ozone->ui_dimensions.sidebar_entry_padding_vertical;
|
||||
|
Loading…
x
Reference in New Issue
Block a user