Browse Source

SliderUI: add focus insets and move all colors to darcula.properties

master
Konstantin Bulenkov 8 years ago
parent
commit
69ef79f78b
  1. 6
      src/com/bulenkov/darcula/darcula.properties
  2. 15
      src/com/bulenkov/darcula/ui/DarculaSliderUI.java

6
src/com/bulenkov/darcula/darcula.properties

@ -148,6 +148,12 @@ Button.darcula.disabledText.shadow=00000000
SliderUI=com.bulenkov.darcula.ui.DarculaSliderUI
Slider.tickColor=888888
Slider.focus=888888
Slider.disabledTickColor=555555
Slider.selectedTrackColor=888888
Slider.trackBackground=2b2b2b
Slider.thumbBorderColor=707070
Slider.thumbBorderColorDisabled=444444
Slider.focusInsets=2,2,2,2
ToggleButtonUI=com.bulenkov.darcula.ui.DarculaToggleButtonUI

15
src/com/bulenkov/darcula/ui/DarculaSliderUI.java

@ -16,7 +16,6 @@
package com.bulenkov.darcula.ui;
import com.bulenkov.iconloader.util.ColorUtil;
import com.bulenkov.iconloader.util.GraphicsConfig;
import com.bulenkov.iconloader.util.GraphicsUtil;
import com.intellij.util.ui.JBDimension;
@ -98,22 +97,17 @@ public class DarculaSliderUI extends BasicSliderUI {
@NotNull
protected Color getTrackBackground() {
return ColorUtil.fromHex("2b2b2b");
return UIManager.getColor("Slider.trackBackground");
}
@NotNull
protected Color getSelectedTrackColor() {
return ColorUtil.fromHex("888888");
return UIManager.getColor("Slider.selectedTrackColor");
}
@NotNull
protected Color getDisabledTickColor() {
return ColorUtil.fromHex("555555");
}
@Override
public void paintTicks(Graphics g) {
super.paintTicks(g);
return UIManager.getColor("Slider.disabledTickColor");
}
@Override
@ -179,7 +173,6 @@ public class DarculaSliderUI extends BasicSliderUI {
g.setColor(slider.getBackground().darker());
}
if (isPlainThumb()) {
double r = slider.getOrientation() == JSlider.HORIZONTAL ? h : w;
final Ellipse2D.Double thumb = new Ellipse2D.Double(0, 0, r, r);
@ -259,7 +252,7 @@ public class DarculaSliderUI extends BasicSliderUI {
@NotNull
protected Color getThumbBorderColor() {
return slider.isEnabled() ? ColorUtil.fromHex("707070") : ColorUtil.fromHex("444444");
return slider.isEnabled() ? UIManager.getColor("Slider.thumbBorderColor") : UIManager.getColor("Slider.thumbBorderColorDisabled");
}
protected boolean isPlainThumb() {

Loading…
Cancel
Save