Make filler variant button inactive
authorH.G. Muller <h.g.muller@hccnet.nl>
Thu, 5 Dec 2013 19:08:35 +0000 (20:08 +0100)
committerH.G. Muller <h.g.muller@hccnet.nl>
Thu, 5 Dec 2013 19:19:28 +0000 (20:19 +0100)
dialogs.c
gtk/xoptions.c
xaw/xoptions.c

index ad164ce..eea4e7c 100644 (file)
--- 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 , "" }
 };
index 7a03ffb..90a45ea 100644 (file)
@@ -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);
index 5d00290..f74d673 100644 (file)
@@ -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*)