switch to ellipsis truncation everywhere
This commit is contained in:
@@ -45,4 +45,4 @@ require (
|
||||
honnef.co/go/js/dom v0.0.0-20210725211120-f030747120f2 // indirect
|
||||
)
|
||||
|
||||
replace fyne.io/fyne/v2 v2.4.1 => github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20231103053003-b6f79d3c81cd
|
||||
replace fyne.io/fyne/v2 v2.4.1 => github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20231104060932-f124004dd651
|
||||
|
||||
@@ -67,8 +67,8 @@ github.com/danieljoos/wincred v1.1.0/go.mod h1:XYlo+eRTsVA9aHGp7NGjFkPla4m+DCL7h
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20231103053003-b6f79d3c81cd h1:7uiwltM4gnlMPhVxQ28eW7AQVPy6XZMkeB9+xrJM6s8=
|
||||
github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20231103053003-b6f79d3c81cd/go.mod h1:AWM1iPM2YfliduZ4u/kQzP9E6ARIWm0gg+57GpYzWro=
|
||||
github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20231104060932-f124004dd651 h1:szaOWq1a8gthqA55qq1egRj660DQM3Pp0nkrmjUwR48=
|
||||
github.com/dweymouth/fyne/v2 v2.3.0-rc1.0.20231104060932-f124004dd651/go.mod h1:AWM1iPM2YfliduZ4u/kQzP9E6ARIWm0gg+57GpYzWro=
|
||||
github.com/dweymouth/go-mpv v0.0.0-20230406003141-7f1858e503ee h1:ZGyJ6wp7CAfT31BugypcF/TPKEy2RrGR9JFq1JOjOpY=
|
||||
github.com/dweymouth/go-mpv v0.0.0-20230406003141-7f1858e503ee/go.mod h1:Ov0ieN90M7i+0k3OxhA/g1dozGs+UcPHDsMKqPgRDk0=
|
||||
github.com/dweymouth/go-subsonic v0.0.0-20231014003317-6a0c88db38ce h1:R12c/hE0licao74iAu2YDPJNI0jhGNuTyzmu3dMgFHE=
|
||||
|
||||
@@ -192,7 +192,7 @@ func NewAlbumPageHeader(page *AlbumPage) *AlbumPageHeader {
|
||||
a.cover.OnTapped = func(*fyne.PointEvent) { go a.showPopUpCover() }
|
||||
|
||||
a.titleLabel = widget.NewRichTextWithText("")
|
||||
a.titleLabel.Wrapping = fyne.TextTruncate
|
||||
a.titleLabel.Truncation = fyne.TextTruncateEllipsis
|
||||
a.titleLabel.Segments[0].(*widget.TextSegment).Style = widget.RichTextStyle{
|
||||
SizeName: theme.SizeNameHeadingText,
|
||||
}
|
||||
|
||||
@@ -249,7 +249,7 @@ func NewPlaylistPageHeader(page *PlaylistPage) *PlaylistPageHeader {
|
||||
|
||||
a.image = widgets.NewImagePlaceholder(myTheme.PlaylistIcon, 225)
|
||||
a.titleLabel = widget.NewRichTextWithText("")
|
||||
a.titleLabel.Wrapping = fyne.TextTruncate
|
||||
a.titleLabel.Truncation = fyne.TextTruncateEllipsis
|
||||
a.titleLabel.Segments[0].(*widget.TextSegment).Style = widget.RichTextStyle{
|
||||
SizeName: theme.SizeNameHeadingText,
|
||||
}
|
||||
|
||||
@@ -419,7 +419,7 @@ func NewPlaylistListRow(layout *layouts.ColumnsLayout) *PlaylistListRow {
|
||||
trackCountLabel: widget.NewLabel(""),
|
||||
}
|
||||
a.trackCountLabel.Alignment = fyne.TextAlignTrailing
|
||||
a.ownerLabel.Wrapping = fyne.TextTruncate
|
||||
a.ownerLabel.Truncation = fyne.TextTruncateEllipsis
|
||||
a.container = container.New(layout, a.nameLabel, a.descrptionLabel, a.ownerLabel, a.trackCountLabel)
|
||||
a.ExtendBaseWidget(a)
|
||||
return a
|
||||
|
||||
@@ -156,7 +156,7 @@ func NewGridViewItem(placeholderResource fyne.Resource) *GridViewItem {
|
||||
Cover: newCoverImage(placeholderResource),
|
||||
}
|
||||
g.primaryText.TextStyle.Bold = true
|
||||
g.primaryText.Wrapping = fyne.TextTruncate
|
||||
g.primaryText.Truncation = fyne.TextTruncateEllipsis
|
||||
g.ExtendBaseWidget(g)
|
||||
g.Cover.OnPlay = func() {
|
||||
if g.OnPlay != nil {
|
||||
|
||||
@@ -34,7 +34,7 @@ func NewMultiHyperlink() *MultiHyperlink {
|
||||
content: container.NewWithoutLayout(),
|
||||
}
|
||||
c.ExtendBaseWidget(c)
|
||||
//c.provider.Wrapping = fyne.TextTruncate
|
||||
//c.provider.Truncation = fyne.TextTruncateEllipsis
|
||||
return c
|
||||
}
|
||||
|
||||
@@ -107,11 +107,12 @@ func (c *MultiHyperlink) layoutObjects() {
|
||||
obj = c.content.Objects[2*i-1]
|
||||
ms := obj.MinSize()
|
||||
obj.Resize(ms)
|
||||
obj.Move(fyne.NewPos(x-ms.Width+c.getSeparatorWidth()+4, 0)) // this is really ugly
|
||||
obj.Move(fyne.NewPos(x-ms.Width+c.getSeparatorWidth()+1, 0)) // this is really ugly
|
||||
x -= theme.Padding() * 2
|
||||
}
|
||||
// move and resize text object
|
||||
textW := fyne.MeasureText(seg.Text, theme.TextSize(), fyne.TextStyle{}).Width + theme.Padding()*2 + theme.InnerPadding()
|
||||
// extra +3 to textW gives it just enough space to not trigger ellipsis truncation
|
||||
textW := fyne.MeasureText(seg.Text, theme.TextSize(), fyne.TextStyle{}).Width + theme.Padding()*2 + theme.InnerPadding() + 3
|
||||
obj = c.content.Objects[2*i]
|
||||
ms := obj.MinSize()
|
||||
w := fyne.Min(width-x, textW)
|
||||
@@ -132,7 +133,7 @@ func (c *MultiHyperlink) updateOrReplaceLabel(obj fyne.CanvasObject, text string
|
||||
}
|
||||
}
|
||||
l := widget.NewLabel(text)
|
||||
l.Wrapping = fyne.TextTruncate
|
||||
l.Truncation = fyne.TextTruncateEllipsis
|
||||
return l
|
||||
}
|
||||
|
||||
@@ -145,7 +146,7 @@ func (c *MultiHyperlink) updateOrReplaceHyperlink(obj fyne.CanvasObject, text, l
|
||||
}
|
||||
}
|
||||
l := widget.NewHyperlink(text, nil)
|
||||
l.Wrapping = fyne.TextTruncate
|
||||
l.Truncation = fyne.TextTruncateEllipsis
|
||||
l.OnTapped = func() { c.onSegmentTapped(link) }
|
||||
return l
|
||||
}
|
||||
|
||||
@@ -42,8 +42,8 @@ func NewNowPlayingCard() *NowPlayingCard {
|
||||
n.cover.OnTappedSecondary = n.showMenu
|
||||
n.trackName.Hidden = true
|
||||
n.albumName.Hidden = true
|
||||
n.albumName.Wrapping = fyne.TextTruncate
|
||||
n.trackName.Wrapping = fyne.TextTruncate
|
||||
n.albumName.Truncation = fyne.TextTruncateEllipsis
|
||||
n.trackName.Truncation = fyne.TextTruncateEllipsis
|
||||
n.trackName.TextStyle.Bold = true
|
||||
n.cover.SetMinSize(fyne.NewSize(85, 85))
|
||||
n.cover.FillMode = canvas.ImageFillContain
|
||||
|
||||
@@ -713,7 +713,7 @@ func NewTrackRow(tracklist *Tracklist, playingIcon fyne.CanvasObject) *TrackRow
|
||||
t.artist = NewMultiHyperlink()
|
||||
t.artist.OnTapped = tracklist.onArtistTapped
|
||||
t.album = widget.NewHyperlink("", nil)
|
||||
t.album.Wrapping = fyne.TextTruncate
|
||||
t.album.Truncation = fyne.TextTruncateEllipsis
|
||||
t.album.OnTapped = func() { tracklist.onAlbumTapped(t.albumID) }
|
||||
t.dur = newTrailingAlignLabel()
|
||||
t.year = newTrailingAlignLabel()
|
||||
@@ -735,13 +735,13 @@ func NewTrackRow(tracklist *Tracklist, playingIcon fyne.CanvasObject) *TrackRow
|
||||
|
||||
func newTruncatingRichText() *widget.RichText {
|
||||
rt := widget.NewRichTextWithText("")
|
||||
rt.Wrapping = fyne.TextTruncate
|
||||
rt.Truncation = fyne.TextTruncateEllipsis
|
||||
return rt
|
||||
}
|
||||
|
||||
func newTruncatingLabel() *widget.Label {
|
||||
rt := widget.NewLabel("")
|
||||
rt.Wrapping = fyne.TextTruncate
|
||||
rt.Truncation = fyne.TextTruncateEllipsis
|
||||
return rt
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user