OSDN Git Service
Visual adjustments to the layout feedback
This changeset makes a number of adjustments to the visual feedback
shown during layout dragging & dropping, selection, etc.
These are:
1. Render text on top of a translucent mask (white on a transparent
gray rectangle). This ensures that the text is readable regardless of
what content is under the text. We can't just use the background color
for the normal SWT drawString for two reasons: First, we need to
control the alpha of the background only (since we want the text to be
opaque and the background to be translucent), and second, we often
want to draw multiple lines of text, so we need to manually draw a
background rectangle which accommodates the maximum width of ALL the
lines such taht we don't have a ragged background.
2. Paint the outline mode lines using solid, translucent lines. And
adjust the bounding box computation in this case by 1 pixel such that
when you have adjacent boxes (such as in LinearLayout), you don't end
up with two thin lines next to each other creating a thick line.
3. Change the DrawingStyle internal API from "foreground" and
"background" colors to "stroke" (border) and "fill" (interior), with
individual alphas. This makes the color definitions simpler (for
example we don't need two separate styles, one for the selection
border and one for the selection interior).
4. Make the hover more subtle, using no border and just a light
translucent gray rectangle to only slightly draw attention to the view
under the mouse.
5. Change the appearance of selection to light blue and use a long
dashed border around it. The anchor lines are more faint and more
translucent to make them stand out less.
6. Change the appearance of the drop-preview to use a dash patterned
border identical to the selection border, but colored orange instead.
The matching border pattern will hopefully reinforce that the
drop-preview line is where the selection (also dashed) will go.
7. Use green to show available drop zones (the grid surrounding a
target in RelativeLayout, and the positions between elements in
LinearLayout).
8. For invalid drops, use a white X on a red background as the overlay
fill.
9. I replaced the oval+X pattern from the LayoutHelpers and replaced
them with the orange dashed insert-position lines. I also adjusted the
LinearLayout to draw the bounding boxes such that the middle of the
bounding box, rather than the top left edge, are aligned with the
insert position.
Change-Id: I85c77b9fa84b732a78aac635442f96e7ccfc3983