Skip to content
This repository has been archived by the owner on Nov 3, 2020. It is now read-only.

Allow option clicking on a pod #302

Closed
orta opened this issue May 1, 2016 · 4 comments
Closed

Allow option clicking on a pod #302

orta opened this issue May 1, 2016 · 4 comments

Comments

@orta
Copy link
Member

orta commented May 1, 2016

screen shot 2016-05-01 at 08 33 00

Ideally would show a popover of the cocoapods.org page for a pod ( if it's a public page, otherwise the homepage, or repo address if GitHub )

Ideal width = 320, height is subjective, play with it and see. Maybe 480/
It'd also be nice to remove the global menu via CSS, and maybe even the top title for the Pod when it's a public spec.

@pedrovieira
Copy link
Contributor

pedrovieira commented May 9, 2016

I'm currently working on this feature (https://github.com/pedrovieira7/CocoaPods-app/blob/master/app/CocoaPods/CPPodfileEditorViewController.swift#L358-L532) and here's what I've done so far:

  1. Extended SMLTextView to catch all mouse events (⌥ + mouse hover on pod name, ⌥ + mouse down on pod name, three finger tap on pod name)
  2. The check if the pod name is valid, I'm manually setting the cursor to be inside the quotes, on every mouse event (this is useful when hovering the pod name with the ⌥ key down), so I can autoCompleteDelegate.completions() and get all the pod names to check if that pod is present, but that's basically all the information I get (I'm sure there's a better way of getting more data from the pod, such as the GitHub repo address)
  3. When a new link is clicked on the WebView inside the popover, I'm redirecting that URL to the browser.

What needs to be done:

  1. Correctly align the popover horizontally to the pod's name. Right now it's only presented on the correct line. Been trying but can't get it correctly aligned (issue / code)
  2. Can't seem to update the pod name color to match the brighter underline color even when explicitly trying to add the attribute (code)

What's your feedback on this?

@orta
Copy link
Member Author

orta commented May 9, 2016

First off - awesome!

  1. I found that I had some issues with generating the popover rect here, but it became much easier once I experimented by using a colored NSView and adding it at that point and seeing what it looks like
  2. I can live with this, if I had to guess, maybe something is re-triggering the drawing which overwrite the color based on syntax highlighting but it doesn't overwrite the NSUnderlineStyleAttributeName attribute

@pedrovieira
Copy link
Contributor

@orta I think we can close this issue now

@orta
Copy link
Member Author

orta commented May 17, 2016

Yes

@orta orta closed this as completed May 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants