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:
2013-03-24 18:59:15 +00:00
parent bf295c1c36
commit d74cf43575
2 changed files with 5 additions and 10 deletions

View File

@@ -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);
}