Skip to content

Commit

Permalink
Merge pull request #1067 from cogentcore/icon-chooser
Browse files Browse the repository at this point in the history
exclude icons from list (was already in table) and use consistent expression to exclude
  • Loading branch information
kkoreilly authored Jul 26, 2024
2 parents 0b40eb1 + 1b0a083 commit 06c5847
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
2 changes: 1 addition & 1 deletion core/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -486,7 +486,7 @@ func (lb *ListBase) BindSelect(val *int) *ListBase {
func (lb *ListBase) UpdateMaxWidths() {
lb.maxWidth = 0
npv := reflectx.NonPointerValue(lb.elementValue)
isString := npv.Type().Kind() == reflect.String
isString := npv.Type().Kind() == reflect.String && npv.Type() != reflect.TypeFor[icons.Icon]()
if !isString || lb.SliceSize == 0 {
return
}
Expand Down
5 changes: 2 additions & 3 deletions core/table.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,9 +197,8 @@ func (tb *Table) UpdateMaxWidths() {
tb.colMaxWidths[fli] = 0
val := tb.sliceElementValue(0)
fval := val.FieldByIndex(field.Index)
_, isicon := fval.Interface().(icons.Icon)
isString := fval.Type().Kind() == reflect.String
if !isString || isicon {
isString := fval.Type().Kind() == reflect.String && fval.Type() != reflect.TypeFor[icons.Icon]()
if !isString {
continue
}
mxw := 0
Expand Down

0 comments on commit 06c5847

Please sign in to comment.