Merge branch 'master' into blender2.8
authorJulian Eisel <eiseljulian@gmail.com>
Fri, 17 Mar 2017 14:34:35 +0000 (15:34 +0100)
committerJulian Eisel <eiseljulian@gmail.com>
Fri, 17 Mar 2017 14:38:45 +0000 (15:38 +0100)
Conflicts:
source/blender/editors/space_outliner/outliner_draw.c

1  2 
source/blender/editors/interface/interface.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/interface/interface_widgets.c
source/blender/editors/screen/area.c
source/blender/editors/space_outliner/outliner_draw.c

index 2f64100fa66fcc4c1a6778ce1aaf8312ca87f5c5,131584dd405d3f59697e45bfdaf402dcf2cb3804..e4d9be3329bfd23adcfdca0eb3e3d7afcf80d59e
@@@ -439,12 -426,11 +439,12 @@@ static void template_ID
  
                if ((idfrom && idfrom->lib) || !editable)
                        UI_but_flag_enable(but, UI_BUT_DISABLED);
 -              
 -              uiLayoutRow(layout, true);
 +              if (use_big_size) {
 +                      uiLayoutRow(layout, true);
 +              }
        }
        else if (flag & UI_ID_BROWSE) {
-               but = uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X * 1.5, UI_UNIT_Y,
+               but = uiDefBlockButN(block, id_search_menu, MEM_dupallocN(template), "", 0, 0, UI_UNIT_X * 1.6, UI_UNIT_Y,
                                     TIP_(template_id_browse_tip(type)));
                ui_def_but_icon(but, RNA_struct_ui_icon(type), UI_HAS_ICON);
                /* default dragging of icon for id browse buttons */
Simple merge
index 6207ed8579ca547b30087b02ca9a441144eb0719,42d9e4356ee7bb1cc6f8726ab1150ac0aceba473..ee943db95334d85c3c8643bef8a218202c5e02dc
@@@ -844,14 -1047,14 +841,16 @@@ static void tselem_draw_icon(uiBlock *b
        arg.xb = x;     /* for ui buttons */
        arg.yb = y;
        arg.alpha = alpha;
 -      
 +
        /* placement of icons, copied from interface_widgets.c */
        aspect = (0.8f * UI_UNIT_Y) / ICON_DEFAULT_HEIGHT;
-       arg.x = x = x + 4.0f * aspect;
-       arg.y = y = y + 0.1f * UI_UNIT_Y;
+       x += 2.0f * aspect;
+       y += 2.0f * aspect;
+       arg.x = x = x;
+       arg.y = y = y;
  
 +#define ICON_DRAW(_icon) UI_icon_draw_alpha(x, y, _icon, alpha)
 +
        if (tselem->type) {
                switch (tselem->type) {
                        case TSE_ANIM_DATA:
@@@ -1250,18 -1384,15 +1249,18 @@@ static void outliner_draw_iconrow(bCont
  
                        if (active != OL_DRAWSEL_NONE) {
                                float ufac = UI_UNIT_X / 20.0f;
 +                              float color[4] = {1.0f, 1.0f, 1.0f, 0.4f};
  
                                UI_draw_roundbox_corner_set(UI_CNR_ALL);
 -                              glColor4ub(255, 255, 255, 100);
 +                              color[3] *= alpha_fac;
 +
                                UI_draw_roundbox(
-                                       (float) *offsx - 1.0f * ufac,
+                                       (float) *offsx + 1.0f * ufac,
                                        (float)ys + 1.0f * ufac,
-                                       (float)*offsx + UI_UNIT_X - 2.0f * ufac,
+                                       (float)*offsx + UI_UNIT_X - 1.0f * ufac,
                                        (float)ys + UI_UNIT_Y - ufac,
 -                                      (float)UI_UNIT_Y / 2.0f - ufac);
 +                                      (float)UI_UNIT_Y / 2.0f - ufac,
 +                                       color);
                                glEnable(GL_BLEND); /* roundbox disables */
                        }
                        
@@@ -1382,11 -1535,11 +1381,11 @@@ static void outliner_draw_tree_element
                if (active != OL_DRAWSEL_NONE) {
                        UI_draw_roundbox_corner_set(UI_CNR_ALL);
                        UI_draw_roundbox(
-                               (float)startx + UI_UNIT_X,
+                               (float)startx + UI_UNIT_X + 1.0f * ufac,
                                (float)*starty + 1.0f * ufac,
-                               (float)startx + 2.0f * UI_UNIT_X - 2.0f * ufac,
+                               (float)startx + 2.0f * UI_UNIT_X - 1.0f * ufac,
                                (float)*starty + UI_UNIT_Y - 1.0f * ufac,
 -                              UI_UNIT_Y / 2.0f - 1.0f * ufac);
 +                              UI_UNIT_Y / 2.0f - 1.0f * ufac, color);
                        glEnable(GL_BLEND); /* roundbox disables it */
                        
                        te->flag |= TE_ACTIVE; // for lookup in display hierarchies
                /* open/close icon, only when sublevels, except for scene */
                if (te->subtree.first || (tselem->type == 0 && te->idcode == ID_SCE) || (te->flag & TE_LAZY_CLOSED)) {
                        int icon_x;
 -                      icon_x = startx;
 -                      
 +                      if (tselem->type == 0 && ELEM(te->idcode, ID_OB, ID_SCE))
 +                              icon_x = startx;
 +                      else
 +                              icon_x = startx + 5 * ufac;
 +
                        // icons a bit higher
                        if (TSELEM_OPEN(tselem, soops))
-                               UI_icon_draw_alpha((float)icon_x, (float)*starty + 2 * ufac, ICON_DISCLOSURE_TRI_DOWN,
 -                              UI_icon_draw((float)icon_x + 2 * ufac, (float)*starty + 1 * ufac, ICON_DISCLOSURE_TRI_DOWN);
++                              UI_icon_draw_alpha((float)icon_x + 2 * ufac, (float)*starty + 1 * ufac, ICON_DISCLOSURE_TRI_DOWN,
 +                                                 alpha_fac);
                        else
-                               UI_icon_draw_alpha((float)icon_x, (float)*starty + 2 * ufac, ICON_DISCLOSURE_TRI_RIGHT,
 -                              UI_icon_draw((float)icon_x + 2 * ufac, (float)*starty + 1 * ufac, ICON_DISCLOSURE_TRI_RIGHT);
++                              UI_icon_draw_alpha((float)icon_x + 2 * ufac, (float)*starty + 1 * ufac, ICON_DISCLOSURE_TRI_RIGHT,
 +                                                 alpha_fac);
                }
                offsx += UI_UNIT_X;
                
                /* datatype icon */
                
                if (!(ELEM(tselem->type, TSE_RNA_PROPERTY, TSE_RNA_ARRAY_ELEM))) {
 -                      
 -                      tselem_draw_icon(block, xmax, (float)startx + offsx, (float)*starty, tselem, te, 1.0f);
 -                      
 +                      tselem_draw_icon(block, xmax, (float)startx + offsx, (float)*starty, tselem, te, alpha_fac);
-                       offsx += UI_UNIT_X;
+                       offsx += UI_UNIT_X + 2 * ufac;
                }
                else
                        offsx += 2 * ufac;
                
                if (tselem->type == 0 && ID_IS_LINKED_DATABLOCK(tselem->id)) {
 -                      glPixelTransferf(GL_ALPHA_SCALE, 0.5f);
                        if (tselem->id->tag & LIB_TAG_MISSING) {
-                               UI_icon_draw_alpha((float)startx + offsx, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_BROKEN,
 -                              UI_icon_draw((float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_BROKEN);
++                              UI_icon_draw_alpha((float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_BROKEN,
 +                                                 alpha_fac);
                        }
                        else if (tselem->id->tag & LIB_TAG_INDIRECT) {
-                               UI_icon_draw_alpha((float)startx + offsx, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_INDIRECT,
 -                              UI_icon_draw((float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_INDIRECT);
++                              UI_icon_draw_alpha((float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_INDIRECT,
 +                                                 alpha_fac);
                        }
                        else {
-                               UI_icon_draw_alpha((float)startx + offsx, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_DIRECT,
 -                              UI_icon_draw((float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_DIRECT);
++                              UI_icon_draw_alpha((float)startx + offsx + 2 * ufac, (float)*starty + 2 * ufac, ICON_LIBRARY_DATA_DIRECT,
 +                                                 alpha_fac);
                        }
-                       offsx += UI_UNIT_X;
 -                      glPixelTransferf(GL_ALPHA_SCALE, 1.0f);
+                       offsx += UI_UNIT_X + 2 * ufac;
                }
                glDisable(GL_BLEND);