[Bf-blender-cvs] [cec957eb832] soc-2020-info-editor: UI: change filter buttons

Mateusz Grzeliński noreply at git.blender.org
Mon Jun 8 12:30:44 CEST 2020


Commit: cec957eb8323a190b571d4d32f7973f979c93e72
Author: Mateusz Grzeliński
Date:   Sun Jun 7 15:24:20 2020 +0200
Branches: soc-2020-info-editor
https://developer.blender.org/rBcec957eb8323a190b571d4d32f7973f979c93e72

UI: change filter buttons

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

M	release/scripts/startup/bl_ui/space_info.py
M	release/scripts/startup/bl_ui/space_outliner.py

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

diff --git a/release/scripts/startup/bl_ui/space_info.py b/release/scripts/startup/bl_ui/space_info.py
index 5f6dfba1a53..2497e007610 100644
--- a/release/scripts/startup/bl_ui/space_info.py
+++ b/release/scripts/startup/bl_ui/space_info.py
@@ -17,7 +17,7 @@
 # ##### END GPL LICENSE BLOCK #####
 
 # <pep8 compliant>
-from bpy.types import Header, Menu
+from bpy.types import Header, Menu, Panel
 
 
 class INFO_HT_header(Header):
@@ -27,19 +27,13 @@ class INFO_HT_header(Header):
         layout = self.layout
         layout.template_header()
 
-        sinfo = context.space_data
-
         INFO_MT_editor_menus.draw_collapsible(context, layout)
 
         layout.separator_spacer()
 
         row = layout.row(align=True)
-        row.prop(sinfo,"show_report_debug", icon_only=True)
-        row.prop(sinfo,"show_report_info", icon_only=True)
-        row.prop(sinfo,"show_report_operator", icon_only=True)
-        row.prop(sinfo,"show_report_warning", icon_only=True)
-        row.prop(sinfo,"show_report_error", icon_only=True)
-        row.prop(sinfo,"show_report_property", icon_only=True)
+        row.popover(panel="INFO_PT_report_type_visibility", text="", icon="FILTER")
+
 
 class INFO_MT_editor_menus(Menu):
     bl_idname = "INFO_MT_editor_menus"
@@ -125,6 +119,28 @@ class INFO_MT_context_menu(Menu):
         layout.operator("info.report_delete", text="Delete")
 
 
+class INFO_PT_report_type_visibility(Panel):
+    bl_space_type = 'INFO'
+    bl_region_type = 'HEADER'
+    bl_label = "Report Types"
+    # bl_ui_units_x = 8
+
+    def draw(self, context):
+        layout = self.layout
+
+        sinfo = context.space_data
+
+        layout.label(text="Report Types Visibility")
+        col = layout.column(align=True)
+        col.prop(sinfo, "show_report_debug", text="Debug")
+        col.prop(sinfo, "show_report_info", text="Info")
+        col.prop(sinfo, "show_report_operator", text="Operator")
+        col.prop(sinfo, "show_report_warning", text="Warning")
+        col.prop(sinfo, "show_report_error", text="Error")
+        col.prop(sinfo, "show_report_property", text="Property")
+        layout.separator()
+
+
 classes = (
     INFO_HT_header,
     INFO_MT_editor_menus,
@@ -132,6 +148,7 @@ classes = (
     INFO_MT_view,
     INFO_MT_info,
     INFO_MT_context_menu,
+    INFO_PT_report_type_visibility
 )
 
 if __name__ == "__main__":  # only for live edit.
diff --git a/release/scripts/startup/bl_ui/space_outliner.py b/release/scripts/startup/bl_ui/space_outliner.py
index ee8015df273..dd3913cd9d8 100644
--- a/release/scripts/startup/bl_ui/space_outliner.py
+++ b/release/scripts/startup/bl_ui/space_outliner.py
@@ -319,14 +319,24 @@ class OUTLINER_PT_filter(Panel):
 
     def draw(self, context):
         layout = self.layout
-
         space = context.space_data
+        layout.label(text="Restriction Toggles:")
+        row = layout.row(align=True)
+        row.prop(space, "show_restrict_column_enable")
+        row.prop(space, "show_restrict_column_select", text="")
+        row.prop(space, "show_restrict_column_hide", text="")
+        row.prop(space, "show_restrict_column_viewport", text="")
+        row.prop(space, "show_restrict_column_render", text="")
+        row.prop(space, "show_restrict_column_holdout", text="")
+        row.prop(space, "show_restrict_column_indirect_only", text="")
+        layout.separator()
+
         display_mode = space.display_mode
 
         if display_mode == 'VIEW_LAYER':
             layout.label(text="Restriction Toggles:")
             row = layout.row(align=True)
-            row.prop(space, "show_restrict_column_enable", text="")
+            row.prop(space, "show_restrict_column_enable")
             row.prop(space, "show_restrict_column_select", text="")
             row.prop(space, "show_restrict_column_hide", text="")
             row.prop(space, "show_restrict_column_viewport", text="")



More information about the Bf-blender-cvs mailing list