VideoTools/vendor/fyne.io/fyne/v2/dialog/confirm.go
Stu Leak 68df790d27 Fix player frame generation and video playback
Major improvements to UnifiedPlayer:

1. GetFrameImage() now works when paused for responsive UI updates
2. Play() method properly starts FFmpeg process
3. Frame display loop runs continuously for smooth video display
4. Disabled audio temporarily to fix video playback fundamentals
5. Simplified FFmpeg command to focus on video stream only

Player now:
- Generates video frames correctly
- Shows video when paused
- Has responsive progress tracking
- Starts playback properly

Next steps: Re-enable audio playback once video is stable
2026-01-07 22:20:00 -05:00

66 lines
2.0 KiB
Go

package dialog
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/lang"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
)
// ConfirmDialog is like the standard Dialog but with an additional confirmation button
type ConfirmDialog struct {
*dialog
confirm *widget.Button
}
// Confirm instructs the dialog to close agreeing with whatever content was displayed.
//
// Since: 2.6
func (d *ConfirmDialog) Confirm() {
d.hideWithResponse(true)
}
// SetConfirmText allows custom text to be set in the confirmation button
func (d *ConfirmDialog) SetConfirmText(label string) {
d.confirm.SetText(label)
d.win.Refresh()
}
// SetConfirmImportance sets the importance level of the confirm button.
//
// Since 2.4
func (d *ConfirmDialog) SetConfirmImportance(importance widget.Importance) {
d.confirm.Importance = importance
}
// NewConfirm creates a dialog over the specified window for user confirmation.
// The title is used for the dialog window and message is the content.
// The callback is executed when the user decides. After creation you should call Show().
func NewConfirm(title, message string, callback func(bool), parent fyne.Window) *ConfirmDialog {
d := newTextDialog(title, message, theme.QuestionIcon(), parent)
d.callback = callback
d.dismiss = &widget.Button{
Text: lang.L("No"), Icon: theme.CancelIcon(),
OnTapped: d.Hide,
}
confirm := &widget.Button{
Text: lang.L("Yes"), Icon: theme.ConfirmIcon(), Importance: widget.HighImportance,
OnTapped: func() {
d.hideWithResponse(true)
},
}
d.create(container.NewGridWithColumns(2, d.dismiss, confirm))
return &ConfirmDialog{dialog: d, confirm: confirm}
}
// ShowConfirm shows a dialog over the specified window for a user
// confirmation. The title is used for the dialog window and message is the content.
// The callback is executed when the user decides.
func ShowConfirm(title, message string, callback func(bool), parent fyne.Window) {
NewConfirm(title, message, callback, parent).Show()
}