[Bf-blender-cvs] [8d53e8cd029] blender2.8: UI: hide user preferences from space menu
Campbell Barton
noreply at git.blender.org
Thu May 31 16:46:53 CEST 2018
Commit: 8d53e8cd029dbec02ba9aea1975d6ff780b161df
Author: Campbell Barton
Date: Thu May 31 16:44:20 2018 +0200
Branches: blender2.8
https://developer.blender.org/rB8d53e8cd029dbec02ba9aea1975d6ff780b161df
UI: hide user preferences from space menu
See T54744
===================================================================
M release/scripts/startup/bl_ui/space_userpref.py
M source/blender/makesrna/intern/rna_screen.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_userpref.py b/release/scripts/startup/bl_ui/space_userpref.py
index 1c6bf490f7a..5c9c3ea1c67 100644
--- a/release/scripts/startup/bl_ui/space_userpref.py
+++ b/release/scripts/startup/bl_ui/space_userpref.py
@@ -52,7 +52,8 @@ class USERPREF_HT_header(Header):
def draw(self, context):
layout = self.layout
- layout.template_header()
+ # No need to show type selector.
+ # layout.template_header()
userpref = context.user_preferences
diff --git a/source/blender/makesrna/intern/rna_screen.c b/source/blender/makesrna/intern/rna_screen.c
index deaf73bc9a5..7596ccb19fa 100644
--- a/source/blender/makesrna/intern/rna_screen.c
+++ b/source/blender/makesrna/intern/rna_screen.c
@@ -146,7 +146,7 @@ static const EnumPropertyItem *rna_Area_type_itemf(bContext *UNUSED(C), PointerR
/* +1 to skip SPACE_EMPTY */
for (const EnumPropertyItem *item_from = rna_enum_space_type_items + 1; item_from->identifier; item_from++) {
- if (ELEM(item_from->value, SPACE_TOPBAR, SPACE_STATUSBAR)) {
+ if (ELEM(item_from->value, SPACE_TOPBAR, SPACE_STATUSBAR, SPACE_USERPREF)) {
continue;
}
RNA_enum_item_add(&item, &totitem, item_from);
@@ -167,7 +167,7 @@ static int rna_Area_type_get(PointerRNA *ptr)
static void rna_Area_type_set(PointerRNA *ptr, int value)
{
- if (ELEM(value, SPACE_TOPBAR, SPACE_STATUSBAR)) {
+ if (ELEM(value, SPACE_TOPBAR, SPACE_STATUSBAR, SPACE_USERPREF)) {
/* Special case: An area can not be set to show the top-bar editor (or
* other global areas). However it should still be possible to identify
* its type from Python. */
@@ -225,7 +225,7 @@ static const EnumPropertyItem *rna_Area_ui_type_itemf(
/* +1 to skip SPACE_EMPTY */
for (const EnumPropertyItem *item_from = rna_enum_space_type_items + 1; item_from->identifier; item_from++) {
- if (ELEM(item_from->value, SPACE_TOPBAR, SPACE_STATUSBAR)) {
+ if (ELEM(item_from->value, SPACE_TOPBAR, SPACE_STATUSBAR, SPACE_USERPREF)) {
continue;
}
More information about the Bf-blender-cvs
mailing list