Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-12-14 00:43:14 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-12-14 00:43:14 +0300
commitcb6d018ec9496912943726a0c45829cf8b7c6696 (patch)
treedd0ace2784839f9696867757581b5ecea5a6e105 /source/blender/editors/screen/area.c
parentd6225c9caaa69a601e4d4facb737a4cc5c092808 (diff)
Fix T57724: Opening file browser flips user-prefs header
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r--source/blender/editors/screen/area.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 85f46d86abc..3eecab46aa5 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1813,6 +1813,13 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type, const bool skip_ar_exi
SpaceLink *sl;
/* store sa->type->exit callback */
void *sa_exit = sa->type ? sa->type->exit : NULL;
+ /* When the user switches between space-types from the type-selector,
+ * changing the header-type is jarring (especially when using Ctrl-MouseWheel).
+ *
+ * However, add-on install for example -forces the header to the top which shouldn't
+ * be applied back to the previous space type when closing - see: T57724
+ */
+ const bool sync_header_alignment = (sa->flag & AREA_FLAG_TEMP_TYPE) == 0;
int header_alignment = ED_area_header_alignment(sa);
/* in some cases (opening temp space) we don't want to
@@ -1865,10 +1872,12 @@ void ED_area_newspace(bContext *C, ScrArea *sa, int type, const bool skip_ar_exi
/* Sync header alignment. */
- for (ARegion *ar = sa->regionbase.first; ar; ar = ar->next) {
- if (ar->regiontype == RGN_TYPE_HEADER) {
- ar->alignment = header_alignment;
- break;
+ if (sync_header_alignment) {
+ for (ARegion *ar = sa->regionbase.first; ar; ar = ar->next) {
+ if (ar->regiontype == RGN_TYPE_HEADER) {
+ ar->alignment = header_alignment;
+ break;
+ }
}
}
}