Can now press driver options

This commit is contained in:
twinaphex 2015-10-28 15:56:45 +01:00
parent 5fef315cb1
commit 85ff9e5418
4 changed files with 29 additions and 7 deletions

View File

@ -365,7 +365,7 @@ static int disk_options_disk_idx_right(unsigned type, const char *label,
return 0;
}
static int bind_right_generic(unsigned type, const char *label,
int bind_right_generic(unsigned type, const char *label,
bool wraparound)
{
return menu_setting_set(type, label, MENU_ACTION_RIGHT, wraparound);

View File

@ -95,6 +95,12 @@ static int action_select_directory(const char *path, const char *label, unsigned
return action_ok_directory_push(path, label, type, idx, 0 /* ignored */);
}
static int action_select_driver_setting(const char *path, const char *label, unsigned type,
size_t idx)
{
return bind_right_generic(type, label, true);
}
static int action_select_core_setting(const char *path, const char *label, unsigned type,
size_t idx)
{
@ -186,6 +192,17 @@ int menu_cbs_init_bind_select(menu_file_list_cbs_t *cbs,
BIND_ACTION_SELECT(cbs, action_select_default);
if (cbs->setting)
{
uint64_t flags = menu_setting_get_flags(cbs->setting);
if (flags & SD_FLAG_IS_DRIVER)
{
BIND_ACTION_SELECT(cbs, action_select_driver_setting);
return 0;
}
}
if ((type >= MENU_SETTINGS_CORE_OPTION_START))
{
BIND_ACTION_SELECT(cbs, action_select_core_setting);

View File

@ -132,15 +132,12 @@ static void glui_draw_icon(gl_t *gl, glui_handle_t *glui,
float rotation, float scale_factor,
GRfloat *color)
{
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
if (gl->shader && gl->shader->use)
gl->shader->use(gl, GL_SHADER_STOCK_BLEND);
struct gfx_coords coords;
math_matrix_4x4 mymat, mrot, mscal;
glEnable(GL_BLEND);
glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA);
matrix_4x4_rotate_z(&mrot, rotation);
matrix_4x4_multiply(&mymat, &mrot, &gl->mvp_no_rot);
@ -653,6 +650,7 @@ static void glui_frame(void)
if (!menu_navigation_ctl(MENU_NAVIGATION_CTL_GET_SELECTION, &selection))
return;
/* highlighted entry */
glui_render_quad(gl, 0,
header_height - menu->scroll_y + glui->line_height *
selection, width, glui->line_height,
@ -667,11 +665,13 @@ static void glui_frame(void)
menu_animation_ctl(MENU_ANIMATION_CTL_SET_ACTIVE, NULL);
/* header */
glui_render_quad(gl, 0, 0, width,
header_height,
width, height,
&blue_bg[0]);
/* shadow underneath header */
glui_render_quad(gl, 0, header_height, width,
header_height/12,
width, height,
@ -689,6 +689,8 @@ static void glui_frame(void)
ticker_limit = (width - glui->margin*2) / glui->glyph_width;
menu_animation_ticker_str(title_buf, ticker_limit,
*frame_count / 100, title, true);
/* Title */
glui_blit_line(title_margin, 0, width, height, title_buf,
title_color, TEXT_ALIGN_LEFT);

View File

@ -194,6 +194,9 @@ int action_scan_directory(const char *path,
int action_scan_file(const char *path,
const char *label, unsigned type, size_t idx);
int bind_right_generic(unsigned type, const char *label,
bool wraparound);
void menu_cbs_init(void *data,
menu_file_list_cbs_t *cbs,
const char *path, const char *label,