diff options
author | Julian Eisel <eiseljulian@gmail.com> | 2018-05-23 23:38:25 +0300 |
---|---|---|
committer | Julian Eisel <eiseljulian@gmail.com> | 2018-05-23 23:38:25 +0300 |
commit | 6f20fcd5984a47baee9ff440e9e59584fccd1e59 (patch) | |
tree | 5b81aad5b91eb0893a4e0b9276ae2819e66cb631 /source/blender/editors/screen/area.c | |
parent | 7b58073dc09c7241dfa08071323dfb7af3646e80 (diff) |
UI: Global "Status-bar" Area (WIP)
* Add horizontal bar at bottom of all non-temp windows, similar to the Top-bar.
* Status-bar is hidden in UI-less fullscreen mode
* Current contents are preliminary and based on T54861:
** Left: Current file-path if needed. "(Modified)" note if file was changed.
** Center: Scene statistics (like in 2.7 Info Editor).
** Right: Progress-bars and reports
* Internally managed as own "STATUSBAR" editor-type (hidden in UI).
* Like with the Top-bar, Status-bar data and SDNA writing is disabled.
* Most changes in low-level screen/area code are to support layout bounds that differ from window bounds.
Design task: T54861
Main changes approved by @brecht.
Diffstat (limited to 'source/blender/editors/screen/area.c')
-rw-r--r-- | source/blender/editors/screen/area.c | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index dc5c9be04c8..e8192c4ce90 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1259,7 +1259,7 @@ static void region_rect_recursive(wmWindow *win, ScrArea *sa, ARegion *ar, rcti region_rect_recursive(win, sa, ar->next, remainder, overlap_remainder, quad); } -static void area_calc_totrct(ScrArea *sa, int window_size_x, int window_size_y) +static void area_calc_totrct(ScrArea *sa, const rcti *window_rect) { short px = (short)U.pixelsize; @@ -1269,16 +1269,16 @@ static void area_calc_totrct(ScrArea *sa, int window_size_x, int window_size_y) sa->totrct.ymax = sa->v2->vec.y; /* scale down totrct by 1 pixel on all sides not matching window borders */ - if (sa->totrct.xmin > 0) { + if (sa->totrct.xmin > window_rect->xmin) { sa->totrct.xmin += px; } - if (sa->totrct.xmax < (window_size_x - 1)) { + if (sa->totrct.xmax < (window_rect->xmax - 1)) { sa->totrct.xmax -= px; } - if (sa->totrct.ymin > 0) { + if (sa->totrct.ymin > window_rect->ymin) { sa->totrct.ymin += px; } - if (sa->totrct.ymax < (window_size_y - 1)) { + if (sa->totrct.ymax < (window_rect->ymax - 1)) { sa->totrct.ymax -= px; } /* Although the following asserts are correct they lead to a very unstable Blender. @@ -1373,15 +1373,15 @@ static void ed_default_handlers(wmWindowManager *wm, ScrArea *sa, ListBase *hand void ED_area_update_region_sizes(wmWindowManager *wm, wmWindow *win, ScrArea *area) { + rcti rect, overlap_rect; + rcti window_rect; + if (!(area->flag & AREA_FLAG_REGION_SIZE_UPDATE)) { return; } - const int size_x = WM_window_pixels_x(win); - const int size_y = WM_window_pixels_y(win); - rcti rect, overlap_rect; - - area_calc_totrct(area, size_x, size_y); + WM_window_rect_calc(win, &window_rect); + area_calc_totrct(area, &window_rect); /* region rect sizes */ rect = area->totrct; @@ -1406,15 +1406,14 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa) WorkSpace *workspace = WM_window_get_active_workspace(win); const bScreen *screen = BKE_workspace_active_screen_get(win->workspace_hook); Scene *scene = WM_window_get_active_scene(win); - - const int window_size_x = WM_window_pixels_x(win); - const int window_size_y = WM_window_pixels_y(win); ARegion *ar; rcti rect, overlap_rect; + rcti window_rect; if (ED_area_is_global(sa) && (sa->global->flag & GLOBAL_AREA_IS_HIDDEN)) { return; } + WM_window_rect_calc(win, &window_rect); /* set typedefinitions */ sa->type = BKE_spacetype_from_id(sa->spacetype); @@ -1428,7 +1427,7 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa) ar->type = BKE_regiontype_from_id(sa->type, ar->regiontype); /* area sizes */ - area_calc_totrct(sa, window_size_x, window_size_y); + area_calc_totrct(sa, &window_rect); /* region rect sizes */ rect = sa->totrct; |