main-axis-
The axis which is parallel with the side of the
targetthat thepopoveris laid out upon. If thepopoveris left or right of thetargetthen themain-axisis horizontal. If thepopoveris above or below thetargetthen themain-axisis vertical. cross-axis-
The axis which is counter to the
main-axis. zone-
The maximum-sized rectangle in a particular direction between one side of the
targetand thewindow bounds. There are four possiblezonestherefore:toprightbottomleft. target-
The element that the
popovercalculates its position relative to. docking edge-
The edge of
bodythat is closest totargetor vice-versa.
-
The
popoverMUST reference a target. -
The
popoverMUST have a body whose contents may be any view.-
The
bodyshould autosize to the dimensions of its contents. -
body boundsMUSNT exceedwindow bounds. -
There SHOULD be a small visual gap between the respective boundaries of
bodyandwindow. -
The
bodyMUST bias toward cross-axis centre-alignment with thetarget’s centre `registration pointup until such movement would break requirement2.ii. -
The
docking edgeof thebodymust be sufficiently spaced fromtargetto fittip.
-
-
The
popoverMUST automatically choose to layout in one of the four zones. The selectedzoneMUST be the one with the largest area.-
A
zonepreference MAY be given so that if multiplezoneareas can wholly fit thepopoverone can be chosen over others even if it is of a lesser area.
-
-
The
popoverMUST have a tip that is connected to thebodyand points to the centre registration point of thetarget’s `docking edge.-
The
tipshould automatically position itself on thebody’s `docking edge. -
The
tipshould bias toward centre-alignment of itself on thecross-axisup to such a point that it does not exceed thebody bounds. -
If the
body boundshave reachedwindow boundsthen thetipshould slide along its owncross-axisuntil it reaches either centre-alignment withtargetorbodybounds first. -
The
tipSHOULD be an equilateral triangle shape until doing so would no longer allow it to fit withinbody bounds. At that point it MUST be a right-angle triangle with the hypotenuse oriented toward the oppositecross-axisend ofbody.
-
-
When the
target positionortarget boundsorwindow boundschange thepopovershould recalculate itsbodyandtiplayout. -
When the
window boundschange thepopovershould recalculate itsbodyandtipposition.
-
Behaviour of what to do when
targetexitswindow boundsis undefined. -
A
zonepreference is only eligible when multiplezoneswholly fit thebody. A more sophisticated algorithm could account for percentage-fit such that azonewould be used even if it did not wholly fitbodyand even while otherzonesdo. -
Layout thrashing of
bodychanging zones can be mitigated by hysteresis and/or throttling techniques but is not specified here. -
Only behaviour for rectangular
targetandpopoversare specified.