Cleanup: adjust layout for example experimental UI
authorCampbell Barton <ideasman42@gmail.com>
Fri, 8 Nov 2019 05:42:49 +0000 (16:42 +1100)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 8 Nov 2019 05:45:18 +0000 (16:45 +1100)
- Use a separate split for each feature,
  since two top-level splits can become un-aligned.
- Only show the task instead of the entire URL.

release/scripts/startup/bl_ui/space_userpref.py

index 1b40885ff9ed7ee56a0a7b1d71dee61bae04a768..e5c65ac0905d2d3e5e9d3f714e9a017350625ded 100644 (file)
@@ -2166,29 +2166,30 @@ class USERPREF_PT_experimental_all(ExperimentalPanel, Panel):
 
 
 """
-Example panel, leave it here so we always have a template to follow even
-after the features are gone from the experimental panel.
+Example panel, leave it here so we always have a template to follow even
+after the features are gone from the experimental panel.
 
 class USERPREF_PT_experimental_virtual_reality(ExperimentalPanel, Panel):
     bl_label = "Virtual Reality"
 
-    def draw_props(self, context, _layout):
+    def draw_props(self, context, layout):
         prefs = context.preferences
         experimental = prefs.experimental
-        _layout.active = not experimental.use_experimental_all
-
-        row = _layout.row()
-        split = row.split().column()
-        split.prop(experimental, "use_virtual_reality_scene_inspection, text="Scene Inspection")
-        split.prop(experimental, "use_virtual_reality_immersive_drawing", text="Continuous Immersive Drawing")
-
-        split = row.split().column()
-        split.operator(
-                "wm.url_open", text="https://developer.blender.org/T71347", icon='URL',
-                ).url = "https://developer.blender.org/T71347"
-        split.operator(
-                "wm.url_open", text="https://developer.blender.org/T71348", icon='URL',
-                ).url = "https://developer.blender.org/T71348"
+        layout.active = not experimental.use_experimental_all
+
+        task = "T71347"
+        split = layout.split(factor=0.66)
+        col = split.split()
+        col.prop(experimental, "use_virtual_reality_scene_inspection", text="Scene Inspection")
+        col = split.split()
+        col.operator("wm.url_open", text=task, icon='URL').url = "https://developer.blender.org/" + task
+
+        task = "T71348"
+        split = layout.split(factor=0.66)
+        col = split.column()
+        col.prop(experimental, "use_virtual_reality_immersive_drawing", text="Continuous Immersive Drawing")
+        col = split.column()
+        col.operator("wm.url_open", text=task, icon='URL').url = "https://developer.blender.org/" + task
 """