UI: Enable writing global area data (top-bar, status-bar) to .blend's
There should not be much user visible here (other than T73668 being addressed). I added the writing code already for the initial implementation of workspaces, but we decided to keep it disabled until the top-bar design is more clear. It was never planned to keep this disabled for so long. Fixes T73668.
This commit is contained in:
parent
cf7343a355
commit
ef4aa42ea4
@ -1368,14 +1368,12 @@ static void write_area_regions(BlendWriter *writer, ScrArea *area)
|
||||
}
|
||||
BLO_write_struct(writer, SpaceConsole, sl);
|
||||
}
|
||||
#ifdef WITH_GLOBAL_AREA_WRITING
|
||||
else if (sl->spacetype == SPACE_TOPBAR) {
|
||||
BLO_write_struct(writer, SpaceTopBar, sl);
|
||||
}
|
||||
else if (sl->spacetype == SPACE_STATUSBAR) {
|
||||
BLO_write_struct(writer, SpaceStatusBar, sl);
|
||||
}
|
||||
#endif
|
||||
else if (sl->spacetype == SPACE_USERPREF) {
|
||||
BLO_write_struct(writer, SpaceUserPref, sl);
|
||||
}
|
||||
@ -1397,9 +1395,7 @@ void BKE_screen_area_map_blend_write(BlendWriter *writer, ScrAreaMap *area_map)
|
||||
|
||||
BLO_write_struct(writer, ScrArea, area);
|
||||
|
||||
#ifdef WITH_GLOBAL_AREA_WRITING
|
||||
BLO_write_struct(writer, ScrGlobalAreaData, area->global);
|
||||
#endif
|
||||
|
||||
write_area_regions(writer, area);
|
||||
|
||||
|
@ -1639,12 +1639,6 @@ static void write_windowmanager(BlendWriter *writer, wmWindowManager *wm, const
|
||||
write_wm_xr_data(writer, &wm->xr);
|
||||
|
||||
LISTBASE_FOREACH (wmWindow *, win, &wm->windows) {
|
||||
#ifndef WITH_GLOBAL_AREA_WRITING
|
||||
/* Don't write global areas yet, while we make changes to them. */
|
||||
ScrAreaMap global_areas = win->global_areas;
|
||||
memset(&win->global_areas, 0, sizeof(win->global_areas));
|
||||
#endif
|
||||
|
||||
/* update deprecated screen member (for so loading in 2.7x uses the correct screen) */
|
||||
win->screen = BKE_workspace_active_screen_get(win->workspace_hook);
|
||||
|
||||
@ -1652,11 +1646,7 @@ static void write_windowmanager(BlendWriter *writer, wmWindowManager *wm, const
|
||||
BLO_write_struct(writer, WorkSpaceInstanceHook, win->workspace_hook);
|
||||
BLO_write_struct(writer, Stereo3dFormat, win->stereo3d_format);
|
||||
|
||||
#ifdef WITH_GLOBAL_AREA_WRITING
|
||||
BKE_screen_area_map_blend_write(writer, &win->global_areas);
|
||||
#else
|
||||
win->global_areas = global_areas;
|
||||
#endif
|
||||
|
||||
/* data is written, clear deprecated data again */
|
||||
win->screen = NULL;
|
||||
|
@ -322,10 +322,6 @@ typedef struct uiPreview {
|
||||
char _pad1[6];
|
||||
} uiPreview;
|
||||
|
||||
/* These two lines with # tell makesdna this struct can be excluded.
|
||||
* Should be: #ifndef WITH_GLOBAL_AREA_WRITING */
|
||||
#
|
||||
#
|
||||
typedef struct ScrGlobalAreaData {
|
||||
/* Global areas have a non-dynamic size. That means, changing the window
|
||||
* size doesn't affect their size at all. However, they can still be
|
||||
|
@ -59,10 +59,6 @@ struct wmTimer;
|
||||
/* Defined in `buttons_intern.h`. */
|
||||
typedef struct SpaceProperties_Runtime SpaceProperties_Runtime;
|
||||
|
||||
/* TODO 2.8: We don't write the global areas to files currently. Uncomment
|
||||
* define to enable writing (should become the default in a bit). */
|
||||
//#define WITH_GLOBAL_AREA_WRITING
|
||||
|
||||
/* -------------------------------------------------------------------- */
|
||||
/** \name SpaceLink (Base)
|
||||
* \{ */
|
||||
@ -1672,10 +1668,6 @@ typedef enum eSpaceClip_GPencil_Source {
|
||||
/** \name Top Bar
|
||||
* \{ */
|
||||
|
||||
/* These two lines with # tell makesdna this struct can be excluded.
|
||||
* Should be: #ifndef WITH_GLOBAL_AREA_WRITING */
|
||||
#
|
||||
#
|
||||
typedef struct SpaceTopBar {
|
||||
SpaceLink *next, *prev;
|
||||
/** Storage of regions for inactive spaces. */
|
||||
@ -1692,10 +1684,6 @@ typedef struct SpaceTopBar {
|
||||
/** \name Status Bar
|
||||
* \{ */
|
||||
|
||||
/* These two lines with # tell makesdna this struct can be excluded.
|
||||
* Should be: #ifndef WITH_GLOBAL_AREA_WRITING */
|
||||
#
|
||||
#
|
||||
typedef struct SpaceStatusBar {
|
||||
SpaceLink *next, *prev;
|
||||
/** Storage of regions for inactive spaces. */
|
||||
|
Loading…
Reference in New Issue
Block a user