[Bf-blender-cvs] [b4010005de3] blender2.8: UI: move general mode options to right of topbar

Campbell Barton noreply at git.blender.org
Sat May 12 14:44:01 CEST 2018


Commit: b4010005de36c37797f6f8416b8c3a32703e152f
Author: Campbell Barton
Date:   Sat May 12 14:43:29 2018 +0200
Branches: blender2.8
https://developer.blender.org/rBb4010005de36c37797f6f8416b8c3a32703e152f

UI: move general mode options to right of topbar

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

M	release/scripts/startup/bl_ui/space_topbar.py

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

diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 61d74b99559..0b22d1baaee 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -147,36 +147,53 @@ class TOPBAR_HT_lower_bar(Header):
         if draw_fn is not None:
             draw_fn(context, layout)
 
+        # Note: general mode options should be added to 'draw_right'.
         if mode == 'SCULPT':
             layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".paint_common", category="")
-            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".sculpt_mode", category="")
         elif mode == 'PAINT_VERTEX':
             layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".paint_common", category="")
-            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".vertexpaint", category="")
         elif mode == 'PAINT_WEIGHT':
             layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".paint_common", category="")
-            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".weightpaint", category="")
         elif mode == 'PAINT_TEXTURE':
             layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".paint_common", category="")
-            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".imagepaint", category="")
-
         elif mode == 'EDIT_ARMATURE':
-            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".armature_edit", category="")
+            pass
         elif mode == 'EDIT_CURVE':
-            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".curve_edit", category="")
+            pass
         elif mode == 'EDIT_MESH':
-            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".mesh_edit", category="")
-
+            pass
         elif mode == 'POSE':
             layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".posemode", category="")
         elif mode == 'PARTICLE':
             layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".paint_common", category="")
-            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".particlemode", category="")
 
 
     def draw_right(self, context):
         layout = self.layout
 
+        # General options, note, these _could_ display at the RHS of the draw_left callback.
+        # we just want them not to be confused with tool options.
+        mode = context.mode
+
+        if mode == 'SCULPT':
+            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".sculpt_mode", category="")
+        elif mode == 'PAINT_VERTEX':
+            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".vertexpaint", category="")
+        elif mode == 'PAINT_WEIGHT':
+            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".weightpaint", category="")
+        elif mode == 'PAINT_TEXTURE':
+            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".imagepaint", category="")
+        elif mode == 'EDIT_ARMATURE':
+            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".armature_edit", category="")
+        elif mode == 'EDIT_CURVE':
+            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".curve_edit", category="")
+        elif mode == 'EDIT_MESH':
+            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".mesh_edit", category="")
+        elif mode == 'POSE':
+            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".posemode", category="")
+        elif mode == 'PARTICLE':
+            layout.popover_group(space_type='VIEW_3D', region_type='TOOLS', context=".particlemode", category="")
+
         # Command Settings (redo)
         op = context.active_operator
         row = layout.row()



More information about the Bf-blender-cvs mailing list