diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2019-09-29 21:16:19 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2019-09-29 21:37:51 +0300 |
commit | 57519f237a914aa2645c44bf86917c05f6e45e30 (patch) | |
tree | db0905759ccfff7a1150e867ee160cb39ea4f905 /source/blender/editors/space_file/space_file.c | |
parent | 02c4410a370413b88b90a1403136c60cf21c870b (diff) |
UI: Let file browser tool/bookmarks region push upper bar in
Main reason for doing this is that the navigation buttons are very
close to the file list now, making them much faster to reach.
Initially we let the upper bar (the one with the file path, navigation
and display buttons) use full area width, because designs back then had
more horizontal space problems. The designs have changed meanwhile, and
horizontal space is less of an issue.
However, when the file browser is shrunk horizontally, or if it's open
in a small area (e.g. see "Shading" workspace), having the tool region
open brings back the space issues. But even the file list layout becomes
problematic then, and the same issue was present before the new file
browser design, so we've decided this is an acceptable tradeoff.
Diffstat (limited to 'source/blender/editors/space_file/space_file.c')
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index 2f0e796d500..d63fcf402de 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -106,6 +106,12 @@ static SpaceLink *file_new(const ScrArea *UNUSED(area), const Scene *UNUSED(scen /* Ignore user preference "USER_HEADER_BOTTOM" here (always show top for new types). */ ar->alignment = RGN_ALIGN_TOP; + /* Tools region */ + ar = MEM_callocN(sizeof(ARegion), "tools region for file"); + BLI_addtail(&sfile->regionbase, ar); + ar->regiontype = RGN_TYPE_TOOLS; + ar->alignment = RGN_ALIGN_LEFT; + /* ui list region */ ar = MEM_callocN(sizeof(ARegion), "ui region for file"); BLI_addtail(&sfile->regionbase, ar); @@ -113,12 +119,6 @@ static SpaceLink *file_new(const ScrArea *UNUSED(area), const Scene *UNUSED(scen ar->alignment = RGN_ALIGN_TOP; ar->flag |= RGN_FLAG_DYNAMIC_SIZE; - /* Tools region */ - ar = MEM_callocN(sizeof(ARegion), "tools region for file"); - BLI_addtail(&sfile->regionbase, ar); - ar->regiontype = RGN_TYPE_TOOLS; - ar->alignment = RGN_ALIGN_LEFT; - /* Tool props and execute region are added as needed, see file_refresh(). */ /* main region */ @@ -239,14 +239,14 @@ static void file_ensure_valid_region_state(bContext *C, SpaceFile *sfile, FileSelectParams *params) { - ARegion *ar_tools = BKE_area_find_region_type(sa, RGN_TYPE_TOOLS); + ARegion *ar_ui = BKE_area_find_region_type(sa, RGN_TYPE_UI); ARegion *ar_props = BKE_area_find_region_type(sa, RGN_TYPE_TOOL_PROPS); ARegion *ar_execute = BKE_area_find_region_type(sa, RGN_TYPE_EXECUTE); bool needs_init = false; /* To avoid multiple ED_area_initialize() calls. */ /* If there's an file-operation, ensure we have the option and execute region */ if (sfile->op && (ar_props == NULL)) { - ar_execute = file_execute_region_ensure(sa, ar_tools); + ar_execute = file_execute_region_ensure(sa, ar_ui); ar_props = file_tool_props_region_ensure(sa, ar_execute); if (params->flag & FILE_HIDE_TOOL_PROPS) { |