diff options
author | Ton Roosendaal <ton@blender.org> | 2013-03-24 22:59:15 +0400 |
---|---|---|
committer | Ton Roosendaal <ton@blender.org> | 2013-03-24 22:59:15 +0400 |
commit | d74cf435755ebf4b69efc015e49ccdc2f77ad6e5 (patch) | |
tree | 3116511f40528dfd5392201c236fc174245543fe /source | |
parent | bf295c1c369fb8dd3e33c82f5f51d1c3ebc6645f (diff) |
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.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/interface/interface_handlers.c | 6 | ||||
-rw-r--r-- | source/blender/editors/interface/interface_widgets.c | 9 |
2 files changed, 5 insertions, 10 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c index 768fc12a0c2..7afc00f5a07 100644 --- a/source/blender/editors/interface/interface_handlers.c +++ b/source/blender/editors/interface/interface_handlers.c @@ -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); diff --git a/source/blender/editors/interface/interface_widgets.c b/source/blender/editors/interface/interface_widgets.c index 96c8ded46da..b5b10b623d2 100644 --- a/source/blender/editors/interface/interface_widgets.c +++ b/source/blender/editors/interface/interface_widgets.c @@ -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); } |