The Inbox: Morphic-ct.1713.mcz

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

The Inbox: Morphic-ct.1713.mcz

commits-2
A new version of Morphic was added to project The Inbox:
http://source.squeak.org/inbox/Morphic-ct.1713.mcz

==================== Summary ====================

Name: Morphic-ct.1713
Author: ct
Time: 11 November 2020, 1:40:28.920952 pm
UUID: dbe3197c-d3cf-0f4d-a8e4-75238156e870
Ancestors: Morphic-mt.1710

Make sure that pressing the arrow-up key in a menu without selection selects the last item. Until now, this only worked for menus with a title.

=============== Diff against Morphic-mt.1710 ===============

Item was changed:
  ----- Method: DockingBarMorph>>moveSelectionDown:event: (in category 'control') -----
  moveSelectionDown: direction event: evt
  "Move the current selection up or down by one, presumably under keyboard control.
  direction = +/-1"
 
  | index |
+ index := (submorphs
+ indexOf: selectedItem
+ ifAbsent: [direction positive ifTrue: [0] ifFalse: [1]]
+ ) + direction.
- index := (submorphs indexOf: selectedItem ifAbsent: [1-direction]) + direction.
  submorphs do: "Ensure finite"
  [:unused | | m |
  m := submorphs atWrap: index.
  ((m isKindOf: DockingBarItemMorph) and: [m isEnabled]) ifTrue:
  [^ self selectItem: m event: evt].
  "Keep looking for an enabled item"
  index := index + direction sign].
  ^ self selectItem: nil event: evt!

Item was changed:
  ----- Method: MenuMorph>>moveSelectionDown:event: (in category 'keyboard control') -----
  moveSelectionDown: direction event: evt
  "Move the current selection up or down by one, presumably under keyboard control.
  direction = +/-1"
 
  | index |
+ index := (submorphs
+ indexOf: selectedItem
+ ifAbsent: [direction positive ifTrue: [0] ifFalse: [1]]
+ ) + direction.
- index := (submorphs indexOf: selectedItem ifAbsent: [1-direction]) + direction.
  submorphs do: "Ensure finite"
  [:unused | | m |
  m := submorphs atWrap: index.
  ((m isKindOf: MenuItemMorph) and: [m isEnabled]) ifTrue:
  [^ self selectItem: m event: evt].
  "Keep looking for an enabled item"
  index := index + direction sign].
  ^ self selectItem: nil event: evt!