Fix #345: make sure to truncate playlist title, description, owner
This commit is contained in:
@@ -239,13 +239,12 @@ func NewPlaylistPageHeader(page *PlaylistPage) *PlaylistPageHeader {
|
|||||||
a.ExtendBaseWidget(a)
|
a.ExtendBaseWidget(a)
|
||||||
|
|
||||||
a.image = widgets.NewImagePlaceholder(myTheme.PlaylistIcon, 225)
|
a.image = widgets.NewImagePlaceholder(myTheme.PlaylistIcon, 225)
|
||||||
a.titleLabel = widget.NewRichTextWithText("")
|
a.titleLabel = util.NewTruncatingRichText()
|
||||||
a.titleLabel.Truncation = fyne.TextTruncateEllipsis
|
|
||||||
a.titleLabel.Segments[0].(*widget.TextSegment).Style = widget.RichTextStyle{
|
a.titleLabel.Segments[0].(*widget.TextSegment).Style = widget.RichTextStyle{
|
||||||
SizeName: theme.SizeNameHeadingText,
|
SizeName: theme.SizeNameHeadingText,
|
||||||
}
|
}
|
||||||
a.descriptionLabel = widget.NewLabel("")
|
a.descriptionLabel = util.NewTruncatingLabel()
|
||||||
a.ownerLabel = widget.NewLabel("")
|
a.ownerLabel = util.NewTruncatingLabel()
|
||||||
a.createdAtLabel = widget.NewLabel("")
|
a.createdAtLabel = widget.NewLabel("")
|
||||||
a.trackTimeLabel = widget.NewLabel("")
|
a.trackTimeLabel = widget.NewLabel("")
|
||||||
a.editButton = widget.NewButtonWithIcon("Edit", theme.DocumentCreateIcon(), func() {
|
a.editButton = widget.NewButtonWithIcon("Edit", theme.DocumentCreateIcon(), func() {
|
||||||
|
|||||||
@@ -429,13 +429,11 @@ type PlaylistListRow struct {
|
|||||||
|
|
||||||
func NewPlaylistListRow(layout *layouts.ColumnsLayout) *PlaylistListRow {
|
func NewPlaylistListRow(layout *layouts.ColumnsLayout) *PlaylistListRow {
|
||||||
a := &PlaylistListRow{
|
a := &PlaylistListRow{
|
||||||
nameLabel: widget.NewLabel(""),
|
nameLabel: util.NewTruncatingLabel(),
|
||||||
descrptionLabel: widget.NewLabel(""),
|
descrptionLabel: util.NewTruncatingLabel(),
|
||||||
ownerLabel: widget.NewLabel(""),
|
ownerLabel: util.NewTruncatingLabel(),
|
||||||
trackCountLabel: widget.NewLabel(""),
|
trackCountLabel: util.NewTrailingAlignLabel(),
|
||||||
}
|
}
|
||||||
a.trackCountLabel.Alignment = fyne.TextAlignTrailing
|
|
||||||
a.ownerLabel.Truncation = fyne.TextTruncateEllipsis
|
|
||||||
a.Content = container.New(layout, a.nameLabel, a.descrptionLabel, a.ownerLabel, a.trackCountLabel)
|
a.Content = container.New(layout, a.nameLabel, a.descrptionLabel, a.ownerLabel, a.trackCountLabel)
|
||||||
a.ExtendBaseWidget(a)
|
a.ExtendBaseWidget(a)
|
||||||
return a
|
return a
|
||||||
|
|||||||
Reference in New Issue
Block a user