mirror of
https://github.com/gryf/wmaker.git
synced 2026-01-22 15:04:13 +01:00
WINGs: changed use of 'if' on panel->rgbState into a switch
This allow compiler to raise a warning in case a new value would be added to the enum; it also change order in the check so that WMGetButtonSelected will be called only once, only for the case of interest. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
963b4b2b78
commit
39181154ab
@@ -2480,19 +2480,26 @@ static void rgbDecToHex(WMWidget *w, void *data)
|
|||||||
|
|
||||||
(void) w;
|
(void) w;
|
||||||
|
|
||||||
if (WMGetButtonSelected(panel->rgbDecB) && panel->rgbState == RGBhex) {
|
switch (panel->rgbState) {
|
||||||
WMSetLabelText(panel->rgbMaxL, "255");
|
case RGBhex:
|
||||||
WMRedisplayWidget(panel->rgbMaxL);
|
if (WMGetButtonSelected(panel->rgbDecB)) {
|
||||||
value = rgbCharToInt(panel);
|
WMSetLabelText(panel->rgbMaxL, "255");
|
||||||
panel->rgbState = RGBdec;
|
WMRedisplayWidget(panel->rgbMaxL);
|
||||||
rgbIntToChar(panel, value);
|
value = rgbCharToInt(panel);
|
||||||
}
|
panel->rgbState = RGBdec;
|
||||||
if (WMGetButtonSelected(panel->rgbHexB) && panel->rgbState == RGBdec) {
|
rgbIntToChar(panel, value);
|
||||||
WMSetLabelText(panel->rgbMaxL, "FF");
|
}
|
||||||
WMRedisplayWidget(panel->rgbMaxL);
|
break;
|
||||||
value = rgbCharToInt(panel);
|
|
||||||
panel->rgbState = RGBhex;
|
case RGBdec:
|
||||||
rgbIntToChar(panel, value);
|
if (WMGetButtonSelected(panel->rgbHexB)) {
|
||||||
|
WMSetLabelText(panel->rgbMaxL, "FF");
|
||||||
|
WMRedisplayWidget(panel->rgbMaxL);
|
||||||
|
value = rgbCharToInt(panel);
|
||||||
|
panel->rgbState = RGBhex;
|
||||||
|
rgbIntToChar(panel, value);
|
||||||
|
}
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user