diff options
author | Pablo Vazquez <pablo@blender.org> | 2021-09-15 02:45:54 +0300 |
---|---|---|
committer | Pablo Vazquez <pablo@blender.org> | 2021-09-15 02:47:35 +0300 |
commit | ae42e4be1df05e9b174b8afece7b89f2a62f766b (patch) | |
tree | d5f9dfad1a981f7a02cb94d62067fb2786339c40 /source/blender/editors/screen | |
parent | 8085f1e320289ade3a757a12b23f2e9b78d82725 (diff) |
UI: Match subpanels look with regular panels
By having coloured headers and offset the background.
TODO: Add margin to the bottom on the last subpanel.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r-- | source/blender/editors/screen/area.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 6215e7b976e..16cca1edce3 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -2654,7 +2654,7 @@ static void ed_panel_draw(const bContext *C, bool open; panel = UI_panel_begin(region, lb, block, pt, panel, &open); - + const bool is_subpanel = (panel->type && panel->type->parent != NULL); const bool search_filter_active = search_filter != NULL && search_filter[0] != '\0'; /* bad fixed values */ @@ -2719,8 +2719,12 @@ static void ed_panel_draw(const bContext *C, short panelContext; /* Extra offset and panel width adjustment to accomodate sides margin (style->panelouter). */ - const int xofs = (pt->flag & PANEL_TYPE_NO_HEADER) ? 0 : style->panelouter; const int wofs = (pt->flag & PANEL_TYPE_NO_HEADER) ? style->panelouter : 0; + int xofs = (pt->flag & PANEL_TYPE_NO_HEADER) ? 0 : style->panelouter; + + if (is_subpanel) { + xofs += style->panelouter; + } /* panel context can either be toolbar region or normal panels region */ if (pt->flag & PANEL_TYPE_LAYOUT_VERT_BAR) { @@ -2769,7 +2773,7 @@ static void ed_panel_draw(const bContext *C, &panel->children, child_pt, child_panel, - w, + w - style->panelouter, em, unique_panel_str, search_filter); |