diff options
author | Severin <eiseljulian@gmail.com> | 2018-06-30 17:51:31 +0300 |
---|---|---|
committer | Severin <eiseljulian@gmail.com> | 2018-06-30 18:01:03 +0300 |
commit | b08fa7a6d981d8fa28a03a288b89bba909fb5092 (patch) | |
tree | ea722c86bef632ce91fccc9108ee4f371105e008 /source/blender/editors/screen/area.c | |
parent | eb47ac45698fff46bf3cfb26f16223ff49ccf1d0 (diff) |
UI: Support status-bar hiding
Just like the top-bar, the status-bar can now be hidden/collapsed by dragging
its edge. We display a small line with the editor outline color then, so there
is something that can be dragged up to un-collapse the area again.
This collapsed state is not written to files yet.
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r-- | source/blender/editors/screen/area.c | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index e96580855d3..207047c2ad3 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -421,6 +421,17 @@ void ED_area_do_msg_notify_tag_refresh( ED_area_tag_refresh(sa); } +/** + * Although there's no general support for minimizing areas, the status-bar can + * be snapped to be only a few pixels high. A few pixels rather than 0 so it + * can be un-minimized again. We consider it pseudo-minimalized and don't draw + * it then. + */ +static bool area_is_pseudo_minimized(const ScrArea *area) +{ + return (area->winx < 3) || (area->winy < 3); +} + /* only exported for WM */ void ED_region_do_layout(bContext *C, ARegion *ar) { @@ -432,7 +443,7 @@ void ED_region_do_layout(bContext *C, ARegion *ar) return; } - if (at->do_lock) { + if (at->do_lock || (sa && area_is_pseudo_minimized(sa))) { return; } @@ -462,8 +473,13 @@ void ED_region_do_draw(bContext *C, ARegion *ar) UI_SetTheme(sa ? sa->spacetype : 0, at->regionid); + if (sa && area_is_pseudo_minimized(sa)) { + UI_ThemeClearColor(TH_EDITOR_OUTLINE); + glClear(GL_COLOR_BUFFER_BIT); + return; + } /* optional header info instead? */ - if (ar->headerstr) { + else if (ar->headerstr) { UI_ThemeClearColor(TH_HEADER); glClear(GL_COLOR_BUFFER_BIT); |