Skip to content

Commit 1c03294

Browse files
committed
tabupdate: tensorcore.Table set width multiplier 1.1 to fit more consistently, and add tooltip to always have full text avail
1 parent 1b8f5a8 commit 1c03294

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tensorcore/table.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,7 @@ func (tb *Table) StyleValue(w core.Widget, s *styles.Style, row, col int) {
126126
if len(tb.colMaxWidths) > col {
127127
hw = max(float32(tb.colMaxWidths[col]), hw)
128128
}
129-
hv := units.Ch(hw)
129+
hv := units.Ch(1.1 * hw) // 1.1 works
130130
s.Min.X.Value = max(s.Min.X.Value, hv.Convert(s.Min.X.Unit, &s.UnitContext).Value)
131131
s.SetTextWrap(false)
132132
}
@@ -320,11 +320,14 @@ func (tb *Table) MakeRow(p *tree.Plan, i int) {
320320
if isstr {
321321
str = col.String1D(vi)
322322
core.Bind(&str, w)
323+
wb.SetTooltip(str)
323324
} else {
324325
fval = col.Float1D(vi)
326+
wb.SetTooltip(fmt.Sprintf("%g", fval))
325327
core.Bind(&fval, w)
326328
}
327329
} else {
330+
wb.SetTooltip("")
328331
if isstr {
329332
core.Bind(tb.blankString, w)
330333
} else {

0 commit comments

Comments
 (0)