Fixes missing icon updates: On tool toggle (line,freehand,curve), On split buttons (ellipses, polygons), Palette scroll arrows (vertical or horizontal). Only missing: on skin change

git-svn-id: svn://pulkomandy.tk/GrafX2/trunk@1497 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Yves Rizoud
2010-06-07 18:47:08 +00:00
parent 14557f8f02
commit 038d1bc0f6
4 changed files with 18 additions and 0 deletions

View File

@@ -463,8 +463,19 @@ void Select_button(int btn_number,byte click)
break;
}
if (icon!=-1)
{
// This changes the sprite number of both halves of a split button
Display_sprite_in_menu(btn_number,click==RIGHT_SIDE?icon:-1);
// Redraw the other half if Unselect_button() won't do it.
if (Buttons_Pool[btn_number].Shape==BUTTON_SHAPE_TRIANGLE_TOP_LEFT &&
!Buttons_Pool[btn_number+1].Pressed)
Draw_menu_button(btn_number+1, BUTTON_RELEASED);
else if (Buttons_Pool[btn_number].Shape==BUTTON_SHAPE_TRIANGLE_BOTTOM_RIGHT &&
!Buttons_Pool[btn_number-1].Pressed)
Draw_menu_button(btn_number-1, BUTTON_RELEASED);
}
// On note déjà la famille du bouton (La "Famiglia" c'est sacré)
family=Buttons_Pool[btn_number].Family;