mirror of
https://github.com/libretro/RetroArch
synced 2025-02-06 18:40:49 +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_PLAYLISTS,
|
||||
MUI_TEXTURE_TAB_SETTINGS,
|
||||
MUI_TEXTURE_KEY,
|
||||
MUI_TEXTURE_KEY_HOVER,
|
||||
MUI_TEXTURE_LAST
|
||||
};
|
||||
|
||||
@ -151,6 +153,10 @@ static const char *mui_texture_path(unsigned id)
|
||||
return "playlists_tab_passive.png";
|
||||
case MUI_TEXTURE_TAB_SETTINGS:
|
||||
return "settings_tab_passive.png";
|
||||
case MUI_TEXTURE_KEY:
|
||||
return "key.png";
|
||||
case MUI_TEXTURE_KEY_HOVER:
|
||||
return "key-hover.png";
|
||||
}
|
||||
|
||||
return NULL;
|
||||
@ -275,17 +281,17 @@ static void mui_render_keyboard(mui_handle_t *mui, const char *grid[], unsigned
|
||||
{
|
||||
unsigned i, width, height;
|
||||
float dark[16]= {
|
||||
0.00, 0.00, 0.00, 0.75,
|
||||
0.00, 0.00, 0.00, 0.75,
|
||||
0.00, 0.00, 0.00, 0.75,
|
||||
0.00, 0.00, 0.00, 0.75,
|
||||
0.00, 0.00, 0.00, 0.85,
|
||||
0.00, 0.00, 0.00, 0.85,
|
||||
0.00, 0.00, 0.00, 0.85,
|
||||
0.00, 0.00, 0.00, 0.85,
|
||||
};
|
||||
|
||||
float light[16]= {
|
||||
1.00, 1.00, 1.00, 0.5,
|
||||
1.00, 1.00, 1.00, 0.5,
|
||||
1.00, 1.00, 1.00, 0.5,
|
||||
1.00, 1.00, 1.00, 0.5,
|
||||
float white[16]= {
|
||||
1.00, 1.00, 1.00, 1.00,
|
||||
1.00, 1.00, 1.00, 1.00,
|
||||
1.00, 1.00, 1.00, 1.00,
|
||||
1.00, 1.00, 1.00, 1.00,
|
||||
};
|
||||
|
||||
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,
|
||||
&dark[0]);
|
||||
|
||||
for (i = 0; i <= 44; i++)
|
||||
{
|
||||
int line_y;
|
||||
int ptr_width = height / 13;
|
||||
line_y = (i / 11)*height/10.0;
|
||||
int ptr_width = height / 10;
|
||||
|
||||
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)
|
||||
menu_display_draw_quad(
|
||||
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,
|
||||
ptr_width, ptr_width,
|
||||
width, height,
|
||||
&light[0]);
|
||||
texture = mui->textures.list[MUI_TEXTURE_KEY_HOVER];
|
||||
|
||||
menu_display_blend_begin();
|
||||
|
||||
menu_display_draw_texture(
|
||||
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,
|
||||
width/12.0 + (i % 11) * width/12.0,
|
||||
height*2.5/4.0 + line_y,
|
||||
width/2.0 - (11*ptr_width)/2.0 + (i % 11) * ptr_width + ptr_width/2.0,
|
||||
height/2.0 + ptr_width + line_y,
|
||||
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);
|
||||
|
||||
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 ptr_x = width/12.0 + (i % 11) * width/12.0 - ptr_width/2;
|
||||
int ptr_y = height*2.5/4.0 + line_y - ptr_width/2 - mui->font->size / 4;
|
||||
int ptr_x = width/2.0 - (11*ptr_width)/2.0 + (i % 11) * ptr_width;
|
||||
int ptr_y = height/2.0 + ptr_width*1.5 + line_y - ptr_width;
|
||||
|
||||
if (x > ptr_x && x < ptr_x + ptr_width
|
||||
&& y > ptr_y && y < ptr_y + ptr_width)
|
||||
|
Loading…
x
Reference in New Issue
Block a user