From 9c655343bb91e2c7e117e2f99c2053d55f30e842 Mon Sep 17 00:00:00 2001 From: Juuxel Date: Sat, 31 Aug 2019 23:56:17 +0300 Subject: Some slider updates - WIP dark mode textures for simple sliders - Vertical/rotated labeled sliders - Text alignment for slider labels - Add missing getters for nicer Kotlin usage --- .../assets/libgui/textures/widget/slider_dark.png | Bin 0 -> 2723 bytes 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 src/main/resources/assets/libgui/textures/widget/slider_dark.png (limited to 'src/main/resources/assets') diff --git a/src/main/resources/assets/libgui/textures/widget/slider_dark.png b/src/main/resources/assets/libgui/textures/widget/slider_dark.png new file mode 100644 index 0000000..fd7e8af Binary files /dev/null and b/src/main/resources/assets/libgui/textures/widget/slider_dark.png differ -- cgit From 4587fc8700462a939ae5ee5cd81a2ff176880001 Mon Sep 17 00:00:00 2001 From: Juuxel Date: Sun, 1 Sep 2019 10:50:05 +0300 Subject: Improve dark slider textures --- .../cottonmc/cotton/gui/widget/WAbstractSlider.java | 4 ++-- .../io/github/cottonmc/cotton/gui/widget/WSlider.java | 2 +- .../assets/libgui/textures/widget/slider.png | Bin 2978 -> 0 bytes .../assets/libgui/textures/widget/slider_dark.png | Bin 2723 -> 2871 bytes .../assets/libgui/textures/widget/slider_light.png | Bin 0 -> 2978 bytes 5 files changed, 3 insertions(+), 3 deletions(-) delete mode 100644 src/main/resources/assets/libgui/textures/widget/slider.png create mode 100644 src/main/resources/assets/libgui/textures/widget/slider_light.png (limited to 'src/main/resources/assets') diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java index 677686d..e07be56 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WAbstractSlider.java @@ -28,7 +28,7 @@ public abstract class WAbstractSlider extends WWidget { /** * The minimum time between two draggingFinished events caused by scrolling ({@link #onMouseScroll}). */ - private static final int SCROLLING_DRAGGING_FINISHED_RATE_LIMIT = 10; + private static final int DRAGGING_FINISHED_RATE_LIMIT_FOR_SCROLLING = 10; protected final int min, max; protected final Axis axis; @@ -161,7 +161,7 @@ public abstract class WAbstractSlider extends WWidget { if (pendingDraggingFinishedFromScrolling && draggingFinishedFromScrollingTimer <= 0) { if (draggingFinishedListener != null) draggingFinishedListener.accept(value); pendingDraggingFinishedFromScrolling = false; - draggingFinishedFromScrollingTimer = SCROLLING_DRAGGING_FINISHED_RATE_LIMIT; + draggingFinishedFromScrollingTimer = DRAGGING_FINISHED_RATE_LIMIT_FOR_SCROLLING; } } diff --git a/src/main/java/io/github/cottonmc/cotton/gui/widget/WSlider.java b/src/main/java/io/github/cottonmc/cotton/gui/widget/WSlider.java index b921945..2dd3a8e 100644 --- a/src/main/java/io/github/cottonmc/cotton/gui/widget/WSlider.java +++ b/src/main/java/io/github/cottonmc/cotton/gui/widget/WSlider.java @@ -18,7 +18,7 @@ import javax.annotation.Nullable; public class WSlider extends WAbstractSlider { public static final int TRACK_WIDTH = 6; public static final int THUMB_SIZE = 8; - public static final Identifier LIGHT_TEXTURE = new Identifier("libgui", "textures/widget/slider.png"); + public static final Identifier LIGHT_TEXTURE = new Identifier("libgui", "textures/widget/slider_light.png"); public static final Identifier DARK_TEXTURE = new Identifier("libgui", "textures/widget/slider_dark.png"); @Environment(EnvType.CLIENT) diff --git a/src/main/resources/assets/libgui/textures/widget/slider.png b/src/main/resources/assets/libgui/textures/widget/slider.png deleted file mode 100644 index e41250e..0000000 Binary files a/src/main/resources/assets/libgui/textures/widget/slider.png and /dev/null differ diff --git a/src/main/resources/assets/libgui/textures/widget/slider_dark.png b/src/main/resources/assets/libgui/textures/widget/slider_dark.png index fd7e8af..d558e11 100644 Binary files a/src/main/resources/assets/libgui/textures/widget/slider_dark.png and b/src/main/resources/assets/libgui/textures/widget/slider_dark.png differ diff --git a/src/main/resources/assets/libgui/textures/widget/slider_light.png b/src/main/resources/assets/libgui/textures/widget/slider_light.png new file mode 100644 index 0000000..e41250e Binary files /dev/null and b/src/main/resources/assets/libgui/textures/widget/slider_light.png differ -- cgit From 0254decd7173d1207333554ac3283c22c9b37fb6 Mon Sep 17 00:00:00 2001 From: Juuxel Date: Sun, 1 Sep 2019 11:49:22 +0300 Subject: Make the dark slider texture a bit nicer --- .../assets/libgui/textures/widget/slider_dark.png | Bin 2871 -> 2919 bytes 1 file changed, 0 insertions(+), 0 deletions(-) (limited to 'src/main/resources/assets') diff --git a/src/main/resources/assets/libgui/textures/widget/slider_dark.png b/src/main/resources/assets/libgui/textures/widget/slider_dark.png index d558e11..9e83925 100644 Binary files a/src/main/resources/assets/libgui/textures/widget/slider_dark.png and b/src/main/resources/assets/libgui/textures/widget/slider_dark.png differ -- cgit