disable playback slider when nothing playing
This commit is contained in:
@@ -114,6 +114,7 @@ func NewPlayerControls() *PlayerControls {
|
|||||||
pc.ExtendBaseWidget(pc)
|
pc.ExtendBaseWidget(pc)
|
||||||
|
|
||||||
pc.slider = NewTrackPosSlider()
|
pc.slider = NewTrackPosSlider()
|
||||||
|
pc.slider.Disable()
|
||||||
pc.curTimeLabel = NewLabelMinSize(util.SecondsToTimeString(0), 55)
|
pc.curTimeLabel = NewLabelMinSize(util.SecondsToTimeString(0), 55)
|
||||||
pc.curTimeLabel.Alignment = fyne.TextAlignTrailing
|
pc.curTimeLabel.Alignment = fyne.TextAlignTrailing
|
||||||
pc.totalTimeLabel = NewLabelMinSize(util.SecondsToTimeString(0), 55)
|
pc.totalTimeLabel = NewLabelMinSize(util.SecondsToTimeString(0), 55)
|
||||||
@@ -182,6 +183,11 @@ func (pc *PlayerControls) UpdatePlayTime(curTime, totalTime float64) {
|
|||||||
pc.totalTimeLabel.SetText(tt)
|
pc.totalTimeLabel.SetText(tt)
|
||||||
updated = true
|
updated = true
|
||||||
}
|
}
|
||||||
|
if totalTime > 0 {
|
||||||
|
pc.slider.Enable()
|
||||||
|
} else {
|
||||||
|
pc.slider.Disable()
|
||||||
|
}
|
||||||
if !pc.slider.IsDragging() {
|
if !pc.slider.IsDragging() {
|
||||||
ct := util.SecondsToTimeString(curTime)
|
ct := util.SecondsToTimeString(curTime)
|
||||||
if ct != pc.curTimeLabel.Text {
|
if ct != pc.curTimeLabel.Text {
|
||||||
|
|||||||
Reference in New Issue
Block a user