(m *Scene)
| 1084 | } |
| 1085 | |
| 1086 | func (tf *TextField) contextMenu(m *Scene) { |
| 1087 | NewFuncButton(m).SetFunc(tf.copy).SetIcon(icons.Copy).SetKey(keymap.Copy).SetState(tf.NoEcho || !tf.hasSelection(), states.Disabled) |
| 1088 | if !tf.IsReadOnly() { |
| 1089 | NewFuncButton(m).SetFunc(tf.cut).SetIcon(icons.Cut).SetKey(keymap.Cut).SetState(tf.NoEcho || !tf.hasSelection(), states.Disabled) |
| 1090 | paste := NewFuncButton(m).SetFunc(tf.paste).SetIcon(icons.Paste).SetKey(keymap.Paste) |
| 1091 | cb := tf.Scene.Events.Clipboard() |
| 1092 | if cb != nil { |
| 1093 | paste.SetState(cb.IsEmpty(), states.Disabled) |
| 1094 | } |
| 1095 | } |
| 1096 | } |
| 1097 | |
| 1098 | /////////////////////////////////////////////////////////////////////////////// |
| 1099 | // Undo |
nothing calls this directly
no test coverage detected