M widget/selectable.go => widget/selectable.go +6 -0
@@ 160,6 160,12 @@ func (l *Selectable) SetText(s string) {
}
}
+// Truncated returns whether the text has been truncated by the text shaper to
+// fit within available constraints.
+func (l *Selectable) Truncated() bool {
+ return l.text.Truncated()
+}
+
// Layout clips to the dimensions of the selectable, updates the shaped text, configures input handling, and paints
// the text and selection rectangles. The provided textMaterial and selectionMaterial ops are used to set the
// paint material for the text and selection rectangles, respectively.
M widget/text.go => widget/text.go +6 -0
@@ 447,6 447,12 @@ func (e *textView) MoveCoord(pos image.Point) {
e.caret.xoff = 0
}
+// Truncated returns whether the text in the textView is currently
+// truncated due to a restriction on the number of lines.
+func (e *textView) Truncated() bool {
+ return e.index.truncated
+}
+
func (e *textView) layoutText(lt *text.Shaper) {
e.Seek(0, io.SeekStart)
var r io.Reader = e