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

Add mouse coordinates display in live viewer #326

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

codejaeger
Copy link
Contributor

@codejaeger codejaeger commented Apr 10, 2021

PR Checklist

If you are contributing to Javis.jl, please make sure you are able to check off each item on this list:

  • Did I update CHANGELOG.md with whatever changes/features I added with this PR?
  • Did I make sure to only change the part of the file where I introduced a new change/feature?
  • Did I cover all corner cases to be close to 100% test coverage (if applicable)?
  • Did I properly add Javis dependencies to the Project.toml + set an upper bound of the dependency (if applicable)?
  • Did I properly add test dependencies to the test directory (if applicable)?
  • Did I check relevant tutorials that may be affected by changes in this PR?
  • Did I clearly articulate why this PR was made the way it was and how it was made?

Demo

Screenshot 2021-04-10 at 11 28 57 PM

Link to relevant issue(s)
Closes #177

How did you address these issues with this PR? What methods did you use?
Added the mouse coordinates into a Gtklabel. There were 2 ways to do this.

  1. Use a Gtk.EventBox (then add the canvas to it) and enable the POINTER_MOTION event in the event box. Then connect a callback to update the coordinates.
  2. Make use of the property motion from the Gtk.Canvas and add a callback for the update.

References:-

  1. https://stackoverflow.com/questions/58683788/gtk-how-to-detect-the-mouse-position-over-eventbox
  2. https://juliagraphics.github.io/Gtk.jl/latest/manual/canvas/

@codejaeger codejaeger force-pushed the codejaeger-feature-addmousehover branch from f5651ff to 4056efd Compare April 10, 2021 18:13
@codecov
Copy link

codecov bot commented Apr 10, 2021

Codecov Report

Merging #326 (7120fa5) into master (4241ea1) will increase coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #326   +/-   ##
=======================================
  Coverage   96.17%   96.18%           
=======================================
  Files          21       21           
  Lines        1151     1154    +3     
=======================================
+ Hits         1107     1110    +3     
  Misses         44       44           
Impacted Files Coverage Δ
src/javis_viewer.jl 98.24% <100.00%> (+0.09%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4241ea1...7120fa5. Read the comment docs.

@Wikunia
Copy link
Member

Wikunia commented Apr 13, 2021

Looks great!
Two things:

  • Please round the pixel values otherwise it screws up the slider and buttons a bit when moving around with the mouse.
  • I think users are more interested in the coordinates where the origin (center of the image) is 0, 0

@codejaeger codejaeger force-pushed the codejaeger-feature-addmousehover branch from 4056efd to 7120fa5 Compare April 16, 2021 10:32
@codejaeger
Copy link
Contributor Author

@Wikunia thanks for the review, I made the changes.

@Wikunia
Copy link
Member

Wikunia commented May 23, 2021

Thanks we had a look at this yesterday and we would like to make it a bit clearer with x= ..., y = ... and maybe put it under the frame functionality or smaller and to the right instead of centered.
Anything else we wanted @TheCedarPrince ?

@Wikunia Wikunia changed the base branch from master to main February 25, 2022 18:38
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.

Hover for Image Viewer
2 participants