diff --git a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java index 39fc577..010fe3c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java +++ b/bundles/org.eclipse.swt/Eclipse SWT PI/cocoa/org/eclipse/swt/internal/cocoa/OS.java @@ -148,7 +148,9 @@ public static final int /*long*/ sel_isCompatibleWithOverlayScrollers = sel_registerName("isCompatibleWithOverlayScrollers"); public static final int /*long*/ sel_flashScrollers = sel_registerName("flashScrollers"); public static final int /*long*/ sel_frameSizeForContentSize_horizontalScrollerClass_verticalScrollerClass_borderType_controlSize_scrollerStyle_ = sel_registerName("frameSizeForContentSize:horizontalScrollerClass:verticalScrollerClass:borderType:controlSize:scrollerStyle:"); + public static final int /*long*/ sel_scrollerStyle = sel_registerName("scrollerStyle"); public static final int NSScrollerStyleLegacy = 0; + public static final int NSScrollerStyleOverlay = 1; /* AWT application delegate. Remove these when JavaRuntimeSupport.framework has bridgesupport generated for it. */ public static final int /*long*/ class_JRSAppKitAWT = objc_getClass("JRSAppKitAWT"); diff --git a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java index 770be6b..6ba6557 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/cocoa/org/eclipse/swt/widgets/Scrollable.java @@ -220,6 +220,38 @@ } /** + * Returns the mode of the receiver's scrollbars. This will be + * bitwise OR of one or more of the constants defined in class + * SWT.
+ *
  • SWT.SCROLLBAR_OVERLAY - if receiver + * uses overlay scrollbars
  • + *
  • SWT.NONE - otherwise
  • + * + * @return the mode of scrollbars + * + * @exception SWTException + * + * @see SWT#SCROLLBAR_OVERLAY + * + * @since 3.8 + */ +public int getScrollbarsMode () { + checkWidget(); + int style = SWT.NONE; + if (scrollView != null && OS.VERSION >= 0x1070) { + if (OS.objc_msgSend (scrollView.id, OS.sel_scrollerStyle) == OS.NSScrollerStyleOverlay) { + style = SWT.SCROLLBAR_OVERLAY; + } + } + return style; +} + +/** * Returns the receiver's vertical scroll bar if it has * one, and null if it does not. * diff --git a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java index 399bf07..4e2c93c 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/common/org/eclipse/swt/SWT.java @@ -4068,7 +4068,14 @@ * @since 3.6 */ public static final String SKIN_ID = "org.eclipse.swt.skin.id"; - + + /** + * The Scrollable constant to indicate that + * the receiver is using overlay scrollbars. (value is 1) + * + * @since 3.8 + */ + public static final int SCROLLBAR_OVERLAY = 1 << 1; /** * Answers a concise, human readable description of the error code. diff --git a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java index 8c94163..5eaf82f 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/gtk/org/eclipse/swt/widgets/Scrollable.java @@ -218,6 +218,31 @@ return horizontalBar; } /** + * Returns the mode of the receiver's scrollbars. This will be + * bitwise OR of one or more of the constants defined in class + * SWT.
    + *
  • SWT.SCROLLBAR_OVERLAY - if receiver + * uses overlay scrollbars
  • + *
  • SWT.NONE - otherwise
  • + * + * @return the mode of scrollbars + * + * @exception SWTException + * + * @see SWT#SCROLLBAR_OVERLAY + * + * @since 3.8 + */ +public int getScrollbarsMode () { + checkWidget(); + return SWT.NONE; +} +/** * Returns the receiver's vertical scroll bar if it has * one, and null if it does not. * diff --git a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java index 73bfc18..c473cca 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java +++ b/bundles/org.eclipse.swt/Eclipse SWT/win32/org/eclipse/swt/widgets/Scrollable.java @@ -11,6 +11,8 @@ package org.eclipse.swt.widgets; +import org.eclipse.swt.SWT; +import org.eclipse.swt.SWTException; import org.eclipse.swt.internal.win32.*; import org.eclipse.swt.*; import org.eclipse.swt.graphics.*; @@ -199,6 +201,32 @@ } /** + * Returns the mode of the receiver's scrollbars. This will be + * bitwise OR of one or more of the constants defined in class + * SWT.
    + *
  • SWT.SCROLLBAR_OVERLAY - if receiver + * uses overlay scrollbars
  • + *
  • SWT.NONE - otherwise
  • + * + * @return the mode of scrollbars + * + * @exception SWTException + * + * @see SWT#SCROLLBAR_OVERLAY + * + * @since 3.8 + */ +public int getScrollbarsMode () { + checkWidget(); + return SWT.NONE; +} + +/** * Returns the receiver's vertical scroll bar if it has * one, and null if it does not. *