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:
authorJulian Eisel <julian@blender.org>2021-08-02 17:45:56 +0300
committerJulian Eisel <julian@blender.org>2021-08-02 18:00:20 +0300
commitd8bf332f86b3644b016950b596bb0814f245e995 (patch)
treeb3beff3f3e1f659ea8472bf922e94609c95d9cf7 /source/blender/makesrna/intern/rna_space.c
parent0e4f7b4a4b328d1d62c9c5e6a57e58c89a0e9aa2 (diff)
Asset Browser: Adjust header pulldowns to be Asset Browser specific
So far the Asset Browser just showed the same menus as the File Browser. Not all of their entries made sense for the Asset Browser though. I decided to just give them entirely different classes to avoid confusing if-else checks everywhere. I think the code duplication this adds is a minor issue, it's better to keep things seperated clearly IMO. * View menu: Add "Asset Details" toggle for the sidebar region. * View menu: Remove recursion sub-menu * View menu: Remove "File Path" region toggle, which doesn't apply for the Asset Browser. Differential Revision: https://developer.blender.org/D12057
Diffstat (limited to 'source/blender/makesrna/intern/rna_space.c')
-rw-r--r--source/blender/makesrna/intern/rna_space.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c
index 1d4318602c2..796e62c8b2a 100644
--- a/source/blender/makesrna/intern/rna_space.c
+++ b/source/blender/makesrna/intern/rna_space.c
@@ -778,6 +778,19 @@ static void rna_Space_show_region_toolbar_update(bContext *C, PointerRNA *ptr)
rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_TOOLS, RGN_FLAG_HIDDEN);
}
+static bool rna_Space_show_region_tool_props_get(PointerRNA *ptr)
+{
+ return !rna_Space_bool_from_region_flag_get_by_type(ptr, RGN_TYPE_TOOL_PROPS, RGN_FLAG_HIDDEN);
+}
+static void rna_Space_show_region_tool_props_set(PointerRNA *ptr, bool value)
+{
+ rna_Space_bool_from_region_flag_set_by_type(ptr, RGN_TYPE_TOOL_PROPS, RGN_FLAG_HIDDEN, !value);
+}
+static void rna_Space_show_region_tool_props_update(bContext *C, PointerRNA *ptr)
+{
+ rna_Space_bool_from_region_flag_update_by_type(C, ptr, RGN_TYPE_TOOL_PROPS, RGN_FLAG_HIDDEN);
+}
+
/* Channels Region. */
static bool rna_Space_show_region_channels_get(PointerRNA *ptr)
{
@@ -3196,6 +3209,10 @@ static void rna_def_space_generic_show_region_toggles(StructRNA *srna, int regio
region_type_mask &= ~(1 << RGN_TYPE_TOOLS);
DEF_SHOW_REGION_PROPERTY(show_region_toolbar, "Toolbar", "");
}
+ if (region_type_mask & (1 << RGN_TYPE_TOOL_PROPS)) {
+ region_type_mask &= ~(1 << RGN_TYPE_TOOL_PROPS);
+ DEF_SHOW_REGION_PROPERTY(show_region_tool_props, "Toolbar", "");
+ }
if (region_type_mask & (1 << RGN_TYPE_CHANNELS)) {
region_type_mask &= ~(1 << RGN_TYPE_CHANNELS);
DEF_SHOW_REGION_PROPERTY(show_region_channels, "Channels", "");
@@ -6546,7 +6563,8 @@ static void rna_def_space_filebrowser(BlenderRNA *brna)
RNA_def_struct_sdna(srna, "SpaceFile");
RNA_def_struct_ui_text(srna, "Space File Browser", "File browser space data");
- rna_def_space_generic_show_region_toggles(srna, (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_UI));
+ rna_def_space_generic_show_region_toggles(
+ srna, (1 << RGN_TYPE_TOOLS) | (1 << RGN_TYPE_UI) | (1 << RGN_TYPE_TOOL_PROPS));
prop = RNA_def_property(srna, "browse_mode", PROP_ENUM, PROP_NONE);
RNA_def_property_enum_items(prop, rna_enum_space_file_browse_mode_items);