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