diff options
author | Dalai Felinto <dalai@blender.org> | 2021-09-15 14:12:40 +0300 |
---|---|---|
committer | Dalai Felinto <dalai@blender.org> | 2021-09-16 17:02:33 +0300 |
commit | 867e6ffe88f830cbfa158de95dea7cbb155e3fdb (patch) | |
tree | 76367108d131477ebbb6c3c03f81bb1a8690efbf /source | |
parent | f2cfad77f9f8876edfdc9930206fc12db71f25b0 (diff) |
App Settings: Edge Resize
This prevents both editor resize as well as regions (e.g., the toolbar).
Note: This option is not visible in the UI.
Differential Revision: D12516
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/screen/area.c | 4 | ||||
-rw-r--r-- | source/blender/editors/screen/screen_geometry.c | 4 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_userdef_types.h | 1 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_userdef.c | 5 |
4 files changed, 14 insertions, 0 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c index 384445db9fb..9546035375c 100644 --- a/source/blender/editors/screen/area.c +++ b/source/blender/editors/screen/area.c @@ -1062,6 +1062,10 @@ static bool region_azone_edge_poll(const ARegion *region, const bool is_fullscre return false; } + if (!is_hidden && (U.app_flag & USER_APP_LOCK_EDGE_RESIZE)) { + return false; + } + return true; } diff --git a/source/blender/editors/screen/screen_geometry.c b/source/blender/editors/screen/screen_geometry.c index 51edad0332b..e67c933cb8e 100644 --- a/source/blender/editors/screen/screen_geometry.c +++ b/source/blender/editors/screen/screen_geometry.c @@ -130,6 +130,10 @@ ScrEdge *screen_geom_find_active_scredge(const wmWindow *win, const int mx, const int my) { + if (U.app_flag & USER_APP_LOCK_EDGE_RESIZE) { + return NULL; + } + /* Use layout size (screen excluding global areas) for screen-layout area edges */ rcti screen_rect; WM_window_screen_rect_calc(win, &screen_rect); diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h index 2203068928c..5137fc30f95 100644 --- a/source/blender/makesdna/DNA_userdef_types.h +++ b/source/blender/makesdna/DNA_userdef_types.h @@ -1137,6 +1137,7 @@ typedef enum eUserpref_TableAPI { typedef enum eUserpref_APP_Flag { USER_APP_LOCK_CORNER_SPLIT = (1 << 0), USER_APP_HIDE_REGION_TOGGLE = (1 << 1), + USER_APP_LOCK_EDGE_RESIZE = (1 << 2), } 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 a457cb980ee..ff33dc8a2ee 100644 --- a/source/blender/makesrna/intern/rna_userdef.c +++ b/source/blender/makesrna/intern/rna_userdef.c @@ -6246,6 +6246,11 @@ static void rna_def_userdef_apps(BlenderRNA *brna) 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_edge_resize", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_boolean_negative_sdna(prop, NULL, "app_flag", USER_APP_LOCK_EDGE_RESIZE); + RNA_def_property_ui_text(prop, "Edge Resize", "Resize editors by dragging from the edges"); + 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( |