mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
add ability to tune a track color on hover
This commit is contained in:
@@ -50,8 +50,8 @@ class ScrollPainter extends RegionPainter.Alpha {
|
||||
}
|
||||
|
||||
static final class Track {
|
||||
static final RegionPainter<Float> DARCULA = new ScrollPainter(0, .0f, .1f, Gray.x80, null);
|
||||
static final RegionPainter<Float> DEFAULT = DARCULA;
|
||||
static final RegionPainter<Float> DARCULA = new TrackPainter("ide.scroll.track.darcula.alpha", "ide.scroll.track.darcula.fill");
|
||||
static final RegionPainter<Float> DEFAULT = new TrackPainter("ide.scroll.track.default.alpha", "ide.scroll.track.default.fill");
|
||||
}
|
||||
|
||||
static final class Thumb {
|
||||
@@ -377,4 +377,18 @@ class ScrollPainter extends RegionPainter.Alpha {
|
||||
RectanglePainter.paint(g, x, y, width, height, SystemInfo.isMac ? Math.min(width, height) : 0, myFillColor, myDrawColor);
|
||||
}
|
||||
}
|
||||
|
||||
private static class TrackPainter extends ScrollPainter {
|
||||
private final IntSupplier supplier;
|
||||
|
||||
private TrackPainter(String alpha, String fill) {
|
||||
super(0, 0, 0, gray(fill, 0x80), null);
|
||||
supplier = value(alpha, 26);
|
||||
}
|
||||
|
||||
@Override
|
||||
protected float getAlpha(Float value) {
|
||||
return value == null ? 0 : value * supplier.getAsInt() / 255;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -149,6 +149,18 @@ ide.scroll.layout.header.over.corner.description=Expand a scroll pane header if
|
||||
ide.scroll.thumb.small.if.opaque=false
|
||||
ide.scroll.thumb.small.if.opaque.description=Allows to tune an opaque thumb thickness. Affects Windows and Linux only.
|
||||
|
||||
ide.scroll.track.darcula.alpha=26
|
||||
ide.scroll.track.darcula.alpha.description=Allows to tune a track color on hover.
|
||||
|
||||
ide.scroll.track.darcula.fill=128
|
||||
ide.scroll.track.darcula.fill.description=Allows to tune a track color on hover.
|
||||
|
||||
ide.scroll.track.default.alpha=26
|
||||
ide.scroll.track.default.alpha.description=Allows to tune a track color on hover.
|
||||
|
||||
ide.scroll.track.default.fill=128
|
||||
ide.scroll.track.default.fill.description=Allows to tune a track color on hover.
|
||||
|
||||
ide.editor.thumb.experimental=true
|
||||
ide.editor.thumb.experimental.description=Another approach to paint editor's scroll thumb.
|
||||
|
||||
|
||||
Reference in New Issue
Block a user