Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upAdd basic overlay scrollbar support. #397
Merged
Conversation
|
r? @pcwalton |
webrender/src/frame.rs
Outdated
| context.builder.add_solid_rectangle(&scrollbar_rect, | ||
| &scrollbar_rect, | ||
| None, | ||
| &ColorF::new(0.3, 0.3, 0.3, 0.6), |
This comment has been minimized.
This comment has been minimized.
| let scrollable_distance = scroll_layer.content_size.height - scroll_layer.local_viewport_rect.size.height; | ||
|
|
||
| if scrollable_distance <= 0.0 { | ||
| prim.local_clip_rect.size = Size2D::zero(); |
This comment has been minimized.
This comment has been minimized.
webrender/src/tiling.rs
Outdated
| prim.rect.size.width - | ||
| distance_from_edge; | ||
|
|
||
| prim.rect.origin.y = min_y + f * (max_y - min_y); |
This comment has been minimized.
This comment has been minimized.
webrender/src/tiling.rs
Outdated
|
|
||
| prim.rect.origin.y = min_y + f * (max_y - min_y); | ||
| prim.local_clip_rect.origin = prim.rect.origin; | ||
| prim.local_clip_rect.size = prim.rect.size; |
This comment has been minimized.
This comment has been minimized.
|
@bors-servo r=pcwalton |
|
|
|
|
|
|
This adds the infrastructure for adding scrollbars to any scroll root, however for now it only draws a scrollbar for the root frame. Once we are happy with the implementation and design, we can easily enable it for iframes and other scroll roots. The idea is to insert a primitive of any kind into the primitive tree and tag it as being a scroll bar primitive for a given layer. This means we can allow styling of the scrollbar in the future, making use of any of the display item features that are supported (e.g. border corners, gradients, images, anti-aliasing).
|
@bors-servo r=pcwalton |
|
|
bors-servo
added a commit
that referenced
this pull request
Sep 15, 2016
Add basic overlay scrollbar support. This adds the infrastructure for adding scrollbars to any scroll root, however for now it only draws a scrollbar for the root frame. Once we are happy with the implementation and design, we can easily enable it for iframes and other scroll roots. The idea is to insert a primitive of any kind into the primitive tree and tag it as being a scroll bar primitive for a given layer. This means we can allow styling of the scrollbar in the future, making use of any of the display item features that are supported (e.g. border corners, gradients, images, anti-aliasing). <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/webrender/397) <!-- Reviewable:end -->
|
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.

glennw commentedSep 8, 2016
•
edited by larsbergstrom
This adds the infrastructure for adding scrollbars to any scroll root,
however for now it only draws a scrollbar for the root frame. Once we
are happy with the implementation and design, we can easily enable it
for iframes and other scroll roots.
The idea is to insert a primitive of any kind into the primitive tree
and tag it as being a scroll bar primitive for a given layer. This
means we can allow styling of the scrollbar in the future, making use
of any of the display item features that are supported (e.g. border
corners, gradients, images, anti-aliasing).
This change is