mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Platform: OS X scrollbars can be disabled for diagnostic purpose
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user