jupyter / qtconsole

Jupyter Qt Console
https://qtconsole.readthedocs.io/en/stable/
BSD 3-Clause "New" or "Revised" License
416 stars 200 forks source link

Calltips too close to text being typed. #301

Open daver1691 opened 6 years ago

daver1691 commented 6 years ago

I like the idea of the calltips appearing on open parenthesis, but the popup is too close to the text being typed on my system (Ubuntu 18.04, jupyter qtconsole 4.3.1).

The corner of the calltips popup box is commonly in actual contact with the text, and occasionally a pixel or two over the top of the text being typed. Also, if using the KDE desktop, the "drop-shadow" that appears around pop-ups will darken the text area. Personally, I'd be perfectly happy with it if it were close but not touching, maybe 20 pixels away, but as it is I have to disable calltips altogether.

ccordoba12 commented 6 years ago

You're welcome to improve the situation.

daver1691 commented 6 years ago

I didn't look at the code because I normally find that application software that uses desktop widgets to be far beyond my meager coding skills, but in this case I'll grant that it was remarkably easy to find, which is a tribute to this code being well written and the general ease-of-use of Python.

Line 156 of call_tip_widget.py. I recommend that padding number be bumped up from 3 to 20.

I've fixed it on my system, but a web-search shows I'm not the only one to find it too close as it stands. Here, for example:

https://stackoverflow.com/questions/23820926

I think that some desktops add a border to popups and that there's probably a pixel or two of jitter, so that padding of 3 pixels often turns into a padding of no pixels — or a pixel or two of overlap.

boffi commented 5 years ago

Today, Sep 18 2019


$ grep 'padding =' .../qtconsole-4.5.4-py_0/site-packages/qtconsole/call_tip_widget.py
        padding = 3 # Distance in pixels between cursor bounds and tip box.
$ ```
ccordoba12 commented 5 years ago

As I said above, you're welcome to improve the situation.