diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2018-10-29 23:34:14 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2018-10-29 23:44:01 +0300 |
commit | ab6c7ff2ab1531f70b0f47f30f195fd2b1c14851 (patch) | |
tree | 96ffd73c52f97ee6a8e4772480236359862c5170 /source/blender/blenloader | |
parent | ce148716c8163162ba7275980792d432c0b3f5ed (diff) |
UI: Vertical Properties Editor Tabs
Moves the Properties editor context switching to a vertical tabs region.
Design Task: T54951
Differential Revison: D3840
The tabs are regular widgets, unlike the 'old' toolshelf tabs. This means they
give mouse hover feedback, have tooltips, support the right-click menu, etc.
Also, when vertical screen space gets tight, the tabs can be scrolled, they
don't shrink like the toolshelf ones.
The tab region is slightly larger than the header. The tabs are scaled up
accordingly. This makes them nicely readable.
The header is quite empty now. As shown in T54951, we wanted to have a search
button there. This should be added next.
Implementation Notes:
* Added a new region type, RGN_TYPE_NAVIGATION.
* Having the tabs in a separate region allows scrolling of the tab-bar, unlike
the toolshelf tabs. We might want to remove the scrollbars though.
* Added a new region flag RGN_FLAG_PREFSIZE_OR_HIDDEN, to ensure the tab region
is either hidden or has a fixed size.
* Added some additional flags to support fine-tuning the layout in panel and
layout code.
* Bumps subversion.
Diffstat (limited to 'source/blender/blenloader')
-rw-r--r-- | source/blender/blenloader/intern/versioning_280.c | 26 | ||||
-rw-r--r-- | source/blender/blenloader/intern/versioning_userdef.c | 6 |
2 files changed, 31 insertions, 1 deletions
diff --git a/source/blender/blenloader/intern/versioning_280.c b/source/blender/blenloader/intern/versioning_280.c index 52c83d83454..25c243fa589 100644 --- a/source/blender/blenloader/intern/versioning_280.c +++ b/source/blender/blenloader/intern/versioning_280.c @@ -2179,4 +2179,30 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain) } } } + + if (!MAIN_VERSION_ATLEAST(bmain, 280, 29)) { + for (bScreen *screen = bmain->screen.first; screen; screen = screen->id.next) { + for (ScrArea *sa = screen->areabase.first; sa; sa = sa->next) { + for (SpaceLink *sl = sa->spacedata.first; sl; sl = sl->next) { + if (sl->spacetype == SPACE_BUTS) { + ListBase *regionbase = (sl == sa->spacedata.first) ? &sa->regionbase : &sl->regionbase; + ARegion *ar = MEM_callocN(sizeof(ARegion), "navigation bar for properties"); + ARegion *ar_header = NULL; + + for (ar_header = regionbase->first; ar_header; ar_header = ar_header->next) { + if (ar_header->regiontype == RGN_TYPE_HEADER) { + break; + } + } + BLI_assert(ar_header); + + BLI_insertlinkafter(regionbase, ar_header, ar); + + ar->regiontype = RGN_TYPE_NAV_BAR; + ar->alignment = RGN_ALIGN_LEFT; + } + } + } + } + } } diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c index b622bc016f5..e3748d9a74b 100644 --- a/source/blender/blenloader/intern/versioning_userdef.c +++ b/source/blender/blenloader/intern/versioning_userdef.c @@ -81,8 +81,12 @@ static void do_versions_theme(UserDef *userdef, bTheme *btheme) if (!USER_VERSION_ATLEAST(280, 28)) { copy_v4_v4_char(btheme->tact.ds_ipoline, U_theme_default.tact.ds_ipoline); } -#undef USER_VERSION_ATLEAST + if (!USER_VERSION_ATLEAST(280, 29)) { + copy_v4_v4_char(btheme->tbuts.navigation_bar, U_theme_default.ttopbar.header); + } + +#undef USER_VERSION_ATLEAST } /* patching UserDef struct and Themes */ |