mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 16:10:48 +00:00
NSScroller: define scroller styles
As of macOS 10.7, scrollers gained two types: Legacy and Overlay. Here, we define these styles as well as a method to determine which is the "default" style to be used.
This commit is contained in:
parent
e85a1a0664
commit
fcb11edca8
2 changed files with 30 additions and 0 deletions
|
@ -37,6 +37,21 @@
|
|||
|
||||
@class NSEvent;
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST)
|
||||
enum {
|
||||
NSScrollerStyleLegacy = 0,
|
||||
NSScrollerStyleOverlay = 1
|
||||
};
|
||||
typedef NSInteger NSScrollerStyle;
|
||||
|
||||
enum {
|
||||
NSScrollerKnobStyleDefault = 0,
|
||||
NSScrollerKnobStyleDark = 1,
|
||||
NSScrollerKnobStyleLight = 2
|
||||
};
|
||||
typedef NSInteger NSScrollerKnobStyle;
|
||||
#endif
|
||||
|
||||
enum _NSScrollArrowPosition {
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_1, GS_API_LATEST)
|
||||
NSScrollerArrowsDefaultSetting = 0,
|
||||
|
@ -90,6 +105,10 @@ typedef NSUInteger NSScrollerArrow;
|
|||
} _scFlags;
|
||||
}
|
||||
|
||||
#if OS_API_VERSION(MAC_OS_X_VERSION_10_7, GS_API_LATEST)
|
||||
+ (NSScrollerStyle)preferredScrollerStyle;
|
||||
#endif
|
||||
|
||||
//
|
||||
// Laying out the NSScroller
|
||||
//
|
||||
|
@ -144,4 +163,6 @@ typedef NSUInteger NSScrollerArrow;
|
|||
|
||||
@end
|
||||
|
||||
APPKIT_EXPORT NSString *NSPreferredScrollerStyleDidChangeNotification;
|
||||
|
||||
#endif // _GNUstep_H_NSScroller
|
||||
|
|
|
@ -49,6 +49,9 @@
|
|||
|
||||
#import "GNUstepGUI/GSTheme.h"
|
||||
|
||||
NSString *NSPreferredScrollerStyleDidChangeNotification =
|
||||
@"NSPreferredScrollerStyleDidChangeNotification";
|
||||
|
||||
/**<p>TODO Description</p>
|
||||
*/
|
||||
@implementation NSScroller
|
||||
|
@ -130,6 +133,12 @@ static float buttonsOffset = 1.0; // buttonsWidth = sw - 2*buttonsOffset
|
|||
return scrollerWidth;
|
||||
}
|
||||
|
||||
+ (NSScrollerStyle)preferredScrollerStyle
|
||||
{
|
||||
// FIXME: a theme should define this?
|
||||
return NSScrollerStyleLegacy;
|
||||
}
|
||||
|
||||
- (BOOL) isFlipped
|
||||
{
|
||||
return YES;
|
||||
|
|
Loading…
Reference in a new issue