-
Notifications
You must be signed in to change notification settings - Fork 165
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add scrollbar space allocation control
This change is motivated by a desire to be able to control how scroll bars are rendered adjacent to viewport contents. It isn't always desirable to render them right up against the contents; sometimes, spacing would be nice between the bar and contents, for example. In general, we want users to be able to control more aspects of how scroll bars are drawn. This change is a step in that direction. This change won't affect any users who are using the default scroll bar renderers. This change: * Adds a new field to ScrollbarRenderer, scrollbarAllocation :: Int, which specifies the height (for horizontal scroll bars) or width (for vertical ones) of the region in which the bar is rendered. This allows scroll bar element widgets to take up more than one row in height (for horizontal scroll bars) or more than one column in width (for vertical ones). * Updates the scroll bar rendering logic to clamp scroll bar handles to one row in height (for vertical scroll bars) or one column in width (for horizontal ones) since we need to be able to assume the size of the handles when computing the size of the scroll bar and trough regions. * Updates programs/ViewportScrollbarsDemo.hs to demonstrate the use of the new allocation feature to draw a vertical scroll bar that takes up more than one column in various ways.
- Loading branch information
1 parent
2776b3c
commit 324b5ad
Showing
3 changed files
with
97 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters