mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
use Gray
This commit is contained in:
@@ -27,7 +27,6 @@ import com.intellij.ui.tabs.TabsUtil;
|
||||
import com.intellij.ui.tabs.UiDecorator;
|
||||
import com.intellij.ui.tabs.impl.JBTabsImpl;
|
||||
import com.intellij.ui.tabs.impl.TabLabel;
|
||||
import com.intellij.util.ui.SameColor;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -134,11 +133,11 @@ public class
|
||||
int _height = r.height;
|
||||
|
||||
if (!isHideTabs()) {
|
||||
g2d.setPaint(new GradientPaint(_x, _y, new SameColor(255), _x, _y + _height - 3, UIUtil.getPanelBackground()));
|
||||
g2d.setPaint(new GradientPaint(_x, _y, Gray._255, _x, _y + _height - 3, UIUtil.getPanelBackground()));
|
||||
|
||||
g2d.fill(selectedShape.fillPath.getShape());
|
||||
|
||||
g2d.setColor(new Color(255, 255, 255, 180));
|
||||
g2d.setColor(Gray._255.withAlpha(180));
|
||||
g2d.draw(selectedShape.fillPath.getShape());
|
||||
|
||||
// fix right side due to swing stupidity (fill & draw will occupy different shapes)
|
||||
@@ -155,7 +154,7 @@ public class
|
||||
selectedShape.path.getMaxX() - 1, getHeight() - 1);
|
||||
|
||||
if (isHideTabs()) return;
|
||||
g2d.setColor(new Color(0, 0, 0, 50));
|
||||
g2d.setColor(Gray._0.withAlpha(50));
|
||||
g2d.drawLine(1, selectedShape.labelPath.getMaxY(), 1, getHeight() - 1);
|
||||
g2d.drawLine(selectedShape.path.getMaxX() - 1, selectedShape.labelPath.getMaxY() - 4,
|
||||
selectedShape.path.getMaxX() - 1, getHeight() - 1);
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
package com.intellij.ide.navigationToolbar.ui;
|
||||
|
||||
import com.intellij.ide.navigationToolbar.NavBarItem;
|
||||
import com.intellij.util.ui.SameColor;
|
||||
import com.intellij.ui.Gray;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
|
||||
import java.awt.*;
|
||||
@@ -42,6 +42,6 @@ public class AquaNavBarUI extends AbstractNavBarUI {
|
||||
|
||||
@Override
|
||||
protected Color getBackgroundColor() {
|
||||
return UIUtil.getSlightlyDarkerColor(new SameColor(200));
|
||||
return UIUtil.getSlightlyDarkerColor(Gray._200);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -22,13 +22,13 @@ import com.intellij.openapi.project.Project;
|
||||
import com.intellij.openapi.util.registry.Registry;
|
||||
import com.intellij.openapi.wm.IdeFocusManager;
|
||||
import com.intellij.ui.ColorUtil;
|
||||
import com.intellij.ui.Gray;
|
||||
import com.intellij.ui.tabs.JBTabsPosition;
|
||||
import com.intellij.ui.tabs.TabInfo;
|
||||
import com.intellij.ui.tabs.TabsUtil;
|
||||
import com.intellij.ui.tabs.impl.singleRow.ScrollableSingleRowLayout;
|
||||
import com.intellij.ui.tabs.impl.singleRow.SingleRowLayout;
|
||||
import com.intellij.ui.tabs.impl.table.TableLayout;
|
||||
import com.intellij.util.ui.SameColor;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.NotNull;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
@@ -102,17 +102,17 @@ public class JBEditorTabs extends JBTabsImpl {
|
||||
Color tabColor = label.getInfo().getTabColor();
|
||||
if (tabColor != null) {
|
||||
//g2d.setPaint(new LinearGradientPaint(_x, _y, _x, _y + effectiveBounds.height, new float[] {.3f, .6f, 1f}, new Color[] {new SameColor(170), new SameColor(150), new SameColor(90)}));
|
||||
g2d.setPaint(new GradientPaint(_x, _y, new SameColor(200), _x, _y + effectiveBounds.height, new SameColor(130)));
|
||||
g2d.setPaint(new GradientPaint(_x, _y, Gray._200, _x, _y + effectiveBounds.height, Gray._130));
|
||||
g2d.fillRect(_x, _y, _width, _height);
|
||||
|
||||
g2d.setColor(ColorUtil.toAlpha(tabColor, 150));
|
||||
g2d.fillRect(_x, _y, _width, _height);
|
||||
} else {
|
||||
g2d.setPaint(new GradientPaint(_x, _y, new Color(255, 255, 255, 180), _x, _y + effectiveBounds.height, new Color(255, 255, 255, 100)));
|
||||
g2d.setPaint(new GradientPaint(_x, _y, Gray._255.withAlpha(180), _x, _y + effectiveBounds.height, Gray._255.withAlpha(100)));
|
||||
g2d.fillRect(_x, _y, _width, _height);
|
||||
}
|
||||
|
||||
g2d.setColor(new Color(255, 255, 255, 100));
|
||||
g2d.setColor(Gray._255.withAlpha(100));
|
||||
g2d.drawRect(_x, _y, _width - 1, _height - 1);
|
||||
}
|
||||
|
||||
@@ -180,7 +180,7 @@ public class JBEditorTabs extends JBTabsImpl {
|
||||
g2d.fillRect(rectangle.x, rectangle.y, rectangle.width, rectangle.height + (vertical ? 1 : 0));
|
||||
|
||||
if (!vertical) {
|
||||
g2d.setColor(new SameColor(210));
|
||||
g2d.setColor(Gray._210);
|
||||
g2d.drawLine(rectangle.x, rectangle.y, rectangle.x + rectangle.width, rectangle.y);
|
||||
}
|
||||
}
|
||||
@@ -219,14 +219,14 @@ public class JBEditorTabs extends JBTabsImpl {
|
||||
g2d.setColor(multiplyColor(tabColor));
|
||||
g2d.fill(selectedShape.fillPath.getShape());
|
||||
|
||||
g2d.setPaint(new GradientPaint(_x, _y, new Color(255, 255, 255, 150), _x, _y + _height, new Color(255, 255, 255, 0)));
|
||||
g2d.setPaint(new GradientPaint(_x, _y, Gray._255.withAlpha(150), _x, _y + _height, Gray._255.withAlpha(0)));
|
||||
} else {
|
||||
g2d.setPaint(new GradientPaint(_x, _y, new SameColor(255), _x, _y + _height, new SameColor(230)));
|
||||
g2d.setPaint(new GradientPaint(_x, _y, Gray._255, _x, _y + _height, Gray._230));
|
||||
}
|
||||
|
||||
g2d.fill(selectedShape.fillPath.getShape());
|
||||
|
||||
g2d.setColor(new Color(255, 255, 255, 180));
|
||||
g2d.setColor(Gray._255.withAlpha(180));
|
||||
g2d.draw(selectedShape.fillPath.getShape());
|
||||
|
||||
// fix right side due to swing stupidity (fill & draw will occupy different shapes)
|
||||
@@ -238,7 +238,7 @@ public class JBEditorTabs extends JBTabsImpl {
|
||||
|
||||
if (!isHorizontalTabs()) {
|
||||
// side shadow
|
||||
g2d.setColor(new Color(0, 0, 0, 30));
|
||||
g2d.setColor(Gray._0.withAlpha(30));
|
||||
g2d.draw(selectedShape.labelPath
|
||||
.transformLine(selectedShape.labelPath.getMaxX() + selectedShape.labelPath.deltaX(1), selectedShape.labelPath.getY() +
|
||||
selectedShape.labelPath.deltaY(1),
|
||||
@@ -264,7 +264,7 @@ public class JBEditorTabs extends JBTabsImpl {
|
||||
|
||||
@Override
|
||||
public Color getBackground() {
|
||||
return new SameColor(142);
|
||||
return Gray._142;
|
||||
}
|
||||
|
||||
protected ShapeInfo _computeSelectedLabelShape() {
|
||||
|
||||
@@ -34,6 +34,7 @@ import com.intellij.ui.tabs.UiDecorator;
|
||||
import com.intellij.ui.tabs.impl.table.TableLayout;
|
||||
import com.intellij.util.PairConsumer;
|
||||
import com.intellij.util.ui.Centerizer;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import org.jetbrains.annotations.Nullable;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -47,7 +48,7 @@ public class TabLabel extends JPanel {
|
||||
protected final SimpleColoredComponent myLabel = new SimpleColoredComponent() {
|
||||
@Override
|
||||
protected boolean shouldDrawMacShadow() {
|
||||
return SystemInfo.isMac;
|
||||
return SystemInfo.isMac && !UIUtil.isUnderDarcula();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
+5
-4
@@ -63,13 +63,14 @@ import com.intellij.openapi.wm.WindowManager;
|
||||
import com.intellij.openapi.wm.ex.StatusBarEx;
|
||||
import com.intellij.openapi.wm.impl.IdeFrameImpl;
|
||||
import com.intellij.ui.FocusTrackback;
|
||||
import com.intellij.ui.Gray;
|
||||
import com.intellij.ui.docking.DockContainer;
|
||||
import com.intellij.ui.docking.DockManager;
|
||||
import com.intellij.ui.tabs.impl.JBTabsImpl;
|
||||
import com.intellij.util.containers.ContainerUtil;
|
||||
import com.intellij.util.messages.MessageBusConnection;
|
||||
import com.intellij.util.messages.impl.MessageListenerList;
|
||||
import com.intellij.util.ui.SameColor;
|
||||
import com.intellij.util.ui.JBInsets;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.util.ui.update.MergingUpdateQueue;
|
||||
import com.intellij.util.ui.update.Update;
|
||||
@@ -234,9 +235,9 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Projec
|
||||
public Color getBackground() {
|
||||
boolean navBar = UISettings.getInstance().SHOW_NAVIGATION_BAR;
|
||||
if (navBar) {
|
||||
return UIUtil.getSlightlyDarkerColor(UIUtil.isUnderAquaLookAndFeel() ? new SameColor(200) : UIUtil.getPanelBackground());
|
||||
return UIUtil.getSlightlyDarkerColor(UIUtil.isUnderAquaLookAndFeel() ? Gray._200 : UIUtil.getPanelBackground());
|
||||
} else {
|
||||
return UIUtil.isUnderAquaLookAndFeel() ? new SameColor(189) : UIUtil.getPanelBackground();
|
||||
return UIUtil.isUnderAquaLookAndFeel() ? Gray._189 : UIUtil.getPanelBackground();
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -262,7 +263,7 @@ public class FileEditorManagerImpl extends FileEditorManagerEx implements Projec
|
||||
|
||||
@Override
|
||||
public Insets getBorderInsets(Component c) {
|
||||
return new Insets(0, 0, 0, 0);
|
||||
return JBInsets.NONE;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -17,8 +17,8 @@ package com.intellij.openapi.wm.impl.content;
|
||||
|
||||
import com.intellij.openapi.wm.ToolWindow;
|
||||
import com.intellij.ui.EngravedTextGraphics;
|
||||
import com.intellij.ui.Gray;
|
||||
import com.intellij.ui.content.Content;
|
||||
import com.intellij.util.ui.SameColor;
|
||||
import com.intellij.util.ui.UIUtil;
|
||||
import com.intellij.util.ui.WatermarkIcon;
|
||||
|
||||
@@ -29,7 +29,7 @@ public class BaseLabel extends JLabel {
|
||||
|
||||
protected static final int TAB_SHIFT = 1;
|
||||
private static final Color DEFAULT_ACTIVE_FORE = Color.black;
|
||||
private static final Color DEFAULT_PASSIVE_FORE = new SameColor(75);
|
||||
private static final Color DEFAULT_PASSIVE_FORE = Gray._75;
|
||||
|
||||
protected ToolWindowContentUi myUi;
|
||||
|
||||
|
||||
+2
-2
@@ -16,10 +16,10 @@
|
||||
package com.intellij.openapi.wm.impl.content;
|
||||
|
||||
import com.intellij.ui.EngravedTextGraphics;
|
||||
import com.intellij.ui.Gray;
|
||||
import com.intellij.ui.content.Content;
|
||||
import com.intellij.ui.content.ContentManager;
|
||||
import com.intellij.util.ui.BaseButtonBehavior;
|
||||
import com.intellij.util.ui.SameColor;
|
||||
import com.intellij.util.ui.TimedDeadzone;
|
||||
|
||||
import javax.swing.*;
|
||||
@@ -79,7 +79,7 @@ class ContentTabLabel extends BaseLabel {
|
||||
@Override
|
||||
protected Color getPassiveFg(boolean selected) {
|
||||
if (contentManager().getContentCount() > 1) {
|
||||
return selected ? new SameColor(255) : super.getPassiveFg(selected);
|
||||
return selected ? Gray._255 : super.getPassiveFg(selected);
|
||||
}
|
||||
return super.getPassiveFg(selected);
|
||||
}
|
||||
|
||||
@@ -19,6 +19,7 @@ import java.awt.*;
|
||||
|
||||
/**
|
||||
* @author Eugene Belyaev
|
||||
* @deprecated use com.intellij.ui.Gray
|
||||
*/
|
||||
public class SameColor extends Color {
|
||||
public SameColor(int i) {
|
||||
|
||||
Reference in New Issue
Block a user