aboutsummaryrefslogtreecommitdiffstats
path: root/src/graphui/classes/com/jogamp/graph/ui/widgets/MediaPlayer.java
diff options
context:
space:
mode:
authorSven Gothel <sgothel@jausoft.com>2023-12-24 19:12:52 +0100
committerSven Gothel <sgothel@jausoft.com>2023-12-24 19:12:52 +0100
commitc6e39c6e313a34688ca0164d7a34b6465e92396f (patch)
treeca74beed22defac6f26f7ef82f228ff83a339e61 /src/graphui/classes/com/jogamp/graph/ui/widgets/MediaPlayer.java
parentb5e6a852451f2a78a1783ca8fbd704005fbafd07 (diff)
GraphUI RangeSlider Widget: Add rectangular page-sized knob mode using a 'page size' of covered view. Resolve color-setup.
Tested with FontView01
Diffstat (limited to 'src/graphui/classes/com/jogamp/graph/ui/widgets/MediaPlayer.java')
-rw-r--r--src/graphui/classes/com/jogamp/graph/ui/widgets/MediaPlayer.java12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/graphui/classes/com/jogamp/graph/ui/widgets/MediaPlayer.java b/src/graphui/classes/com/jogamp/graph/ui/widgets/MediaPlayer.java
index 3fc48306a..799a9e8ad 100644
--- a/src/graphui/classes/com/jogamp/graph/ui/widgets/MediaPlayer.java
+++ b/src/graphui/classes/com/jogamp/graph/ui/widgets/MediaPlayer.java
@@ -128,10 +128,14 @@ public class MediaPlayer extends Widget {
mButton.setName("mp.mButton").setInteractive(false);
mButton.setPerp().setPressedColorMod(1f, 1f, 1f, 0.85f);
- final RangeSlider ctrlSlider = new RangeSlider(renderModes, aratio, ctrlSliderHeight, 4.0f, 0, 100, 0);
+ final RangeSlider ctrlSlider;
{
- final float dy = ( ctrlSlider.getKnobSize() - ctrlSliderHeight ) * 0.5f;
- ctrlSlider.setPaddding(new Padding(0, 0, ctrlCellHeight-dy, 0));
+ final float knobScale = 3f;
+ final float knobHeight = ctrlSliderHeight * knobScale;
+ ctrlSlider = new RangeSlider(renderModes, new Vec2f(aratio - knobHeight, ctrlSliderHeight), knobScale, new Vec2f(0, 100), 0);
+ final float dx = knobHeight / 2f;
+ final float dy = ( knobHeight - ctrlSliderHeight ) * 0.5f;
+ ctrlSlider.setPaddding(new Padding(0, dx, ctrlCellHeight-dy, dx));
}
ctrlSlider.setName("mp.slider");
@@ -153,7 +157,7 @@ public class MediaPlayer extends Widget {
// System.err.println("MediaButton State: "+mp);
if( eventMask.isSet(GLMediaPlayer.EventMask.Bit.Init) ) {
System.err.println(mp.toString());
- ctrlSlider.setMinMax(0, mp.getDuration(), 0);
+ ctrlSlider.setMinMax(new Vec2f(0, mp.getDuration()), 0);
} else if( eventMask.isSet(GLMediaPlayer.EventMask.Bit.Play) ) {
playButton.setToggle(true);
} else if( eventMask.isSet(GLMediaPlayer.EventMask.Bit.Pause) ) {