Skip to content

Commit

Permalink
move InlineList open in dialog button to context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
kkoreilly committed Sep 25, 2024
1 parent 28642a9 commit cb7d369
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions core/inlinelist.go
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,6 @@ func (il *InlineList) Init() {
})
})
}
tree.AddAt(p, "open-button", func(w *Button) {
w.SetIcon(icons.OpenInFull).SetType(ButtonTonal)
w.Tooltip = "Open in a dialog"
w.OnClick(func(e events.Event) {
d := NewBody(il.ValueTitle)
NewText(d).SetType(TextSupporting).SetText(il.Tooltip)
NewList(d).SetSlice(il.Slice).SetValueTitle(il.ValueTitle).SetReadOnly(il.IsReadOnly())
d.OnClose(func(e events.Event) {
il.UpdateChange()
})
d.RunFullDialog(il)
})
})
})
}

Expand Down Expand Up @@ -136,4 +123,13 @@ func (il *InlineList) contextMenu(m *Scene, idx int) {
NewButton(m).SetText("Delete").SetIcon(icons.Delete).OnClick(func(e events.Event) {
il.DeleteAt(idx)
})
NewButton(m).SetText("Open in dialog").SetIcon(icons.OpenInNew).OnClick(func(e events.Event) {
d := NewBody(il.ValueTitle)
NewText(d).SetType(TextSupporting).SetText(il.Tooltip)
NewList(d).SetSlice(il.Slice).SetValueTitle(il.ValueTitle).SetReadOnly(il.IsReadOnly())
d.OnClose(func(e events.Event) {
il.UpdateChange()
})
d.RunFullDialog(il)
})
}

0 comments on commit cb7d369

Please sign in to comment.