Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJulian Eisel <julian@blender.org>2021-11-25 19:15:48 +0300
committerJulian Eisel <julian@blender.org>2021-11-25 19:15:48 +0300
commit5a11c6e558c6581cc07d2a1d67db460241255f09 (patch)
tree87bb8fcec8b75955bb1534dfb622d480452502db
parent5514ca58a4d4e03d9062bc479488faca7e577677 (diff)
Fix missing margin below panels
A minor cosmetic fix. When the view was scrolled all the way to the bottom, the lowest panel would end right on the view edge. The scrollable view should get the same margin at the bottom as used at the top.
-rw-r--r--source/blender/editors/interface/interface_panel.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_panel.c b/source/blender/editors/interface/interface_panel.c
index d1daf5b48bf..06edf46fab7 100644
--- a/source/blender/editors/interface/interface_panel.c
+++ b/source/blender/editors/interface/interface_panel.c
@@ -1827,6 +1827,7 @@ static void ui_panels_size(ARegion *region, int *r_x, int *r_y)
{
int sizex = 0;
int sizey = 0;
+ bool has_panel_with_background = false;
/* Compute size taken up by panels, for setting in view2d. */
LISTBASE_FOREACH (Panel *, panel, &region->panels) {
@@ -1836,6 +1837,9 @@ static void ui_panels_size(ARegion *region, int *r_x, int *r_y)
sizex = max_ii(sizex, pa_sizex);
sizey = min_ii(sizey, pa_sizey);
+ if (UI_panel_should_show_background(region, panel->type)) {
+ has_panel_with_background = true;
+ }
}
}
@@ -1845,6 +1849,11 @@ static void ui_panels_size(ARegion *region, int *r_x, int *r_y)
if (sizey == 0) {
sizey = -UI_PANEL_WIDTH;
}
+ /* Extra margin after the list so the view scrolls a few pixels further than the panel border.
+ * Also makes the bottom match the top margin. */
+ if (has_panel_with_background) {
+ sizey -= UI_PANEL_MARGIN_Y;
+ }
*r_x = sizex;
*r_y = sizey;