mirror of
https://github.com/libretro/RetroArch
synced 2025-02-11 15:40:28 +00:00
Improve OSK look in GLUI
This commit is contained in:
parent
5a6a2be859
commit
5bdd9533e7
@ -68,6 +68,8 @@ enum
|
|||||||
MUI_TEXTURE_TAB_MAIN,
|
MUI_TEXTURE_TAB_MAIN,
|
||||||
MUI_TEXTURE_TAB_PLAYLISTS,
|
MUI_TEXTURE_TAB_PLAYLISTS,
|
||||||
MUI_TEXTURE_TAB_SETTINGS,
|
MUI_TEXTURE_TAB_SETTINGS,
|
||||||
|
MUI_TEXTURE_KEY,
|
||||||
|
MUI_TEXTURE_KEY_HOVER,
|
||||||
MUI_TEXTURE_LAST
|
MUI_TEXTURE_LAST
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -151,6 +153,10 @@ static const char *mui_texture_path(unsigned id)
|
|||||||
return "playlists_tab_passive.png";
|
return "playlists_tab_passive.png";
|
||||||
case MUI_TEXTURE_TAB_SETTINGS:
|
case MUI_TEXTURE_TAB_SETTINGS:
|
||||||
return "settings_tab_passive.png";
|
return "settings_tab_passive.png";
|
||||||
|
case MUI_TEXTURE_KEY:
|
||||||
|
return "key.png";
|
||||||
|
case MUI_TEXTURE_KEY_HOVER:
|
||||||
|
return "key-hover.png";
|
||||||
}
|
}
|
||||||
|
|
||||||
return NULL;
|
return NULL;
|
||||||
@ -275,17 +281,17 @@ static void mui_render_keyboard(mui_handle_t *mui, const char *grid[], unsigned
|
|||||||
{
|
{
|
||||||
unsigned i, width, height;
|
unsigned i, width, height;
|
||||||
float dark[16]= {
|
float dark[16]= {
|
||||||
0.00, 0.00, 0.00, 0.75,
|
0.00, 0.00, 0.00, 0.85,
|
||||||
0.00, 0.00, 0.00, 0.75,
|
0.00, 0.00, 0.00, 0.85,
|
||||||
0.00, 0.00, 0.00, 0.75,
|
0.00, 0.00, 0.00, 0.85,
|
||||||
0.00, 0.00, 0.00, 0.75,
|
0.00, 0.00, 0.00, 0.85,
|
||||||
};
|
};
|
||||||
|
|
||||||
float light[16]= {
|
float white[16]= {
|
||||||
1.00, 1.00, 1.00, 0.5,
|
1.00, 1.00, 1.00, 1.00,
|
||||||
1.00, 1.00, 1.00, 0.5,
|
1.00, 1.00, 1.00, 1.00,
|
||||||
1.00, 1.00, 1.00, 0.5,
|
1.00, 1.00, 1.00, 1.00,
|
||||||
1.00, 1.00, 1.00, 0.5,
|
1.00, 1.00, 1.00, 1.00,
|
||||||
};
|
};
|
||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
video_driver_get_size(&width, &height);
|
||||||
@ -294,23 +300,29 @@ static void mui_render_keyboard(mui_handle_t *mui, const char *grid[], unsigned
|
|||||||
width, height,
|
width, height,
|
||||||
&dark[0]);
|
&dark[0]);
|
||||||
|
|
||||||
for (i = 0; i <= 44; i++)
|
int ptr_width = height / 10;
|
||||||
{
|
|
||||||
int line_y;
|
|
||||||
int ptr_width = height / 13;
|
|
||||||
line_y = (i / 11)*height/10.0;
|
|
||||||
|
|
||||||
|
for (i = 0; i < 44; i++)
|
||||||
|
{
|
||||||
|
int line_y = (i / 11)*height/10.0;
|
||||||
|
|
||||||
|
uintptr_t texture = mui->textures.list[MUI_TEXTURE_KEY];
|
||||||
if (i == id)
|
if (i == id)
|
||||||
menu_display_draw_quad(
|
texture = mui->textures.list[MUI_TEXTURE_KEY_HOVER];
|
||||||
width/12.0 + (i % 11) * width/12.0 - ptr_width/2,
|
|
||||||
height*2.5/4.0 + line_y - ptr_width/2 - mui->font->size / 4,
|
menu_display_blend_begin();
|
||||||
ptr_width, ptr_width,
|
|
||||||
width, height,
|
menu_display_draw_texture(
|
||||||
&light[0]);
|
width/2.0 - (11*ptr_width)/2.0 + (i % 11) * ptr_width,
|
||||||
|
height/2.0 + ptr_width*1.5 + line_y,
|
||||||
|
ptr_width, ptr_width,
|
||||||
|
width, height,
|
||||||
|
&white[0],
|
||||||
|
texture);
|
||||||
|
|
||||||
mui_draw_text(mui->font,
|
mui_draw_text(mui->font,
|
||||||
width/12.0 + (i % 11) * width/12.0,
|
width/2.0 - (11*ptr_width)/2.0 + (i % 11) * ptr_width + ptr_width/2.0,
|
||||||
height*2.5/4.0 + line_y,
|
height/2.0 + ptr_width + line_y,
|
||||||
width, height, grid[i], 0xffffffff, TEXT_ALIGN_CENTER);
|
width, height, grid[i], 0xffffffff, TEXT_ALIGN_CENTER);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -326,12 +338,12 @@ static int mui_osk_ptr_at_pos(void *data, int x, int y)
|
|||||||
|
|
||||||
video_driver_get_size(&width, &height);
|
video_driver_get_size(&width, &height);
|
||||||
|
|
||||||
for (i = 0; i <= 44; i++)
|
for (i = 0; i < 44; i++)
|
||||||
{
|
{
|
||||||
int ptr_width = height / 13;
|
int ptr_width = height / 10;
|
||||||
int line_y = (i / 11)*height/10.0;
|
int line_y = (i / 11)*height/10.0;
|
||||||
int ptr_x = width/12.0 + (i % 11) * width/12.0 - ptr_width/2;
|
int ptr_x = width/2.0 - (11*ptr_width)/2.0 + (i % 11) * ptr_width;
|
||||||
int ptr_y = height*2.5/4.0 + line_y - ptr_width/2 - mui->font->size / 4;
|
int ptr_y = height/2.0 + ptr_width*1.5 + line_y - ptr_width;
|
||||||
|
|
||||||
if (x > ptr_x && x < ptr_x + ptr_width
|
if (x > ptr_x && x < ptr_x + ptr_width
|
||||||
&& y > ptr_y && y < ptr_y + ptr_width)
|
&& y > ptr_y && y < ptr_y + ptr_width)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user