UI small fixes:
- Theme color for the brush popup was not correctly coded. Now it follows menu item style correctly, which also allows all the themes we have to give readable text. - RMB cancel also added for slider buttons and the color picker.
This commit is contained in:
@@ -3261,7 +3261,7 @@ static int ui_do_but_SLI(bContext *C, uiBlock *block, uiBut *but, uiHandleButton
|
||||
}
|
||||
}
|
||||
else if (data->state == BUTTON_STATE_NUM_EDITING) {
|
||||
if (event->type == ESCKEY) {
|
||||
if (event->type == ESCKEY || event->type == RIGHTMOUSE) {
|
||||
data->cancel = TRUE;
|
||||
data->escapecancel = TRUE;
|
||||
button_activate_state(C, but, BUTTON_STATE_EXIT);
|
||||
@@ -3839,7 +3839,7 @@ static int ui_do_but_HSVCUBE(bContext *C, uiBlock *block, uiBut *but, uiHandleBu
|
||||
}
|
||||
}
|
||||
else if (data->state == BUTTON_STATE_NUM_EDITING) {
|
||||
if (event->type == ESCKEY) {
|
||||
if (event->type == ESCKEY || event->type == RIGHTMOUSE) {
|
||||
data->cancel = TRUE;
|
||||
data->escapecancel = TRUE;
|
||||
button_activate_state(C, but, BUTTON_STATE_EXIT);
|
||||
@@ -4036,7 +4036,7 @@ static int ui_do_but_HSVCIRCLE(bContext *C, uiBlock *block, uiBut *but, uiHandle
|
||||
}
|
||||
}
|
||||
else if (data->state == BUTTON_STATE_NUM_EDITING) {
|
||||
if (event->type == ESCKEY) {
|
||||
if (event->type == ESCKEY || event->type == RIGHTMOUSE) {
|
||||
data->cancel = TRUE;
|
||||
data->escapecancel = TRUE;
|
||||
button_activate_state(C, but, BUTTON_STATE_EXIT);
|
||||
|
||||
@@ -3527,7 +3527,6 @@ void ui_draw_preview_item(uiFontStyle *fstyle, rcti *rect, const char *name, int
|
||||
rcti trect = *rect, bg_rect;
|
||||
float font_dims[2] = {0.0f, 0.0f};
|
||||
uiWidgetType *wt = widget_type(UI_WTYPE_MENU_ITEM);
|
||||
unsigned char bg_col[3];
|
||||
|
||||
wt->state(wt, state);
|
||||
wt->draw(&wt->wcol, rect, 0, 0);
|
||||
@@ -3553,16 +3552,12 @@ void ui_draw_preview_item(uiFontStyle *fstyle, rcti *rect, const char *name, int
|
||||
if (bg_rect.xmax > rect->xmax - PREVIEW_PAD)
|
||||
bg_rect.xmax = rect->xmax - PREVIEW_PAD;
|
||||
|
||||
UI_GetThemeColor3ubv(TH_BUTBACK, bg_col);
|
||||
glColor4ubv((unsigned char *)wt->wcol.item);
|
||||
glColor4ubv((unsigned char *)wt->wcol_theme->inner_sel);
|
||||
glEnable(GL_BLEND);
|
||||
glRecti(bg_rect.xmin, bg_rect.ymin, bg_rect.xmax, bg_rect.ymax);
|
||||
glDisable(GL_BLEND);
|
||||
|
||||
if (state == UI_ACTIVE)
|
||||
glColor4ubv((unsigned char *)wt->wcol.text);
|
||||
else
|
||||
glColor4ubv((unsigned char *)wt->wcol.text_sel);
|
||||
glColor3ubv((unsigned char *)wt->wcol.text);
|
||||
|
||||
uiStyleFontDraw(fstyle, &trect, name);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user