Align author clip list styling with merge
This commit is contained in:
parent
22eb734df2
commit
0c91f63329
|
|
@ -9,6 +9,7 @@ import (
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"fyne.io/fyne/v2"
|
"fyne.io/fyne/v2"
|
||||||
|
"fyne.io/fyne/v2/canvas"
|
||||||
"fyne.io/fyne/v2/container"
|
"fyne.io/fyne/v2/container"
|
||||||
"fyne.io/fyne/v2/dialog"
|
"fyne.io/fyne/v2/dialog"
|
||||||
"fyne.io/fyne/v2/layout"
|
"fyne.io/fyne/v2/layout"
|
||||||
|
|
@ -81,7 +82,10 @@ func buildVideoClipsTab(state *appState) fyne.CanvasObject {
|
||||||
}
|
}
|
||||||
for i, clip := range state.authorClips {
|
for i, clip := range state.authorClips {
|
||||||
idx := i
|
idx := i
|
||||||
card := widget.NewCard(clip.DisplayName, fmt.Sprintf("%.2fs", clip.Duration), nil)
|
nameLabel := widget.NewLabel(clip.DisplayName)
|
||||||
|
nameLabel.TextStyle = fyne.TextStyle{Bold: true}
|
||||||
|
durationLabel := widget.NewLabel(fmt.Sprintf("%.2fs", clip.Duration))
|
||||||
|
durationLabel.TextStyle = fyne.TextStyle{Italic: true}
|
||||||
|
|
||||||
removeBtn := widget.NewButton("Remove", func() {
|
removeBtn := widget.NewButton("Remove", func() {
|
||||||
state.authorClips = append(state.authorClips[:idx], state.authorClips[idx+1:]...)
|
state.authorClips = append(state.authorClips[:idx], state.authorClips[idx+1:]...)
|
||||||
|
|
@ -89,16 +93,17 @@ func buildVideoClipsTab(state *appState) fyne.CanvasObject {
|
||||||
})
|
})
|
||||||
removeBtn.Importance = widget.MediumImportance
|
removeBtn.Importance = widget.MediumImportance
|
||||||
|
|
||||||
durationLabel := widget.NewLabel(fmt.Sprintf("Duration: %.2f seconds", clip.Duration))
|
row := container.NewBorder(
|
||||||
durationLabel.TextStyle = fyne.TextStyle{Italic: true}
|
nil,
|
||||||
|
nil,
|
||||||
cardContent := container.NewVBox(
|
nil,
|
||||||
durationLabel,
|
|
||||||
widget.NewSeparator(),
|
|
||||||
removeBtn,
|
removeBtn,
|
||||||
|
container.NewVBox(nameLabel, durationLabel),
|
||||||
)
|
)
|
||||||
card.SetContent(cardContent)
|
cardBg := canvas.NewRectangle(utils.MustHex("#171C2A"))
|
||||||
list.Add(card)
|
cardBg.CornerRadius = 6
|
||||||
|
cardBg.SetMinSize(fyne.NewSize(0, nameLabel.MinSize().Height+durationLabel.MinSize().Height+12))
|
||||||
|
list.Add(container.NewPadded(container.NewMax(cardBg, row)))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user