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
This commit is contained in:
Dalai Felinto
2021-09-15 13:12:40 +02:00
parent f2cfad77f9
commit 867e6ffe88
4 changed files with 14 additions and 0 deletions

View File

@@ -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;
}

View File

@@ -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);

View File

@@ -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 */

View File

@@ -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(