Fix default open outliner restrict columns
authorDalai Felinto <dfelinto@gmail.com>
Wed, 15 May 2019 11:14:00 +0000 (08:14 -0300)
committerDalai Felinto <dfelinto@gmail.com>
Wed, 15 May 2019 11:18:15 +0000 (08:18 -0300)
Regression introduced on 777a546c0c7.

source/blender/blenloader/intern/versioning_280.c
source/blender/editors/space_outliner/outliner_utils.c
source/blender/editors/space_outliner/space_outliner.c

index 4ca8c24..9d8fa2d 100644 (file)
@@ -3407,7 +3407,7 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
           }
           SpaceOutliner *so = (SpaceOutliner *)sl;
           so->filter &= ~SO_FLAG_UNUSED_1;
-          so->show_restrict_flags = SO_RESTRICT_ENABLE | SO_RESTRICT_SELECT | SO_RESTRICT_VIEWPORT;
+          so->show_restrict_flags = SO_RESTRICT_ENABLE | SO_RESTRICT_SELECT | SO_RESTRICT_HIDE;
         }
       }
     }
index 9f99c65..f57dce9 100644 (file)
@@ -270,6 +270,7 @@ float outliner_restrict_columns_width(const SpaceOutliner *soops)
   switch (soops->outlinevis) {
     case SO_DATA_API:
     case SO_SEQUENCE:
+    case SO_LIBRARIES:
       return 0.0f;
     case SO_ID_ORPHANS:
       num_columns = 3;
@@ -286,18 +287,16 @@ float outliner_restrict_columns_width(const SpaceOutliner *soops)
       if (soops->show_restrict_flags & SO_RESTRICT_SELECT) {
         num_columns++;
       }
-      if (soops->show_restrict_flags & SO_RESTRICT_VIEWPORT) {
+      if (soops->show_restrict_flags & SO_RESTRICT_HIDE) {
         num_columns++;
       }
-      if (soops->show_restrict_flags & SO_RESTRICT_HIDE) {
+      if (soops->show_restrict_flags & SO_RESTRICT_VIEWPORT) {
         num_columns++;
       }
       if (soops->show_restrict_flags & SO_RESTRICT_RENDER) {
         num_columns++;
       }
       break;
-    case SO_LIBRARIES:
-      return 0.0f;
   }
   return (num_columns * UI_UNIT_X + V2D_SCROLL_WIDTH);
 }
index e048814..6634edf 100644 (file)
@@ -302,7 +302,7 @@ static SpaceLink *outliner_new(const ScrArea *UNUSED(area), const Scene *UNUSED(
   soutliner = MEM_callocN(sizeof(SpaceOutliner), "initoutliner");
   soutliner->spacetype = SPACE_OUTLINER;
   soutliner->filter_id_type = ID_GR;
-  soutliner->show_restrict_flags = SO_RESTRICT_ENABLE | SO_RESTRICT_SELECT | SO_RESTRICT_VIEWPORT;
+  soutliner->show_restrict_flags = SO_RESTRICT_ENABLE | SO_RESTRICT_SELECT | SO_RESTRICT_HIDE;
 
   /* header */
   ar = MEM_callocN(sizeof(ARegion), "header for outliner");