Fix T96481: make color picker RGB display consistent

Show RGB value "1.000" instead of "1", jus like HSV mode. Also uses full labels
"Red", "Green" and "Blue" rather than the shortened labels "R", "G" and "B",
for both RGB and HSV.

Differential Revision: https://developer.blender.org/D14387
This commit is contained in:
Hallam Roberts 2022-11-11 15:50:35 +01:00 committed by Brecht Van Lommel
parent ff7645c5ed
commit 8799ab201d
Notes: blender-bot 2023-02-13 15:59:21 +01:00
Referenced by issue #96481, RBGA and HSV color wheel value displaying different each other
1 changed files with 14 additions and 14 deletions

View File

@ -199,7 +199,7 @@ static void ui_update_color_picker_buts_rgb(uiBut *from_but,
* push, so disable it on RNA buttons in the color picker block */
UI_but_flag_disable(bt, UI_BUT_UNDO);
}
else if (STREQ(bt->str, "Hex: ")) {
else if (STREQ(bt->str, "Hex:")) {
float rgb_hex[3];
uchar rgb_hex_uchar[3];
char col[16];
@ -613,7 +613,7 @@ static void ui_block_colorpicker(uiBlock *block,
bt = uiDefButR_prop(block,
UI_BTYPE_NUM_SLIDER,
0,
IFACE_("R:"),
IFACE_("Red:"),
0,
yco,
butwidth,
@ -623,7 +623,7 @@ static void ui_block_colorpicker(uiBlock *block,
0,
0.0,
0.0,
0,
10,
3,
TIP_("Red"));
UI_but_func_set(bt, ui_colorpicker_rgba_update_cb, bt, nullptr);
@ -631,7 +631,7 @@ static void ui_block_colorpicker(uiBlock *block,
bt = uiDefButR_prop(block,
UI_BTYPE_NUM_SLIDER,
0,
IFACE_("G:"),
IFACE_("Green:"),
0,
yco -= UI_UNIT_Y,
butwidth,
@ -641,7 +641,7 @@ static void ui_block_colorpicker(uiBlock *block,
1,
0.0,
0.0,
0,
10,
3,
TIP_("Green"));
UI_but_func_set(bt, ui_colorpicker_rgba_update_cb, bt, nullptr);
@ -649,7 +649,7 @@ static void ui_block_colorpicker(uiBlock *block,
bt = uiDefButR_prop(block,
UI_BTYPE_NUM_SLIDER,
0,
IFACE_("B:"),
IFACE_("Blue:"),
0,
yco -= UI_UNIT_Y,
butwidth,
@ -659,7 +659,7 @@ static void ui_block_colorpicker(uiBlock *block,
2,
0.0,
0.0,
0,
10,
3,
TIP_("Blue"));
UI_but_func_set(bt, ui_colorpicker_rgba_update_cb, bt, nullptr);
@ -675,7 +675,7 @@ static void ui_block_colorpicker(uiBlock *block,
bt = uiDefButF(block,
UI_BTYPE_NUM_SLIDER,
0,
IFACE_("H:"),
IFACE_("Hue:"),
0,
yco,
butwidth,
@ -692,7 +692,7 @@ static void ui_block_colorpicker(uiBlock *block,
bt = uiDefButF(block,
UI_BTYPE_NUM_SLIDER,
0,
IFACE_("S:"),
IFACE_("Saturation:"),
0,
yco -= UI_UNIT_Y,
butwidth,
@ -710,7 +710,7 @@ static void ui_block_colorpicker(uiBlock *block,
bt = uiDefButF(block,
UI_BTYPE_NUM_SLIDER,
0,
IFACE_("L:"),
IFACE_("Lightness:"),
0,
yco -= UI_UNIT_Y,
butwidth,
@ -726,7 +726,7 @@ static void ui_block_colorpicker(uiBlock *block,
bt = uiDefButF(block,
UI_BTYPE_NUM_SLIDER,
0,
IFACE_("V:"),
IFACE_("Value:"),
0,
yco -= UI_UNIT_Y,
butwidth,
@ -750,7 +750,7 @@ static void ui_block_colorpicker(uiBlock *block,
bt = uiDefButR_prop(block,
UI_BTYPE_NUM_SLIDER,
0,
IFACE_("A: "),
IFACE_("Alpha:"),
0,
yco -= UI_UNIT_Y,
butwidth,
@ -760,7 +760,7 @@ static void ui_block_colorpicker(uiBlock *block,
3,
0.0,
0.0,
0,
10,
3,
TIP_("Alpha"));
UI_but_func_set(bt, ui_colorpicker_rgba_update_cb, bt, nullptr);
@ -788,7 +788,7 @@ static void ui_block_colorpicker(uiBlock *block,
bt = uiDefBut(block,
UI_BTYPE_TEXT,
0,
IFACE_("Hex: "),
IFACE_("Hex:"),
0,
yco,
butwidth,