mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
Merge remote-tracking branch 'origin/master'
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() {
|
||||
|
||||
+7
-3
@@ -32,7 +32,7 @@ import java.awt.*;
|
||||
public class DarculaEditorTextFieldBorder implements Border {
|
||||
@Override
|
||||
public void paintBorder(Component c, Graphics g, int x, int y, int width, int height) {
|
||||
if (isComboBoxEditor(c)) {
|
||||
if (isComboBoxEditor(c) || isCellEditor(c)) {
|
||||
return;
|
||||
}
|
||||
final EditorTextField textField = UIUtil.getParentOfType(EditorTextField.class, c);
|
||||
@@ -65,8 +65,8 @@ public class DarculaEditorTextFieldBorder implements Border {
|
||||
|
||||
@Override
|
||||
public Insets getBorderInsets(Component c) {
|
||||
if (isComboBoxEditor(c)) {
|
||||
return new InsetsUIResource(1,1,1,1);
|
||||
if (isComboBoxEditor(c) || isCellEditor(c)) {
|
||||
return new InsetsUIResource(0,0,0,0);
|
||||
}
|
||||
return new InsetsUIResource(6, 7, 6, 7);
|
||||
}
|
||||
@@ -79,4 +79,8 @@ public class DarculaEditorTextFieldBorder implements Border {
|
||||
public static boolean isComboBoxEditor(Component c) {
|
||||
return UIUtil.getParentOfType(JComboBox.class, c) != null;
|
||||
}
|
||||
|
||||
public static boolean isCellEditor(Component c) {
|
||||
return UIUtil.getParentOfType(JTable.class, c) != null;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -205,13 +205,6 @@ public class EditorTextField extends NonOpaquePanel implements DocumentListener,
|
||||
|
||||
public void setDocument(Document document) {
|
||||
if (myDocument != null) {
|
||||
/*
|
||||
final UndoManager undoManager = myProject != null
|
||||
? UndoManager.getInstance(myProject)
|
||||
: UndoManager.getGlobalInstance();
|
||||
undoManager.clearUndoRedoQueue(myDocument);
|
||||
*/
|
||||
|
||||
uninstallDocumentListener(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -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