Comments (2)
It would really help, if somebody could detail the behaviour of these settings on macOS and more specifically on different versions of macOS. How do these two values (plus verticalScroller) relate to each other, when an NSScrollView gets resized?
With autohidesScrollers being NO, things should be easy the scrollers get controlled manually. But with that value being YES things might get complicated. Our expectation is that this not only hides scrollers but also displays them when needed.
If you read through the documentation by Apple you will see that they are rather unspecific on what happens.
from libs-gui.
The behavior of macOS is complex, and it depends on whether a magic mouse or a trackpad is available, or if only a traditional mouse is being used.
If only a traditional mouse is available, the scroll bars are displayed if they are configured and necessary:
In this example (ScrollBar-Mouse00), only the vertical bar is visible with this configuration:
hasVerticalScroller = YES;
hasHorizontalScroller = NO;
autohidesScrollers = YES;
In this example (ScrollBar-Mouse01), both are shown, with this configuration because the horizontal is necessary:
hasVerticalScroller = YES;
hasHorizontalScroller = YES;
autohidesScrollers = YES;
However, with the same configuration, when the horizontal is not necessary, it is not displayed (ScrollBar-Mouse02):
hasVerticalScroller = YES;
hasHorizontalScroller = YES;
autohidesScrollers = YES;
When the value of autohidesScrollers is changed to NO, the space for the bar is still drawn, but the scrollbar is only visible if necessary (ScrollBar-Mouse03):
self.hasVerticalScroller = YES;
self.hasHorizontalScroller = YES;
self.autohidesScrollers = NO;
However, the above configurations are not very common, as most users have a trackpad or a magic mouse. In that case, the scroll bars behave like this:
autohidesScrollers seems not to affect the behavior or the display, the bars always automatically hide and are shown when dragging the content or changing the size of the available space (usually when resizing the window)
even if the bars are configured with hasVerticalScroller/hasHorizontalScroller to NO, the scrolls are not drawn but the content can be moved with the trackpad as if they were active. (ScrollBar-Trackpad04):
self.hasVerticalScroller = NO;
self.hasHorizontalScroller = NO;
self.autohidesScrollers = NO;
ScrollBar-Trackpad04.mov
Leaving NO to the vertical scroll, or horizontal the behavior is the same as the previous one, but the scroll configured as visible is drawn, and also, you can interact with the mouse and the trackpad. (ScrollBar-Trackpad05):
self.hasVerticalScroller = YES;
self.hasHorizontalScroller = NO;
self.autohidesScrollers = NO;
ScrollBar-Trackpad05.mov
The next example shows the behavior when resizing the available space (ScrollBar-Trackpad06):
self.hasVerticalScroller = YES;
self.hasHorizontalScroller = YES;
self.autohidesScrollers = NO;
ScrollBar-Trackpad06.mov
It is important to note, that in the case of the trackpad/magic-mouse there are two visualizations, the one that shows only the scroll bar which is thinner and has a transparent background and the one that is shown while interacting which is thicker and shows the background bar as when only a traditional mouse is available (ScrollBar-Trackpad07)
ScrollBar-Trackpad07.mov
Finally, remember that all these configurations, it seems that they are only possible with the implementation of Layers and CoreAnimation.
Perhaps it would be fantastic to have a theme configuration, type:
NSScrollViewInterfaceStyle = NSWindows95InterfaceStyle;
NSScrollerInterfaceStyle = NSWindows95InterfaceStyle;
But adapted to the behaviors and captures described above, something like:
NSScrollViewInterfaceStyle = NSMacOSInterfaceStyle;
NSScrollerInterfaceStyle = NSMacOSInterfaceStyle;
from libs-gui.
Related Issues (20)
- theming does not allow to define the text color of the overed menu item HOT 2
- theming does not allow to define border radius of menu popover HOT 1
- NSCircularBezelStyle should cut text HOT 5
- Theming must allow define text color per each style HOT 3
- NSRoundedDisclosure ... not reporting an appropiate state HOT 1
- Theming should be able to define 'accept button' style HOT 4
- NSBezierPath does not clip gradients HOT 6
- Support NIBArchive format HOT 3
- CTButtonTypeSwitch does not show mixed state
- Segmentation Fault with autohidesScrollers = YES HOT 5
- Images disappear after Display Resolution Change HOT 2
- Allow multiple selection on NSSegmentedControl
- Wrong size for NSSegmentedControl sizeToFit
- Add setBezelColor for NSButton
- NSTextView can cause a crash if its delegate has been deallocated earlier HOT 4
- bitmap format big & little endian in image representations HOT 3
- NSToolbar is off by default in GNUstep and on by default on macOS
- Refactor NSStoryboard loading...
- Changes to NSMenuItem breaks nib loading... HOT 20
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from libs-gui.