MCPcopy Create free account
hub / github.com/cogentcore/core / dragMenuAddModText

Method dragMenuAddModText

core/events.go:796–807  ·  view source on GitHub ↗
(m *Scene, mod events.DropMods)

Source from the content-addressed store, hash-verified

794}
795
796func (em *Events) dragMenuAddModText(m *Scene, mod events.DropMods) {
797 text := ""
798 switch mod {
799 case events.DropCopy:
800 text = "Copy (use Shift to move):"
801 case events.DropMove:
802 text = "Move:"
803 }
804 NewText(m).SetType(TextLabelLarge).SetText(text).Styler(func(s *styles.Style) {
805 s.Margin.Set(units.Em(0.5))
806 })
807}
808
809// dragDrop sends the [events.Drop] event to the top of the DragHovers stack.
810// clearing the current dragging sprite before doing anything.

Callers 2

DragDropMethod · 0.80
dragDropMethod · 0.80

Calls 6

EmFunction · 0.92
StylerMethod · 0.80
NewTextFunction · 0.70
SetMethod · 0.65
SetTextMethod · 0.45
SetTypeMethod · 0.45

Tested by

no test coverage detected