[Bf-blender-cvs] [bbc3ee09e44] master: Fix T59445: top bar hides everything when there isn't enough space.

Brecht Van Lommel noreply at git.blender.org
Wed Mar 13 20:15:15 CET 2019


Commit: bbc3ee09e44bfaba1ca2d4ab6a6bf2a51976cdae
Author: Brecht Van Lommel
Date:   Wed Mar 13 20:13:09 2019 +0100
Branches: master
https://developer.blender.org/rBbbc3ee09e44bfaba1ca2d4ab6a6bf2a51976cdae

Fix T59445: top bar hides everything when there isn't enough space.

Left and right aligned regions get hidden when there is not enough space,
and the main center region was empty. Now remove the left region and put
its contents in the center region, so that it always remains.

===================================================================

M	release/scripts/startup/bl_ui/space_topbar.py
M	source/blender/editors/space_topbar/space_topbar.c

===================================================================

diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 48922911507..9bf2d48c6ee 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -90,12 +90,10 @@ class TOPBAR_HT_lower_bar(Header):
     def draw(self, context):
         region = context.region
 
-        if region.alignment == 'LEFT':
-            self.draw_left(context)
-        elif region.alignment == 'RIGHT':
+        if region.alignment == 'RIGHT':
             self.draw_right(context)
         else:
-            self.draw_center(context)
+            self.draw_left(context)
 
     def draw_left(self, context):
         layout = self.layout
@@ -159,9 +157,6 @@ class TOPBAR_HT_lower_bar(Header):
             elif context.uv_sculpt_object is not None:
                 layout.popover_group(space_type='PROPERTIES', region_type='WINDOW', context=".uv_sculpt", category="")
 
-    def draw_center(self, context):
-        pass
-
     def draw_right(self, context):
         layout = self.layout
 
diff --git a/source/blender/editors/space_topbar/space_topbar.c b/source/blender/editors/space_topbar/space_topbar.c
index e31f29cec8c..61a6517a83e 100644
--- a/source/blender/editors/space_topbar/space_topbar.c
+++ b/source/blender/editors/space_topbar/space_topbar.c
@@ -72,15 +72,11 @@ static SpaceLink *topbar_new(const ScrArea *UNUSED(area), const Scene *UNUSED(sc
 	ar->alignment = RGN_ALIGN_RIGHT | RGN_SPLIT_PREV;
 
 	/* main regions */
-	ar = MEM_callocN(sizeof(ARegion), "left aligned main region for topbar");
-	BLI_addtail(&stopbar->regionbase, ar);
-	ar->regiontype = RGN_TYPE_WINDOW;
-	ar->alignment = RGN_ALIGN_LEFT;
 	ar = MEM_callocN(sizeof(ARegion), "right aligned main region for topbar");
 	BLI_addtail(&stopbar->regionbase, ar);
 	ar->regiontype = RGN_TYPE_WINDOW;
 	ar->alignment = RGN_ALIGN_RIGHT;
-	ar = MEM_callocN(sizeof(ARegion), "center main region for topbar");
+	ar = MEM_callocN(sizeof(ARegion), "main region of topbar");
 	BLI_addtail(&stopbar->regionbase, ar);
 	ar->regiontype = RGN_TYPE_WINDOW;
 
@@ -117,7 +113,7 @@ static void topbar_main_region_init(wmWindowManager *wm, ARegion *region)
 	wmKeyMap *keymap;
 
 	/* force delayed UI_view2d_region_reinit call */
-	if (ELEM(region->alignment, RGN_ALIGN_LEFT, RGN_ALIGN_RIGHT)) {
+	if (ELEM(region->alignment, RGN_ALIGN_RIGHT)) {
 		region->flag |= RGN_FLAG_DYNAMIC_SIZE;
 	}
 	UI_view2d_region_reinit(&region->v2d, V2D_COMMONVIEW_HEADER, region->winx, region->winy);



More information about the Bf-blender-cvs mailing list