Use function pointers instead of hard-coded english button names in color picker block.
This solves the problem with es/ru translations of color picker block reported by Gabriel Gazzán in Bf-translations-dev.
This commit is contained in:
@@ -2021,27 +2021,20 @@ static void picker_new_hide_reveal(uiBlock *block, short colormode)
|
|||||||
|
|
||||||
/* tag buttons */
|
/* tag buttons */
|
||||||
for (bt = block->buttons.first; bt; bt = bt->next) {
|
for (bt = block->buttons.first; bt; bt = bt->next) {
|
||||||
|
if (bt->func == do_picker_rna_cb && bt->type == NUMSLI) {
|
||||||
if (bt->type == LABEL) {
|
/* RGB sliders (color circle is always shown) */
|
||||||
if (bt->str[1] == 'G') {
|
if (colormode == 0) bt->flag &= ~UI_HIDDEN;
|
||||||
if (colormode == 2) bt->flag &= ~UI_HIDDEN;
|
else bt->flag |= UI_HIDDEN;
|
||||||
else bt->flag |= UI_HIDDEN;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
else if (bt->func == do_hsv_rna_cb) {
|
||||||
if (bt->type == NUMSLI || bt->type == TEX) {
|
/* HSV sliders */
|
||||||
if (bt->str[1] == 'e') {
|
if (colormode == 1) bt->flag &= ~UI_HIDDEN;
|
||||||
if (colormode == 2) bt->flag &= ~UI_HIDDEN;
|
else bt->flag |= UI_HIDDEN;
|
||||||
else bt->flag |= UI_HIDDEN;
|
}
|
||||||
}
|
else if (bt->func == do_hex_rna_cb || bt->type == LABEL) {
|
||||||
else if (ELEM3(bt->str[0], 'R', 'G', 'B')) {
|
/* hex input or gamma correction status label */
|
||||||
if (colormode == 0) bt->flag &= ~UI_HIDDEN;
|
if (colormode == 2) bt->flag &= ~UI_HIDDEN;
|
||||||
else bt->flag |= UI_HIDDEN;
|
else bt->flag |= UI_HIDDEN;
|
||||||
}
|
|
||||||
else if (ELEM3(bt->str[0], 'H', 'S', 'V')) {
|
|
||||||
if (colormode == 1) bt->flag &= ~UI_HIDDEN;
|
|
||||||
else bt->flag |= UI_HIDDEN;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user