[Bf-blender-cvs] [f2cfad77f9f] master: App Settings: Regions Visbility Toggle

Dalai Felinto noreply at git.blender.org
Thu Sep 16 16:03:06 CEST 2021


Commit: f2cfad77f9f8876edfdc9930206fc12db71f25b0
Author: Dalai Felinto
Date:   Thu Sep 16 15:27:36 2021 +0200
Branches: master
https://developer.blender.org/rBf2cfad77f9f8876edfdc9930206fc12db71f25b0

App Settings: Regions Visbility Toggle

The toggle that allow users to "show" the region (header, toolbar, ...)
when it is collapsed can now be configured for the apps.

Note: This option is not visibile in the UI.

Differential Revision: D12516

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

M	source/blender/editors/screen/area.c
M	source/blender/makesdna/DNA_userdef_types.h
M	source/blender/makesrna/intern/rna_userdef.c

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

diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index e907c7e153f..384445db9fb 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1058,6 +1058,10 @@ static bool region_azone_edge_poll(const ARegion *region, const bool is_fullscre
     return false;
   }
 
+  if (is_hidden && (U.app_flag & USER_APP_HIDE_REGION_TOGGLE)) {
+    return false;
+  }
+
   return true;
 }
 
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index 37a3d60a647..2203068928c 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -1136,6 +1136,7 @@ typedef enum eUserpref_TableAPI {
 /** #UserDef.app_flag */
 typedef enum eUserpref_APP_Flag {
   USER_APP_LOCK_CORNER_SPLIT = (1 << 0),
+  USER_APP_HIDE_REGION_TOGGLE = (1 << 1),
 } eUserpref_APP_Flag;
 
 /** #UserDef.statusbar_flag */
diff --git a/source/blender/makesrna/intern/rna_userdef.c b/source/blender/makesrna/intern/rna_userdef.c
index 0a123c59ee2..a457cb980ee 100644
--- a/source/blender/makesrna/intern/rna_userdef.c
+++ b/source/blender/makesrna/intern/rna_userdef.c
@@ -6245,6 +6245,12 @@ static void rna_def_userdef_apps(BlenderRNA *brna)
   RNA_def_property_ui_text(
       prop, "Corner Splitting", "Split and join editors by dragging from corners");
   RNA_def_property_update(prop, 0, "rna_userdef_screen_update");
+
+  prop = RNA_def_property(srna, "show_regions_visibility_toggle", PROP_BOOLEAN, PROP_NONE);
+  RNA_def_property_boolean_negative_sdna(prop, NULL, "app_flag", USER_APP_HIDE_REGION_TOGGLE);
+  RNA_def_property_ui_text(
+      prop, "Regions Visibility Toggle", "Header and side bars visibility toggles");
+  RNA_def_property_update(prop, 0, "rna_userdef_screen_update");
 }
 
 static void rna_def_userdef_experimental(BlenderRNA *brna)



More information about the Bf-blender-cvs mailing list