Last modified 16 years ago
Last modified on 05/19/09 19:40:46
Analysis
Overview
Halo menus are laid out with absolute coordinates defined by the halo menu. This means that there is no coordination going on between halo menus to prevent them from overlapping. This happens now when the user zooms the book out ot 10%, but it can happen later if plugins are allowed to provide their own halo menus.
This task should change the way halos lay out so they don't overlap when there is a small frame or the page work area is zoomed in.
Task requirements
- Determine how to handle overlapping halo menus, or more importantly how to layout halo menus in ways other than absolute coordinates
- For now, a simple minimal bounding rectangle, aligned with the selection topLeft will suffice
Task result
- The result of this task is code
Implementation idea
- For a first pass, we can add a helper method to aid in determined what a true rectangle for halos should be. This would help with the issue of the frame (for example) getting smaller, but it won't help with plugins deciding they want to be placed where some other menu decided it should be. Potentially we'll need a halo menu layout system, that takes all of the halo menus, moves them so they don't overlap, and determines what the minimal bounding rectangle for them is. This may prove to be difficult given the existing absolute coordinate system, where halo menus place themselves on the page. Maybe we need halo menus to be able to also provide some hinting, for example topRight, or bottomCenter, and a HaloContainer can lay out the halo menus itself, sorted in order by the sort key within the position.
Related
How to demo
- Demo how the halo menus lay out properly when the page work area is zoomed to 10%, or a small frame is created
Design
- Due to time constraints, we decided to not implement a new halo menu layout system. Instead, I will add two static ints to AppHaloUtil that determine the smallest width and height of a rectangle that the halo menus should use
- I'll then write a method to return the selection bounds constrained by this minimal rectangle, and utilize it in the halo menus that wrap frames.
Implementation
- Added a method to AppHaloUtil that gets the minimum selection bounds
- Replace code with call to new method in rotate, move and main halo menus
- see [2422]
Testing
(Place the testing results here.)
Comments
(Write comments for this or later revisions here.)