mirror of
git://xwords.git.sourceforge.net/gitroot/xwords/xwords
synced 2025-01-03 23:04:08 +01:00
make hint buttons en/disabled based on board_canHint() results.
This commit is contained in:
parent
8a7029435c
commit
bf0582f0aa
2 changed files with 9 additions and 0 deletions
|
@ -1018,6 +1018,10 @@ disenable_buttons( GtkAppGlobals* globals )
|
||||||
XP_Bool canToggle = board_canTogglePending( globals->cGlobals.game.board );
|
XP_Bool canToggle = board_canTogglePending( globals->cGlobals.game.board );
|
||||||
gtk_widget_set_sensitive( globals->toggle_undo_button, canToggle );
|
gtk_widget_set_sensitive( globals->toggle_undo_button, canToggle );
|
||||||
|
|
||||||
|
XP_Bool canHing = board_canHint( globals->cGlobals.game.board );
|
||||||
|
gtk_widget_set_sensitive( globals->prevhint_button, canHing );
|
||||||
|
gtk_widget_set_sensitive( globals->nexthint_button, canHing );
|
||||||
|
|
||||||
XP_Bool canChat = !!globals->cGlobals.game.comms
|
XP_Bool canChat = !!globals->cGlobals.game.comms
|
||||||
&& comms_canChat( globals->cGlobals.game.comms );
|
&& comms_canChat( globals->cGlobals.game.comms );
|
||||||
gtk_widget_set_sensitive( globals->chat_button, canChat );
|
gtk_widget_set_sensitive( globals->chat_button, canChat );
|
||||||
|
@ -1754,9 +1758,11 @@ makeVerticalBar( GtkAppGlobals* globals, GtkWidget* XP_UNUSED(window) )
|
||||||
|
|
||||||
button = makeShowButtonFromBitmap( globals, "../hint.xpm", "?-",
|
button = makeShowButtonFromBitmap( globals, "../hint.xpm", "?-",
|
||||||
G_CALLBACK(handle_prevhint_button) );
|
G_CALLBACK(handle_prevhint_button) );
|
||||||
|
globals->prevhint_button = button;
|
||||||
gtk_box_pack_start( GTK_BOX(vbox), button, FALSE, TRUE, 0 );
|
gtk_box_pack_start( GTK_BOX(vbox), button, FALSE, TRUE, 0 );
|
||||||
button = makeShowButtonFromBitmap( globals, "../hint.xpm", "?+",
|
button = makeShowButtonFromBitmap( globals, "../hint.xpm", "?+",
|
||||||
G_CALLBACK(handle_nexthint_button) );
|
G_CALLBACK(handle_nexthint_button) );
|
||||||
|
globals->nexthint_button = button;
|
||||||
gtk_box_pack_start( GTK_BOX(vbox), button, FALSE, TRUE, 0 );
|
gtk_box_pack_start( GTK_BOX(vbox), button, FALSE, TRUE, 0 );
|
||||||
|
|
||||||
button = makeShowButtonFromBitmap( globals, "../hintNum.xpm", "n",
|
button = makeShowButtonFromBitmap( globals, "../hintNum.xpm", "n",
|
||||||
|
|
|
@ -95,6 +95,9 @@ typedef struct GtkAppGlobals {
|
||||||
GtkWidget* zoomin_button;
|
GtkWidget* zoomin_button;
|
||||||
GtkWidget* zoomout_button;
|
GtkWidget* zoomout_button;
|
||||||
GtkWidget* toggle_undo_button;
|
GtkWidget* toggle_undo_button;
|
||||||
|
GtkWidget* prevhint_button;
|
||||||
|
GtkWidget* nexthint_button;
|
||||||
|
|
||||||
#ifdef XWFEATURE_CHAT
|
#ifdef XWFEATURE_CHAT
|
||||||
GtkWidget* chat_button;
|
GtkWidget* chat_button;
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in a new issue