Two nice usability fixes:
authorTon Roosendaal <ton@blender.org>
Thu, 9 Dec 2010 18:08:58 +0000 (18:08 +0000)
committerTon Roosendaal <ton@blender.org>
Thu, 9 Dec 2010 18:08:58 +0000 (18:08 +0000)
- On inserting keyframes in buttons, no redraw happened
- Keyframe in icon-only buttons now draw color in background.

source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_widgets.c

index 1e963e37fd23ce11dc5016c311153ee9c9d97949..66ea2ebc265b42c2564e0b22bc25dee12fb5e551 100644 (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))
index 403c7001b3b25564de8f82eff86ad445fbce15ef..561fc754f7c6a517f58c4c00ab33b67b4a7e8803 100644 (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: