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:
authorCampbell Barton <ideasman42@gmail.com>2018-08-16 05:43:30 +0300
committerCampbell Barton <ideasman42@gmail.com>2018-08-16 05:43:30 +0300
commit9a72342c6e1bed83e730280f8a7811936058cd98 (patch)
treefd236b458e19cc3f1bf757e3cb619b9dfe9a3222 /source/blender/editors/screen
parent4e41a44400c32ef80018d3a61ab5bd0a4c5c284c (diff)
UI: move region toggle closer to the screen edge
Reduces 3d view navigation widget overlap.
Diffstat (limited to 'source/blender/editors/screen')
-rw-r--r--source/blender/editors/screen/area.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/source/blender/editors/screen/area.c b/source/blender/editors/screen/area.c
index 034e75a1b87..3048d7c8156 100644
--- a/source/blender/editors/screen/area.c
+++ b/source/blender/editors/screen/area.c
@@ -872,14 +872,17 @@ static void region_azone_edge(AZone *az, ARegion *ar)
BLI_rcti_init(&az->rect, az->x1, az->x2, az->y1, az->y2);
}
-#define AZONEPAD_TAB_PLUSW (0.7f * U.widget_unit)
-#define AZONEPAD_TAB_PLUSH (0.7f * U.widget_unit)
-
/* region already made zero sized, in shape of edge */
static void region_azone_tab_plus(ScrArea *sa, AZone *az, ARegion *ar)
{
AZone *azt;
int tot = 0, add;
+ /* Edge offset multiplied by the */
+
+ float edge_offset = 1.0f;
+ const float tab_size_x = 0.7f * U.widget_unit;
+ const float tab_size_y = 0.7f * U.widget_unit;
+
for (azt = sa->actionzones.first; azt; azt = azt->next) {
if (azt->edge == az->edge) tot++;
@@ -888,28 +891,28 @@ static void region_azone_tab_plus(ScrArea *sa, AZone *az, ARegion *ar)
switch (az->edge) {
case AE_TOP_TO_BOTTOMRIGHT:
add = (ar->winrct.ymax == sa->totrct.ymin) ? 1 : 0;
- az->x1 = ar->winrct.xmax - 2.5f * AZONEPAD_TAB_PLUSW;
+ az->x1 = ar->winrct.xmax - ((edge_offset + 1.0f) * tab_size_x);
az->y1 = ar->winrct.ymax - add;
- az->x2 = ar->winrct.xmax - 1.5f * AZONEPAD_TAB_PLUSW;
- az->y2 = ar->winrct.ymax - add + AZONEPAD_TAB_PLUSH;
+ az->x2 = ar->winrct.xmax - (edge_offset * tab_size_x);
+ az->y2 = ar->winrct.ymax - add + tab_size_y;
break;
case AE_BOTTOM_TO_TOPLEFT:
- az->x1 = ar->winrct.xmax - 2.5f * AZONEPAD_TAB_PLUSW;
- az->y1 = ar->winrct.ymin - AZONEPAD_TAB_PLUSH;
- az->x2 = ar->winrct.xmax - 1.5f * AZONEPAD_TAB_PLUSW;
+ az->x1 = ar->winrct.xmax - ((edge_offset + 1.0f) * tab_size_x);
+ az->y1 = ar->winrct.ymin - tab_size_y;
+ az->x2 = ar->winrct.xmax - (edge_offset * tab_size_x);
az->y2 = ar->winrct.ymin;
break;
case AE_LEFT_TO_TOPRIGHT:
- az->x1 = ar->winrct.xmin - AZONEPAD_TAB_PLUSH;
- az->y1 = ar->winrct.ymax - 2.5f * AZONEPAD_TAB_PLUSW;
+ az->x1 = ar->winrct.xmin - tab_size_y;
+ az->y1 = ar->winrct.ymax - ((edge_offset + 1.0f) * tab_size_x);
az->x2 = ar->winrct.xmin;
- az->y2 = ar->winrct.ymax - 1.5f * AZONEPAD_TAB_PLUSW;
+ az->y2 = ar->winrct.ymax - (edge_offset * tab_size_x);
break;
case AE_RIGHT_TO_TOPLEFT:
az->x1 = ar->winrct.xmax - 1;
- az->y1 = ar->winrct.ymax - 2.5f * AZONEPAD_TAB_PLUSW;
- az->x2 = ar->winrct.xmax - 1 + AZONEPAD_TAB_PLUSH;
- az->y2 = ar->winrct.ymax - 1.5f * AZONEPAD_TAB_PLUSW;
+ az->y1 = ar->winrct.ymax - ((edge_offset + 1.0f) * tab_size_x);
+ az->x2 = ar->winrct.xmax - 1 + tab_size_y;
+ az->y2 = ar->winrct.ymax - (edge_offset * tab_size_x);
break;
}
/* rect needed for mouse pointer test */