Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2018-05-31 17:44:20 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-05-31 17:46:24 +0300
commit8d53e8cd029dbec02ba9aea1975d6ff780b161df (patch)
tree0af4d160f2b7039b76e8149d6658c02cfda11f5a
parent361b3eb88e4f8ceaa589827828e17588eda9b9fc (diff)
UI: hide user preferences from space menu
See T54744
-rw-r--r--release/scripts/startup/bl_ui/space_userpref.py3
-rw-r--r--source/blender/makesrna/intern/rna_screen.c6
2 files changed, 5 insertions, 4 deletions
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;
}