Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Popup on shapes #248

Merged
merged 40 commits into from
Aug 8, 2019
Merged

Popup on shapes #248

merged 40 commits into from
Aug 8, 2019

Conversation

will-moore
Copy link
Member

@will-moore will-moore commented Mar 11, 2019

This addresses:

This shows a transient 'tooltip-like' popup when you mouse over (or within 5 pixels) of a shape, to show the shape Label (IF it has one). This tracks the mouse.

Screen Shot 2019-03-11 at 09 19 11

When you click on the shape, a more stable popup shows you the shape coordinates and a text-box for editing the shape Label:

Screen Shot 2019-03-11 at 09 00 05

You also see this while dragging, editing and creating a shape, which can help if you want to know the coordinates. Could maybe also add the Length OR Area.

To test.... NB: since this is quite a big change, we probably want to assess this for a while before merging. Need to see whether the popup gets in the way at-all or is annoying to have it all the time. And what info should it show?

  • Draw a new shape - while drawing, the Edit popup should show above the mid-point of the shape (shouldn't get in the way of drawing) and the coordinates and Length/Area should update.
  • When shape has been drawn, you can edit the Label in the popup. Hit Enter to save the label.
  • NB: you can do this while still in Drawing mode and then draw another shape (without having to switch out of draw mode to edit shape label)
  • Mousing over shapes will show the label in a transient smaller "hover" tooltip that tracks the mouse pointer (IF the shape has a Label) and should increase the thickness of the stroke width to indicate which shape is being 'hovered'.
  • Check how the hover tooltip looks with very short and very long labels (e.g. big paragraph).
  • Clicking a shape to select it will hide the transient "hover" tooltip and show the Edit popup.
  • Undo / Redo or editing the shape label in the Right panel "Comment" box will update the label in the Popup, if visible.
  • Change of Z/T index should hide the popup if the current shape isn't visible on the new plane. Same for delete or hiding of shape.
  • For multiple selection, popup will show for most-recently selected shape.
  • If multiple shapes are selected, some can be individually de-selected without hiding the popup on another shape.
  • Do we want to add a 'X' button on the popup to hide it without de-selecting shape?

@will-moore will-moore marked this pull request as ready for review March 14, 2019 04:44
@will-moore will-moore closed this Mar 14, 2019
@will-moore will-moore reopened this Mar 18, 2019
@pwalczysko
Copy link
Member

I think user would ask immediately: How do I switch that off ? It is nice that it is there, but maybe I do not want those popups as you rightly remark ?

@pwalczysko
Copy link
Member

I do not understand, once I clicked onto a ROI with intention to edit the popup, how do I get rid of it ? It stays there forever, whilst I am driving with my mouse over other ROIs already.
Do not see and Close button in the corner or similar.
Screen Shot 2019-03-18 at 17 18 25

@pwalczysko
Copy link
Member

Will test the smaller features tomorrow.

@will-moore
Copy link
Member Author

Addressed some points above:

  • You don't need to hit Enter to save text now. It's saved when you stop or pause typing (after 0.5 secs). Is this delay about right?
  • When you select a Label, the text is now displayed correctly in the popup, allowing you to edit it.
  • When multiple shapes are selected at once, we don't show the popup. But if multiple shapes are selected and you select 1 more (e.g. with Ctrl-Click on shapes table or Shift-click on the image) the popup will show for that shape.
  • The PolyLine coordinates are now shown as "points:.. " instead of x1, y1, x2, y2.
  • You can now select and Copy the coordinates (and Area/Length), including the whole Points string.

Screen Shot 2019-04-03 at 14 31 12

@pwalczysko
Copy link
Member

the bird's eye view bug #248 (comment) is fixed now.

The new features listed in #248 (comment) work as described. Quite happy about them.

The only point is the position of the popup with respect to a ROI in cases when the ROIs are lines or arrows pointing at 45 degrees angle. In such cases the popup is too far from the ROI. Discussed a solution with @will-moore in the office, where for lines and arrows the position of the popup could be at the topmost end of the ROI, instead of using the centre of the top of bounding box (used for all shapes now)

@jburel
Copy link
Member

jburel commented Jul 16, 2019

Entering text work and the right-hand panel is updated. Hitting enter after entering text could close the dialog.

@jburel
Copy link
Member

jburel commented Jul 16, 2019

@pwalczysko do you want to over the last set of changes?

@jburel
Copy link
Member

jburel commented Jul 16, 2019

Having the dialog popping up every time a shape is selected is a bit annoying.
A general control should be available to turn it on/off

@pwalczysko
Copy link
Member

@jburel discussed the solution of #248 (comment) in the office - I guess @will-moore will come up with a solution commit soon.

Otherwise, all is good here, and this is ready to go FMPOV

@will-moore
Copy link
Member Author

@jburel - you can turn off the popups with a right-click menu on the image. But as discussed with @pwalczysko this isn't obvious to find it.
We decided that when you click X to hide a popup, they will say "To turn on the pop-up again, right-click on the image and choose 'show popups" and then we don't show them again till they do that.
I seem to remember the context menu can't get access to the current "show popups" flag, so I'll have to see if there's a way to handle this...

@jburel
Copy link
Member

jburel commented Jul 17, 2019

I certainly did not think to right click on the image to turn the dialog on/off.

@will-moore
Copy link
Member Author

As @pwalczysko noticed on images with many ROIs (where they are paginated). After moving to a new plane, the shapes don't appear selected in the table, clicking on shapes doesn't select on first click, picking line colour doesn't show up on shape.

ShapeEditPopup.showPopupForShape() was calling regions.renderFeature(f) when Z/T changes
and with paginated ROIs being destroyed and created on Z/T switch it seems that
regions.viewer_ can be undefined at this time.
@will-moore
Copy link
Member Author

To test last fixes:

  • When you click X to hide the popup, you get a message saying how to turn them on again.
  • Fixed the issues with many paginated ROIs. After switching Z/T, shape selection, picking colors etc should continue to work.

Known issue (I think this is not related to this PR): If your line color-picker is showing a color (e.g. red) and you select a shape where the line has no color. Then you click the color-picker and don't choose a different color but just click "choose" to select red, the shape doesn't update because no color change is detected.

We need this since viewers/viewer/controls/ShapeEditPopup.js imports Ui from '../../../utils/ui'.
Importing this class that uses @decorator syntax seems to require reflect-metadata for karma
to run in ChromeHeadless
@pwalczysko
Copy link
Member

Screen Shot 2019-07-19 at 14 03 27

Maybe ...To re-enable popups, right-click on the image and use the context menu.

@pwalczysko
Copy link
Member

RFE: If not technically too difficult: Slightly unexpected is that when I re-enable the popups, the ROI which is selected already, does not obtain a popup. Only new selection do. I think better would be the behaviour where the popups would come immediately back after I re-enabled them.

@pwalczysko
Copy link
Member

Two RFEs otherwise looks good.

@pwalczysko
Copy link
Member

Works as expected. Ready to merge FMPOV

@jburel
Copy link
Member

jburel commented Aug 8, 2019

The popup now gives an indication on how to re-activate it, pointing at the right-click menu.

@jburel jburel merged commit 7bfdd56 into ome:master Aug 8, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants