mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2024-12-29 10:26:36 +01:00
use board_canTogglePending to disable button
This commit is contained in:
parent
5f92491ca3
commit
3452666231
2 changed files with 4 additions and 10 deletions
|
@ -997,6 +997,9 @@ disenable_buttons( GtkAppGlobals* globals )
|
|||
{
|
||||
XP_Bool canFlip = board_canFlip( globals->cGlobals.game.board );
|
||||
gtk_widget_set_sensitive( globals->flip_button, canFlip );
|
||||
|
||||
XP_Bool canToggle = board_canTogglePending( globals->cGlobals.game.board );
|
||||
gtk_widget_set_sensitive( globals->toggle_undo_button, canToggle );
|
||||
}
|
||||
|
||||
static gboolean
|
||||
|
@ -1085,15 +1088,7 @@ handle_toggle_undo( GtkWidget* XP_UNUSED(widget),
|
|||
GtkAppGlobals* globals )
|
||||
{
|
||||
BoardCtxt* board = globals->cGlobals.game.board;
|
||||
XP_Bool draw = XP_FALSE;
|
||||
|
||||
if ( globals->didReplace ) {
|
||||
draw = board_redoReplacedTiles( board );
|
||||
} else {
|
||||
draw = board_replaceTiles( board );
|
||||
}
|
||||
globals->didReplace = !globals->didReplace;
|
||||
if ( draw ) {
|
||||
if ( board_redoReplacedTiles( board ) || board_replaceTiles( board ) ) {
|
||||
board_draw( board );
|
||||
}
|
||||
}
|
||||
|
|
|
@ -91,7 +91,6 @@ typedef struct GtkAppGlobals {
|
|||
GtkWidget* zoomin_button;
|
||||
GtkWidget* zoomout_button;
|
||||
GtkWidget* toggle_undo_button;
|
||||
XP_Bool didReplace;
|
||||
|
||||
EngineCtxt* engine;
|
||||
|
||||
|
|
Loading…
Reference in a new issue