UI: Correct the text alignment of the RGB/HSV/Hex toggle in the color picker

Expanded enum items like this usually have centered text, but there are
limitations in the popup code that break this here. Add a workaround for this
limitation.

Differential Revision: https://developer.blender.org/D9854

Reviewed by: Julian Eisel
This commit is contained in:
Yevgeny Makarov
2021-02-20 18:52:53 +01:00
committed by Julian Eisel
parent f2c0bbed1c
commit cab26abbdb

View File

@@ -565,6 +565,7 @@ static void ui_block_colorpicker(uiBlock *block,
0,
"");
UI_but_flag_disable(bt, UI_BUT_UNDO);
UI_but_drawflag_disable(bt, UI_BUT_TEXT_LEFT);
UI_but_func_set(bt, ui_colorpicker_create_mode_cb, bt, NULL);
bt->custom_data = cpicker;
bt = uiDefButC(block,
@@ -582,6 +583,7 @@ static void ui_block_colorpicker(uiBlock *block,
0,
"");
UI_but_flag_disable(bt, UI_BUT_UNDO);
UI_but_drawflag_disable(bt, UI_BUT_TEXT_LEFT);
UI_but_func_set(bt, ui_colorpicker_create_mode_cb, bt, NULL);
bt->custom_data = cpicker;
bt = uiDefButC(block,
@@ -599,6 +601,7 @@ static void ui_block_colorpicker(uiBlock *block,
0,
"");
UI_but_flag_disable(bt, UI_BUT_UNDO);
UI_but_drawflag_disable(bt, UI_BUT_TEXT_LEFT);
UI_but_func_set(bt, ui_colorpicker_create_mode_cb, bt, NULL);
bt->custom_data = cpicker;
UI_block_align_end(block);