From: H.G. Muller Date: Thu, 5 Dec 2013 19:08:35 +0000 (+0100) Subject: Make filler variant button inactive X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=e80441fef1fb20a575aec0ffa9d54902b5729444;p=xboard.git Make filler variant button inactive --- diff --git a/dialogs.c b/dialogs.c index ad164ce..eea4e7c 100644 --- a/dialogs.c +++ b/dialogs.c @@ -444,7 +444,7 @@ static Option variantDescriptors[] = { { VariantShogi, SAME_ROW, 135, NULL, (void*) &Pick, "#BFFFFF", NULL, Button, N_("shogi (9x9)")}, { VariantSpartan, 0, 135, NULL, (void*) &Pick, "#FF0000", NULL, Button, N_("Spartan")}, { VariantXiangqi, SAME_ROW,135, NULL, (void*) &Pick, "#BFFFFF", NULL, Button, N_("xiangqi (9x10)")}, -{ VariantNormal, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_(" ")}, // dummy, to have good alignment +{ -1, 0, 135, NULL, (void*) &Pick, "#FFFFFF", NULL, Button, N_(" ")}, // dummy, to have good alignment { VariantCourier, SAME_ROW,135, NULL, (void*) &Pick, "#BFFFBF", NULL, Button, N_("courier (12x8)")}, { 0, NO_OK, 0, NULL, NULL, "", NULL, EndMark , "" } }; diff --git a/gtk/xoptions.c b/gtk/xoptions.c index 7a03ffb..90a45ea 100644 --- a/gtk/xoptions.c +++ b/gtk/xoptions.c @@ -1341,8 +1341,8 @@ if(appData.debugMode) printf("n=%d, h=%d, w=%d\n",n,height,width); if(option[i].textValue) { gdk_color_parse( option[i].textValue, &color ); gtk_widget_modify_bg ( GTK_WIDGET(button), GTK_STATE_NORMAL, &color ); - gtk_widget_set_sensitive(button, appData.noChessProgram || option[i].value < 0 - || strstr(first.variants, VariantName(option[i].value))); + gtk_widget_set_sensitive(button, option[i].value >= 0 && (appData.noChessProgram + || strstr(first.variants, VariantName(option[i].value)))); } Pack(hbox, table, button, left, left+1, top, 0); diff --git a/xaw/xoptions.c b/xaw/xoptions.c index 5d00290..f74d673 100644 --- a/xaw/xoptions.c +++ b/xaw/xoptions.c @@ -1080,8 +1080,8 @@ GenericPopUp (Option *option, char *title, DialogClass dlgNr, DialogClass parent option[i].max /* w */, shrink ? textHeight : 0 /* h */, option[i].min & 0xE | chain /* chain */); XtSetArg(args[j], XtNlabel, _(option[i].name)); j++; if(option[i].textValue) { // special for buttons of New Variant dialog - XtSetArg(args[j], XtNsensitive, appData.noChessProgram || option[i].value < 0 - || strstr(first.variants, VariantName(option[i].value))); j++; + XtSetArg(args[j], XtNsensitive, option[i].value >= 0 && (appData.noChessProgram + || strstr(first.variants, VariantName(option[i].value)))); j++; XtSetArg(args[j], XtNborderWidth, (gameInfo.variant == option[i].value)+1); j++; } option[i].handle = (void*)