From ba1aefcd4919f727e4a5652e899f17ee772bcc18 Mon Sep 17 00:00:00 2001 From: ehouse Date: Fri, 12 May 2006 07:59:21 +0000 Subject: [PATCH] make tray hide button toggle hidden state --- xwords4/linux/gtkmain.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/xwords4/linux/gtkmain.c b/xwords4/linux/gtkmain.c index 2cf3d9ad0..d062242b1 100644 --- a/xwords4/linux/gtkmain.c +++ b/xwords4/linux/gtkmain.c @@ -861,16 +861,25 @@ handle_grid_button( GtkWidget* widget, GtkAppGlobals* globals ) static void handle_hide_button( GtkWidget* widget, GtkAppGlobals* globals ) { - if ( globals->cGlobals.params->trayOverlaps ) { - globals->adjustment->page_size = MAX_ROWS; - globals->adjustment->value = 0.0; + BoardCtxt* board; + XP_Bool draw = XP_FALSE; - gtk_signal_emit_by_name( GTK_OBJECT(globals->adjustment), "changed" ); - gtk_adjustment_value_changed( GTK_ADJUSTMENT(globals->adjustment) ); + if ( globals->cGlobals.params->trayOverlaps ) { + globals->adjustment->page_size = MAX_ROWS; + globals->adjustment->value = 0.0; + + gtk_signal_emit_by_name( GTK_OBJECT(globals->adjustment), "changed" ); + gtk_adjustment_value_changed( GTK_ADJUSTMENT(globals->adjustment) ); } -/* board_setTrayVisible( globals->board, XP_FALSE, XP_TRUE ); */ - if ( board_hideTray( globals->cGlobals.game.board ) ) { - board_draw( globals->cGlobals.game.board ); + + board = globals->cGlobals.game.board; + if ( TRAY_REVEALED == board_getTrayVisState( board ) ) { + draw = board_hideTray( board ); + } else { + draw = board_showTray( board ); + } + if ( draw ) { + board_draw( board ); } } /* handle_hide_button */