Skip to content

FormLayout target feedback is always in the top-left corner #1632

Description

@ptziegler
Image

The feedback is hard-coded to be in the top-left corner of the viewer, which makes it hard to follow. When the viewer is scrolled, it's also not visible at all...

{
if (hintFeedback == null) {
Layer layer = (Layer) LayerManager.Helper.find(mainPolicy.getHost())
.getLayer(IEditPartViewer.FEEDBACK_LAYER_ABV_1);
hintFeedback = new TextFeedback(layer, true);
hintFeedback.add();
}
hintFeedback.setText(percent + "%");
hintFeedback.setLocation(new Point(0, 0));
}

We should use a similar approach as used in e.g the Swing Mig- and FormLayout, where the location of the figure is at (10, y + 10) or (x + 10, 10), where (x, y) is the cursor location and depending on whether the horizontal or vertical ruler is moved. In short: The figure should be at the line we're currently moving.

// text feedback
Layer feedbackLayer = getMainLayer(LayerConstants.FEEDBACK_LAYER);
Point mouseLocation = changeBoundsRequest.getLocation().getCopy();
Point feedbackLocation = getTextFeedbackLocation(mouseLocation);
// translate relative mouse location to layer => absolute mouse location
feedbackLayer.translateToRelative(feedbackLocation);

Hint: This selection policy is only used when using the "classic" FormLayout mode.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions