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:
authorHarley Acheson <harley.acheson@gmail.com>2022-06-27 16:45:49 +0300
committerHarley Acheson <harley.acheson@gmail.com>2022-06-27 16:46:29 +0300
commit6243972319289d86c70ce9946d10909e7eddfdaf (patch)
treeeb97c7a34dc100b515ab6be74c71c4b85d9494a4 /source/blender/editors/screen/screen_ops.c
parent279e7dac7dcfc0a7d4126c55a23a745362c293dc (diff)
UI: Scrollbar Behavior Changes
Changes to scrollbars so that they are always visible, but thin and dim, and widen and become more visible as your mouse approaches. See D6505 for details and examples. Differential Revision: https://developer.blender.org/D6505 Reviewed by Campbell Barton
Diffstat (limited to 'source/blender/editors/screen/screen_ops.c')
-rw-r--r--source/blender/editors/screen/screen_ops.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source/blender/editors/screen/screen_ops.c b/source/blender/editors/screen/screen_ops.c
index 212fb846b43..d35bd5ab2fe 100644
--- a/source/blender/editors/screen/screen_ops.c
+++ b/source/blender/editors/screen/screen_ops.c
@@ -887,14 +887,16 @@ static AZone *area_actionzone_refresh_xy(ScrArea *area, const int xy[2], const b
float dist_fac = 0.0f, alpha = 0.0f;
if (az->direction == AZ_SCROLL_HOR) {
- dist_fac = BLI_rcti_length_y(&v2d->hor, local_xy[1]) / AZONEFADEIN;
+ float hide_width = (az->y2 - az->y1) / 2.0f;
+ dist_fac = BLI_rcti_length_y(&v2d->hor, local_xy[1]) / hide_width;
CLAMP(dist_fac, 0.0f, 1.0f);
alpha = 1.0f - dist_fac;
v2d->alpha_hor = alpha * 255;
}
else if (az->direction == AZ_SCROLL_VERT) {
- dist_fac = BLI_rcti_length_x(&v2d->vert, local_xy[0]) / AZONEFADEIN;
+ float hide_width = (az->x2 - az->x1) / 2.0f;
+ dist_fac = BLI_rcti_length_x(&v2d->vert, local_xy[0]) / hide_width;
CLAMP(dist_fac, 0.0f, 1.0f);
alpha = 1.0f - dist_fac;