e mousebindings config: show correct mouse button name and icon according to selected holding hand.

SVN revision: 81055
This commit is contained in:
Chidambar Zinnoury 2012-12-16 19:55:10 +00:00
parent 34906754b8
commit 2475c840cc
1 changed files with 33 additions and 7 deletions

View File

@ -762,7 +762,12 @@ _update_mouse_binding_list(E_Config_Dialog_Data *cfdata)
switch (eb->button) switch (eb->button)
{ {
case 1: case 1:
icon = "preferences-desktop-mouse-left"; if (e_config->mouse_hand == E_MOUSE_HAND_RIGHT)
icon = "preferences-desktop-mouse-left";
else if (e_config->mouse_hand == E_MOUSE_HAND_LEFT)
icon = "preferences-desktop-mouse-right";
else
icon = "preferences-desktop-mouse-extra";
break; break;
case 2: case 2:
@ -770,7 +775,12 @@ _update_mouse_binding_list(E_Config_Dialog_Data *cfdata)
break; break;
case 3: case 3:
icon = "preferences-desktop-mouse-right"; if (e_config->mouse_hand == E_MOUSE_HAND_RIGHT)
icon = "preferences-desktop-mouse-right";
else if (e_config->mouse_hand == E_MOUSE_HAND_LEFT)
icon = "preferences-desktop-mouse-left";
else
icon = "preferences-desktop-mouse-extra";
break; break;
default: default:
@ -1159,20 +1169,36 @@ static char *
_helper_button_name_get(E_Config_Binding_Mouse *eb) _helper_button_name_get(E_Config_Binding_Mouse *eb)
{ {
char *name = NULL; char *name = NULL;
char buf[1024] = ""; char buf[1024];
switch (eb->button) switch (eb->button)
{ {
case 1: case 1:
name = strdup(_("Left Button")); if (e_config->mouse_hand == E_MOUSE_HAND_RIGHT)
name = strdup(_("Left button"));
else if (e_config->mouse_hand == E_MOUSE_HAND_LEFT)
name = strdup(_("Right button"));
else
{
snprintf(buf, sizeof(buf), _("Button %i"), eb->button);
name = strdup(buf);
}
break; break;
case 2: case 2:
name = strdup(_("Middle Button")); name = strdup(_("Middle button"));
break; break;
case 3: case 3:
name = strdup(_("Right Button")); if (e_config->mouse_hand == E_MOUSE_HAND_RIGHT)
name = strdup(_("Right button"));
else if (e_config->mouse_hand == E_MOUSE_HAND_LEFT)
name = strdup(_("Left button"));
else
{
snprintf(buf, sizeof(buf), _("Button %i"), eb->button);
name = strdup(buf);
}
break; break;
case 4: case 4:
@ -1182,7 +1208,7 @@ _helper_button_name_get(E_Config_Binding_Mouse *eb)
break; break;
default: default:
snprintf(buf, sizeof(buf), _("Extra Button (%d)"), eb->button); snprintf(buf, sizeof(buf), _("Extra button (%d)"), eb->button);
name = strdup(buf); name = strdup(buf);
} }
return name; return name;