From 3ddcde7f2fd21e0a418f756519e42ee190ede07e Mon Sep 17 00:00:00 2001
From: Sven Gothel
* GraphUI is intended to become an immediate- and retained-mode API.
*
+ * Default colors (toggle-off is full color):
+ * - non-toggle: 0.6 * color, static -> 0.6
+ * - pressed: 0.8 * color, static -> 0.5
+ * - toggle-off: 1.0 * color, static -> 0.6
+ * - toggle-on: 0.8 * color
+ *
@@ -441,7 +449,7 @@ public abstract class Shape {
rgba = toggleOffRGBAModulate;
}
} else {
- rgba = rgbaColor;
+ rgba = cWhite;
}
} else {
rgba = rgba_tmp;
@@ -1319,6 +1327,13 @@ public abstract class Shape {
protected abstract void validateImpl(final GLProfile glp, final GL2ES2 gl);
+ /**
+ * Actual draw implementation
+ * @param gl
+ * @param renderer
+ * @param sampleCount
+ * @param rgba if null, caller is {@link #drawToSelect(GL2ES2, RegionRenderer, int[])}, otherwise regular {@#link #draw(GL2ES2, RegionRenderer, int[])}
+ */
protected abstract void drawImpl0(final GL2ES2 gl, final RegionRenderer renderer, final int[] sampleCount, Vec4f rgba);
protected abstract void clearImpl0(final GL2ES2 gl, final RegionRenderer renderer);
diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/Button.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/Button.java
index 9a6ba7bc2..5fe99c5c9 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/shapes/Button.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/Button.java
@@ -76,11 +76,7 @@ public class Button extends BaseButton {
final float height) {
super(renderModes | Region.COLORCHANNEL_RENDERING_BIT, width, height);
this.labelZOffset = DEFAULT_LABEL_ZOFFSET;
- this.label = new Label0(labelFont, labelText, new Vec4f( 1.33f, 1.33f, 1.33f, 1.0f )); // 0.75 * 1.33 = 1.0
- setColor(0.75f, 0.75f, 0.75f, 1.0f);
- setPressedColorMod(0.9f, 0.9f, 0.9f, 0.7f);
- setToggleOffColorMod(0.65f, 0.65f, 0.65f, 1.0f);
- setToggleOnColorMod(0.85f, 0.85f, 0.85f, 1.0f);
+ this.label = new Label0(labelFont, labelText, new Vec4f( 1.66f, 1.66f, 1.66f, 1.0f )); // 0.60 * 1.66 ~= 1.0
}
public Font getFont() { return label.getFont(); }
diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/GLButton.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/GLButton.java
index f11475b84..57af3587c 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/shapes/GLButton.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/GLButton.java
@@ -54,6 +54,13 @@ import com.jogamp.opengl.util.texture.Texture;
* This button is rendered with a round oval shape.
* To render it rectangular, {@link #setCorner(float)} to zero.
*
+ * Default colors (toggle-on is full color):
+ * - non-toggle: 1 * color
+ * - pressed: 0.9 * color
+ * - toggle-off: 0.8 * color
+ * - toggle-on: 1.0 * color
+ *
+ * Default colors (toggle-off is full color): + * - non-toggle: 1 * color + * - pressed: 0.9 * color + * - toggle-off: 1.0 * color + * - toggle-on: 0.8 * color + *
*/ public class ImageButton extends TexSeqButton { public ImageButton(final int renderModes, final float width, final float height, final ImageSequence texSeq) { super(renderModes, width, height, texSeq); - setColor(0.95f, 0.95f, 0.95f, 1.0f); - setPressedColorMod(1f, 1f, 1f, 0.9f); - setToggleOffColorMod(0.8f, 0.8f, 0.8f, 1.0f); - setToggleOnColorMod(1.0f, 1.0f, 1.0f, 1.0f); + + setColor(1f, 1f, 1f, 1.0f); + setPressedColorMod(0.9f, 0.9f, 0.9f, 0.9f); + setToggleOffColorMod(1f, 1f, 1f, 1f); + setToggleOnColorMod(0.8f, 0.8f, 0.8f, 1f); } public final void setCurrentIdx(final int idx) { diff --git a/src/graphui/classes/com/jogamp/graph/ui/shapes/MediaButton.java b/src/graphui/classes/com/jogamp/graph/ui/shapes/MediaButton.java index 55a00aae4..c6a0bf99c 100644 --- a/src/graphui/classes/com/jogamp/graph/ui/shapes/MediaButton.java +++ b/src/graphui/classes/com/jogamp/graph/ui/shapes/MediaButton.java @@ -45,6 +45,13 @@ import com.jogamp.opengl.util.texture.TextureSequence.TextureFrame; * This button is rendered with a round oval shape. * To render it rectangular, {@link #setCorner(float)} to zero. * + *+ * Default colors (toggle-on is full color): + * - non-toggle: 1 * color + * - pressed: 0.9 * color + * - toggle-off: 0.8 * color + * - toggle-on: 1.0 * color + *
*/ public class MediaButton extends TexSeqButton { private boolean verbose = false; @@ -59,8 +66,9 @@ public class MediaButton extends TexSeqButton { public MediaButton(final int renderModes, final float width, final float height, final GLMediaPlayer mPlayer) { super(renderModes, width, height, mPlayer); - setColor(0.8f, 0.8f, 0.8f, 1.0f); - setPressedColorMod(1.1f, 1.1f, 1.1f, 0.7f); + + setColor(1.0f, 1.0f, 1.0f, 1.0f); + setPressedColorMod(0.9f, 0.9f, 0.9f, 0.7f); setToggleOffColorMod(0.8f, 0.8f, 0.8f, 1.0f); setToggleOnColorMod(1.0f, 1.0f, 1.0f, 1.0f); } -- cgit v1.2.3