Two nice usability fixes:

- On inserting keyframes in buttons, no redraw happened
- Keyframe in icon-only buttons now draw color in background.
This commit is contained in:
2010-12-09 18:08:58 +00:00
parent 996674704e
commit 4640833747
2 changed files with 17 additions and 2 deletions

View File

@@ -5002,7 +5002,8 @@ void uiContextAnimUpdate(const bContext *C)
for(block=ar->uiblocks.first; block; block=block->next) {
for(but=block->buttons.first; but; but= but->next) {
ui_but_anim_flag(but, (scene)? scene->r.cfra: 0.0f);
ED_region_tag_redraw(ar);
if(but->active)
activebut= but;
else if(!activebut && (but->flag & UI_BUT_LAST_ACTIVE))

View File

@@ -2350,6 +2350,20 @@ static void widget_swatch(uiBut *but, uiWidgetColors *wcol, rcti *rect, int stat
}
static void widget_icon_has_anim(uiBut *but, uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign)
{
if(state & (UI_BUT_ANIMATED|UI_BUT_ANIMATED_KEY|UI_BUT_DRIVEN|UI_BUT_REDALERT)) {
uiWidgetBase wtb;
widget_init(&wtb);
wtb.outline= 0;
/* rounded */
round_box_edges(&wtb, 15, rect, 10.0f);
widgetbase_draw(&wtb, wcol);
}
}
static void widget_textbut(uiWidgetColors *wcol, rcti *rect, int state, int roundboxalign)
{
@@ -2693,7 +2707,7 @@ static uiWidgetType *widget_type(uiWidgetTypeEnum type)
/* specials */
case UI_WTYPE_ICON:
wt.draw= NULL;
wt.custom= widget_icon_has_anim;
break;
case UI_WTYPE_SWATCH: