Platform: OS X scrollbars can be disabled for diagnostic purpose

This commit is contained in:
Anton Makeev
2014-05-25 12:27:31 +04:00
parent d300533587
commit b3afb57c96
3 changed files with 16 additions and 3 deletions
@@ -122,6 +122,8 @@ public class JBScrollPane extends JScrollPane {
}
private void transferToLayeredPane(Component old, Component c, String key) {
if (!ButtonlessScrollBarUI.isMacOverlayScrollbarSupported()) return;
JLayeredPane pane = getLayoutPane();
LayoutManager layout = getLayout();
@@ -152,7 +154,9 @@ public class JBScrollPane extends JScrollPane {
}
private void init(boolean setupCorners) {
add(getLayoutPane());
if (ButtonlessScrollBarUI.isMacOverlayScrollbarSupported()) {
add(getLayoutPane());
}
setLayout(new ScrollPaneLayout());
if (setupCorners) {
@@ -201,7 +205,9 @@ public class JBScrollPane extends JScrollPane {
@Override
public void layout() {
super.layout();
if (!ButtonlessScrollBarUI.isMacOverlayScrollbarSupported()) return;
LayoutManager layout = getLayout();
if (layout instanceof ScrollPaneLayout && myLayeredPane != null) {
relayoutScrollbars(this, (ScrollPaneLayout)layout, myLayeredPane);
@@ -17,6 +17,7 @@ package com.intellij.util.ui;
import com.intellij.openapi.diagnostic.Logger;
import com.intellij.openapi.util.Disposer;
import com.intellij.openapi.util.SystemInfo;
import com.intellij.openapi.util.registry.Registry;
import com.intellij.ui.Gray;
import com.intellij.ui.JBColor;
@@ -174,7 +175,11 @@ public class ButtonlessScrollBarUI extends BasicScrollBarUI {
}
protected boolean isMacOverlayScrollbar() {
return myMacScrollerStyle == NSScrollerHelper.Style.Overlay;
return myMacScrollerStyle == NSScrollerHelper.Style.Overlay && isMacOverlayScrollbarSupported();
}
public static boolean isMacOverlayScrollbarSupported() {
return SystemInfo.isMac && !Registry.is("ide.mac.disableMacScrollbars");
}
private void updateMacScrollbarStyle() {
@@ -142,6 +142,8 @@ ide.mac.hide.cursor.when.typing=true
ide.mac.show.native.help=true
ide.mac.useNativeClipboard=false
ide.mac.boldEditorTabs=false
ide.mac.disableMacScrollbars=false
ide.mac.disableMacScrollbars.description=Disables OS X overlay scrollbars (effective on restart)
ide.perProjectModality=false
# suppress inspection "UnusedProperty"
ide.perProjectModality.description=New modality approach. All dialogs are DOCUMENT_MODAL expect ide-wide dialogs