Merge branch 'blender2.7'
[blender.git] / source / blender / blenkernel / intern / screen.c
index e23291d42d4b09a3a9e21acd01e6e22adc901f88..7a2b93e6833eef07a6efe11efdb0f6329c78b7b5 100644 (file)
@@ -1,6 +1,4 @@
 /*
- * ***** BEGIN GPL LICENSE BLOCK *****
- *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License
  * as published by the Free Software Foundation; either version 2
  *
  * The Original Code is Copyright (C) 2001-2002 by NaN Holding BV.
  * All rights reserved.
- *
- * The Original Code is: all of this file.
- *
- * Contributor(s): none yet.
- *
- * ***** END GPL LICENSE BLOCK *****
  */
 
-/** \file blender/blenkernel/intern/screen.c
- *  \ingroup bke
+/** \file
+ * \ingroup bke
  */
 
 #ifdef WIN32
@@ -822,6 +814,8 @@ void BKE_screen_view3d_shading_init(View3DShading *shading)
        shading->xray_alpha_wire = 0.5f;
        shading->cavity_valley_factor = 1.0f;
        shading->cavity_ridge_factor = 1.0f;
+       shading->curvature_ridge_factor = 1.0f;
+       shading->curvature_valley_factor = 1.0f;
        copy_v3_fl(shading->single_color, 0.8f);
        copy_v3_fl(shading->background_color, 0.05f);
 }
@@ -853,3 +847,20 @@ bool BKE_screen_is_used(const bScreen *screen)
 {
        return (screen->winid != 0);
 }
+
+void BKE_screen_header_alignment_reset(bScreen *screen)
+{
+       int alignment = (U.uiflag & USER_HEADER_BOTTOM) ? RGN_ALIGN_BOTTOM : RGN_ALIGN_TOP;
+       for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) {
+               for (ARegion *ar = sa->regionbase.first; ar; ar = ar->next) {
+                       if (ar->regiontype == RGN_TYPE_HEADER) {
+                               if (ELEM(sa->spacetype, SPACE_FILE, SPACE_USERPREF, SPACE_OUTLINER, SPACE_PROPERTIES)) {
+                                       ar->alignment = RGN_ALIGN_TOP;
+                                       continue;
+                               }
+                               ar->alignment = alignment;
+                       }
+               }
+       }
+       screen->do_refresh = true;
+}