overflowMenu adds the overflow menu to the given Scene.
(m *Scene)
| 175 | |
| 176 | // overflowMenu adds the overflow menu to the given Scene. |
| 177 | func (tb *Toolbar) overflowMenu(m *Scene) { |
| 178 | nm := len(tb.OverflowMenus) |
| 179 | ni := len(tb.overflowItems) |
| 180 | if ni > 0 { |
| 181 | p := &tree.Plan{Parent: tb.This} |
| 182 | p.Children = tb.overflowItems |
| 183 | p.Update(m) |
| 184 | if nm > 1 { // default includes sep |
| 185 | NewSeparator(m) |
| 186 | } |
| 187 | } |
| 188 | // reverse order so defaults are last |
| 189 | for i := nm - 1; i >= 0; i-- { |
| 190 | fn := tb.OverflowMenus[i] |
| 191 | fn(m) |
| 192 | } |
| 193 | } |
| 194 | |
| 195 | // AddOverflowMenu adds the given menu function to the overflow menu list. |
| 196 | // These functions are called in reverse order such that the last added function |
nothing calls this directly
no test coverage detected