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:
authorAndrea Weikert <elubie@gmx.net>2019-08-18 17:34:39 +0300
committerAndrea Weikert <elubie@gmx.net>2019-08-18 17:42:41 +0300
commit38380ddca373cd7f49e3d6e831480ff05a2af72e (patch)
tree4aa23983fd0f9454b30f99b0258712b8c21b6284 /source/blender/editors
parent454b120f48201abe2e1a9ca7e5d25c28cb04013a (diff)
Fix T67008: Missing move handle and flickering in FileBrowser
Fix T67008: Missing move handle and flickering in FileBrowser Allow split regions (child regions) to contribute to the action zones (azone) of the parent region. This fixes the issues in file browser and also in the user preferences. Reviewers: Severin, mont29, campbellbarton Reviewed By: Severin, mont29, campbellbarton Subscribers: brecht, campbellbarton Maniphest Tasks: T67008 Differential Revision: https://developer.blender.org/D5273
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/screen/area.c38
-rw-r--r--source/blender/editors/screen/screen_ops.c20
2 files changed, 46 insertions, 12 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 1775a0c55a2..8a5b30df1a4 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -1052,16 +1052,11 @@ static void region_azones_scrollbars_initialize(ScrArea *sa, ARegion *ar)
}
/* *************************************************************** */
-
-static void region_azones_add(const bScreen *screen, ScrArea *sa, ARegion *ar, const int alignment)
+static void region_azones_add_edge(ScrArea *sa,
+ ARegion *ar,
+ const int alignment,
+ const bool is_fullscreen)
{
- const bool is_fullscreen = screen->state == SCREENFULL;
-
- /* Only display tab or icons when the header region is hidden
- * (not the tool header - they overlap). */
- if (ar->regiontype == RGN_TYPE_TOOL_HEADER) {
- return;
- }
/* edge code (t b l r) is along which area edge azone will be drawn */
if (alignment == RGN_ALIGN_TOP) {
@@ -1077,6 +1072,27 @@ static void region_azones_add(const bScreen *screen, ScrArea *sa, ARegion *ar, c
region_azone_edge_initialize(sa, ar, AE_RIGHT_TO_TOPLEFT, is_fullscreen);
}
+}
+
+static void region_azones_add(const bScreen *screen, ScrArea *sa, ARegion *ar)
+{
+ const bool is_fullscreen = screen->state == SCREENFULL;
+
+ /* Only display tab or icons when the header region is hidden
+ * (not the tool header - they overlap). */
+ if (ar->regiontype == RGN_TYPE_TOOL_HEADER) {
+ return;
+ }
+
+ region_azones_add_edge(sa, ar, RGN_ALIGN_ENUM_FROM_MASK(ar->alignment), is_fullscreen);
+
+ /* For a split region also continue the azone edge from the next region if this region is aligned
+ * with the next */
+ if ((ar->alignment & RGN_SPLIT_PREV) && ar->prev) {
+ region_azones_add_edge(
+ sa, ar, RGN_ALIGN_ENUM_FROM_MASK(ar->prev->alignment), is_fullscreen);
+ }
+
if (is_fullscreen) {
fullscreen_azone_initialize(sa, ar);
}
@@ -1695,7 +1711,7 @@ void ED_area_update_region_sizes(wmWindowManager *wm, wmWindow *win, ScrArea *ar
}
/* Some AZones use View2D data which is only updated in region init, so call that first! */
- region_azones_add(screen, area, ar, RGN_ALIGN_ENUM_FROM_MASK(ar->alignment));
+ region_azones_add(screen, area, ar);
}
ED_area_azones_update(area, &win->eventstate->x);
@@ -1766,7 +1782,7 @@ void ED_area_initialize(wmWindowManager *wm, wmWindow *win, ScrArea *sa)
}
/* Some AZones use View2D data which is only updated in region init, so call that first! */
- region_azones_add(screen, sa, ar, RGN_ALIGN_ENUM_FROM_MASK(ar->alignment));
+ region_azones_add(screen, sa, ar);
}
/* Avoid re-initializing tools while resizing the window. */
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 885cd1ee77d..72fec68070b 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -2458,6 +2458,15 @@ static int area_max_regionsize(ScrArea *sa, ARegion *scalear, AZEdge edge)
return dist;
}
+static bool is_split_edge(const int alignment, const AZEdge edge)
+{
+ return ((alignment == RGN_ALIGN_BOTTOM) && (edge == AE_TOP_TO_BOTTOMRIGHT)) ||
+ ((alignment == RGN_ALIGN_TOP) && (edge == AE_BOTTOM_TO_TOPLEFT)) ||
+ ((alignment == RGN_ALIGN_LEFT) && (edge == AE_RIGHT_TO_TOPLEFT)) ||
+ ((alignment == RGN_ALIGN_RIGHT) && (edge == AE_LEFT_TO_TOPRIGHT));
+
+}
+
static int region_scale_invoke(bContext *C, wmOperator *op, const wmEvent *event)
{
sActionzoneData *sad = event->customdata;
@@ -2476,7 +2485,16 @@ static int region_scale_invoke(bContext *C, wmOperator *op, const wmEvent *event
op->customdata = rmd;
rmd->az = az;
- rmd->ar = az->ar;
+ /* special case for region within region - this allows the scale of
+ * the parent region if the azone edge is not the edge splitting
+ * both regions */
+ if ((az->ar->alignment & RGN_SPLIT_PREV) && az->ar->prev &&
+ !is_split_edge(RGN_ALIGN_ENUM_FROM_MASK(az->ar->alignment), az->edge)) {
+ rmd->ar = az->ar->prev;
+ }
+ else {
+ rmd->ar = az->ar;
+ }
rmd->sa = sad->sa1;
rmd->edge = az->edge;
rmd->origx = event->x;