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

@ -2249,6 +2249,7 @@ void Button_Draw_switch_mode(void)
break; break;
} }
Display_sprite_in_menu(BUTTON_DRAW,icon); Display_sprite_in_menu(BUTTON_DRAW,icon);
Draw_menu_button(BUTTON_DRAW,BUTTON_PRESSED);
Start_operation_stack(Selected_freehand_mode); Start_operation_stack(Selected_freehand_mode);
Display_cursor(); Display_cursor();
/* NOUVEAU CODE AVEC POPUP (EN COURS DE TEST) *** /* NOUVEAU CODE AVEC POPUP (EN COURS DE TEST) ***
@ -3472,6 +3473,7 @@ void Button_Lines_switch_mode(void)
Hide_cursor(); Hide_cursor();
Display_sprite_in_menu(BUTTON_LINES,icon); Display_sprite_in_menu(BUTTON_LINES,icon);
Draw_menu_button(BUTTON_LINES,BUTTON_PRESSED);
Start_operation_stack(Selected_line_mode); Start_operation_stack(Selected_line_mode);
Display_cursor(); Display_cursor();
} }
@ -3932,6 +3934,7 @@ void Button_Curves_switch_mode(void)
Hide_cursor(); Hide_cursor();
Display_sprite_in_menu(BUTTON_CURVES,Selected_curve_mode==OPERATION_4_POINTS_CURVE?MENU_SPRITE_4_POINTS_CURVE:-1); Display_sprite_in_menu(BUTTON_CURVES,Selected_curve_mode==OPERATION_4_POINTS_CURVE?MENU_SPRITE_4_POINTS_CURVE:-1);
Draw_menu_button(BUTTON_CURVES,BUTTON_PRESSED);
Start_operation_stack(Selected_curve_mode); Start_operation_stack(Selected_curve_mode);
Display_cursor(); Display_cursor();
} }

View File

@ -463,8 +463,19 @@ void Select_button(int btn_number,byte click)
break; break;
} }
if (icon!=-1) 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); 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é) // On note déjà la famille du bouton (La "Famiglia" c'est sacré)
family=Buttons_Pool[btn_number].Family; family=Buttons_Pool[btn_number].Family;

View File

@ -727,6 +727,8 @@ int Init_program(int argc,char * argv[])
Display_paintbrush_in_menu(); Display_paintbrush_in_menu();
Display_sprite_in_menu(BUTTON_PAL_LEFT,Config.Palette_vertical?MENU_SPRITE_VERTICAL_PALETTE_SCROLL:-1); Display_sprite_in_menu(BUTTON_PAL_LEFT,Config.Palette_vertical?MENU_SPRITE_VERTICAL_PALETTE_SCROLL:-1);
Display_menu(); Display_menu();
Draw_menu_button(BUTTON_PAL_LEFT,BUTTON_RELEASED);
Draw_menu_button(BUTTON_PAL_RIGHT,BUTTON_RELEASED);
// On affiche le curseur pour débutter correctement l'état du programme: // On affiche le curseur pour débutter correctement l'état du programme:
Display_cursor(); Display_cursor();

View File

@ -2474,5 +2474,7 @@ void Button_Secondary_palette(void)
Change_palette_cells(); Change_palette_cells();
Display_menu(); Display_menu();
Display_sprite_in_menu(BUTTON_PAL_LEFT,Config.Palette_vertical?MENU_SPRITE_VERTICAL_PALETTE_SCROLL:-1); Display_sprite_in_menu(BUTTON_PAL_LEFT,Config.Palette_vertical?MENU_SPRITE_VERTICAL_PALETTE_SCROLL:-1);
Draw_menu_button(BUTTON_PAL_LEFT,BUTTON_RELEASED);
Draw_menu_button(BUTTON_PAL_RIGHT,BUTTON_RELEASED);
} }
} }