diff options
author | Matt Ebb <matt@mke3.net> | 2009-12-09 09:55:16 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2009-12-09 09:55:16 +0300 |
commit | 9b6b74f292856dd8edf5bf9e9f172d95fc12d5e4 (patch) | |
tree | aabca3590c1e895cc3672347204e05534dd500a6 /source | |
parent | bc795694198a700aeb6283741da2a4ed515a70c3 (diff) |
Various more screen-related fixes including:
[#20271] File Browser - Wont show when area is fullscreen
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/screen/screen_edit.c | 38 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_screen_types.h | 7 |
2 files changed, 32 insertions, 13 deletions
diff --git a/source/blender/editors/screen/screen_edit.c b/source/blender/editors/screen/screen_edit.c index 024e00fa617..6d8f25bb9ff 100644 --- a/source/blender/editors/screen/screen_edit.c +++ b/source/blender/editors/screen/screen_edit.c @@ -1468,7 +1468,7 @@ ScrArea *ed_screen_fullarea(bContext *C, wmWindow *win, ScrArea *sa) // default. So use the old headertype instead area_copy_data(old, sa, 1); /* 1 = swap spacelist */ - + if (sa->flag |= AREA_TEMP_INFO) sa->flag &= ~AREA_TEMP_INFO; old->full= NULL; /* animtimer back */ @@ -1502,7 +1502,7 @@ ScrArea *ed_screen_fullarea(bContext *C, wmWindow *win, ScrArea *sa) /* returns the top small area */ newa= area_split(win, sc, (ScrArea *)sc->areabase.first, 'h', 0.99f); ED_area_newspace(C, newa, SPACE_INFO); - + /* use random area when we have no active one, e.g. when the mouse is outside of the window and we open a file browser */ if(!sa) @@ -1511,11 +1511,12 @@ ScrArea *ed_screen_fullarea(bContext *C, wmWindow *win, ScrArea *sa) /* copy area */ newa= newa->prev; area_copy_data(newa, sa, 1); /* 1 = swap spacelist */ + sa->flag |= AREA_TEMP_INFO; sa->full= oldscreen; newa->full= oldscreen; newa->next->full= oldscreen; // XXX - + ED_screen_set(C, sc); } @@ -1530,13 +1531,26 @@ ScrArea *ed_screen_fullarea(bContext *C, wmWindow *win, ScrArea *sa) int ED_screen_full_newspace(bContext *C, ScrArea *sa, int type) { wmWindow *win= CTX_wm_window(C); + bScreen *screen= CTX_wm_screen(C); ScrArea *newsa= NULL; - if(!sa || sa->full==0) + if(!sa || sa->full==0) { newsa= ed_screen_fullarea(C, win, sa); - if(!newsa) - newsa= sa; - + } + + if(!newsa) { + if (sa->full) { + /* if this has been called from the temporary info header generated in + * temp fullscreen layouts, find the correct fullscreen area to change + * to create a new space inside */ + for (newsa = screen->areabase.first; newsa; newsa=newsa->next) { + if (!(sa->flag & AREA_TEMP_INFO)) + break; + } + } else + newsa= sa; + } + ED_area_newspace(C, newsa, type); return 1; @@ -1567,10 +1581,14 @@ void ED_screen_full_restore(bContext *C, ScrArea *sa) SpaceImage *sima= sa->spacedata.first; if (sima->flag & SI_PREVSPACE) sima->flag &= ~SI_PREVSPACE; - if (sima->flag & SI_FULLWINDOW) + if (sima->flag & SI_FULLWINDOW) { sima->flag &= ~SI_FULLWINDOW; - } - ED_screen_full_prevspace(C, sa); + ED_screen_full_prevspace(C, sa); + } + } else if (sl->spacetype == SPACE_FILE) { + ED_screen_full_prevspace(C, sa); + } else + ed_screen_fullarea(C, win, sa); } /* otherwise just tile the area again */ else { diff --git a/source/blender/makesdna/DNA_screen_types.h b/source/blender/makesdna/DNA_screen_types.h index b091a0529e7..18c7a819eb3 100644 --- a/source/blender/makesdna/DNA_screen_types.h +++ b/source/blender/makesdna/DNA_screen_types.h @@ -170,9 +170,10 @@ typedef struct ARegion { #define WIN_EQUAL 3 /* area->flag */ -#define HEADER_NO_PULLDOWN 1 -#define AREA_FLAG_DRAWJOINTO 2 -#define AREA_FLAG_DRAWJOINFROM 4 +#define HEADER_NO_PULLDOWN 1 +#define AREA_FLAG_DRAWJOINTO 2 +#define AREA_FLAG_DRAWJOINFROM 4 +#define AREA_TEMP_INFO 8 /* If you change EDGEWIDTH, also do the global arrat edcol[] */ #define EDGEWIDTH 1 |