org-noter icon indicating copy to clipboard operation
org-noter copied to clipboard

Support for showing tooltip on both axis

Open ahmed-shariff opened this issue 4 years ago • 9 comments

This is a solution to #96

I am using the format (page . <horizontal axis> . <vertical axis>) for the INTERLEAVE_PAGE_NOTE/NOTER_PAGE

Work to be done:

  • [x] Adding the function to allow showing tooltip in both axis ( this is basically a copy from https://github.com/politza/pdf-tools/pull/623. Until that gets pulled, i figured will have a copy of it here)
  • [x] View tooltip in both axis
  • [x] Add new precise note with both axis information when no other precise note is added
    • Need to fix a bug with width calculation
    • Only implementing the pdf-tools version of this
  • [x] Allow adding precise note when there is another precise note.
    • Need to refactor the comparison functions to account for this
  • [x] Sorting based on width coordinate
  • [x] ~~Move to using nth instead of cadr or cddr to allow extensions like #48~~
  • [x] The above is replaced with a set of get-location-<position> functions

ahmed-shariff avatar Oct 02 '20 08:10 ahmed-shariff

@weirdNox the implementation for now provides support for [page, top and left] coordinates with precise notes while also providing backward compatibility with the [page top] format. The tooltip shows at the beginning of the precise note with the [page top left] format, as opposed showing on the left margin.

Let me know if you think there is anything additional I need to consider.

ahmed-shariff avatar Dec 15 '20 19:12 ahmed-shariff

Thanks for this PR. Everything works great, but I had to add (require 'pdf-tools) at the top of org-noter.el, otherwise, I'm getting Invalid function (pdf-view-current-overlay) in pdf-util-tooltip-arrow-with-image-left.

czikus avatar Jan 13 '21 12:01 czikus

Added that to the PR. Thank you for pointing it out 👍

ahmed-shariff avatar Jan 13 '21 22:01 ahmed-shariff

Where is the holdup for merging this PR? Seems to me that this is complete. It's a nice feature.

wos-dot avatar Oct 12 '21 11:10 wos-dot

I need to investigate a better way to visualise the arrow. I hadn't been able to get around to it. See https://github.com/politza/pdf-tools/issues/582

ahmed-shariff avatar Oct 12 '21 20:10 ahmed-shariff

I see this in the repo

(defun pdf-util-tooltip-in-window (text x y &optional window)
  (let* ((we (window-inside-absolute-pixel-edges window))
         (dx (round (+ x (nth 0 we))))
         (dy (round (+ y (nth 1 we))))
         (tooltip-frame-parameters
          `((left . ,dx)
            (top . ,dy)
            ,@tooltip-frame-parameters)))
    (tooltip-show text)))

Maybe it was fixed, just the issue was not closed? Or am I misreading something?

wos-dot avatar Oct 13 '21 11:10 wos-dot

@weirdNox, may I ask, are you still actively maintaining this repo? I use your library on a daily basis, and would like to make some changes to it (specifically, to address issue 143), I am trying to decide whether to clone your repo or @ahmed-shariff's, which appears to still be under active development?

gcoladon avatar Nov 26 '21 19:11 gcoladon

@gcoladon Nope, he doesn't use this package himself anymore. As you can see, the lastest commit to this repo was 2 years ago and no pull requests gets reviewed at the moment. I decided to fork ahmed-shariff's repo to add some functions I want for the time being.

c1-g avatar Dec 02 '21 01:12 c1-g

I'm wondering if anyone's interested in working on a shared fork.

In particular @c1-g's fork appears to be well ahead of the others, notably with overlay support for epubs. It does have many rough edges right now though.

I'd be happy to collaborate; I'm getting up to speed with elisp and I'm already reasonably productive.

dmitrym0 avatar Jul 12 '22 16:07 dmitrym0