Repository: spyder-ide/spyder

Issue:
Menu text covered by icon(s)
<!--- **PLEASE READ:** When submitting here, please ensure you've completed the following checklist and checked the boxes to confirm. Issue reports without it may be closed. Thanks! --->

### Issue Report Checklist

* [ ] Searched the [issues page](https://github.com/spyder-ide/spyder/issues?q=is%3Aissue) for similar reports
* [ ] Read the relevant sections of the [Spyder Troubleshooting Guide](https://github.com/spyder-ide/spyder/wiki/Troubleshooting-Guide-and-FAQ) and followed its advice
* [ ] Reproduced the issue after updating with ``conda update spyder`` (or ``pip``, if not using Anaconda)
* [ ] Could not reproduce inside ``jupyter qtconsole`` (if console-related)
* [ ] Tried basic troubleshooting (if a bug/error)
    * [ ] Restarted Spyder
    * [ ] Reset preferences with ``spyder --reset``
    * [ ] Reinstalled the latest version of [Anaconda](https://www.anaconda.com/download/)
    * [ ] Tried the other applicable steps from the Troubleshooting Guide
* [ ] Completed the **Problem Description**, **Steps to Reproduce** and **Version** sections below


## Problem Description
As shown the attached screenshot, when I opened the help menu, I found the text are covered by some icons(?).



### What steps reproduce the problem?

1. Launch spyder.
2. click "Help" menu (or any of other menu)
![spyder5](https://user-images.githubusercontent.com/49961658/113600564-d35ca880-9605-11eb-920d-ff7009a420be.png)
.
3. 

### What is the expected output? What do you see instead?
the icons(s) and the text are not sitting together.


### Paste Traceback/Error Below (if applicable)
<!--- Copy from error dialog or View > Panes > Internal Console --->


```python-traceback

>>> QTextCursor::setPosition: Position '-1' out of range
QTextCursor::setPosition: Position '-1' out of range


when I launched spyder, I also got the following message:
"
No QCoreApplication instance found. Application patches not applied. You have to call load_stylesheet function after instantiation of QApplication to take effect. 
"

There was not such messages if I launched spyder version 4.2.5

## Versions
<!--- You can get this information from Help > About Spyder...
or (if Spyder won't launch) the "conda list" command
from the Anaconda Prompt/Terminal/command line. --->

* Spyder version: 5.0.0
* Python version: 3.8.8 64-bit
* Qt version: Qt 5.9.7
* PyQt version: PyQt5 5.9.2
* Operating System name/version: Linux 3.10.0-693.17.1.el7.x86_64 

### Dependencies
<!--- Please go to the menu entry Help > Dependencies,
press the Copy to clipboard button and paste below --->

```

# Mandatory:
atomicwrites >=1.2.0          :  1.4.0 (OK)
chardet >=2.0.0               :  4.0.0 (OK)
cloudpickle >=0.5.0           :  1.6.0 (OK)
cookiecutter >=1.6.0          :  1.7.2 (OK)
diff_match_patch >=20181111   :  20200713 (OK)
intervaltree >=3.0.2          :  3.1.0 (OK)
IPython >=7.6.0               :  7.22.0 (OK)
jedi =0.17.2                  :  0.17.2 (OK)
jsonschema >=3.2.0            :  3.2.0 (OK)
keyring >=17.0.0              :  22.3.0 (OK)
nbconvert >=4.0               :  6.0.7 (OK)
numpydoc >=0.6.0              :  1.1.0 (OK)
parso =0.7.0                  :  0.7.0 (OK)
pexpect >=4.4.0               :  4.8.0 (OK)
pickleshare >=0.4             :  0.7.5 (OK)
psutil >=5.3                  :  5.8.0 (OK)
pygments >=2.0                :  2.8.1 (OK)
pylint >=1.0                  :  2.7.4 (OK)
pyls >=0.36.2;<1.0.0          :  0.36.2 (OK)
pyls_black >=0.4.6            :  0.4.6 (OK)
pyls_spyder >=0.3.2           :  0.3.2 (OK)
qdarkstyle =3.0.2             :  3.0.2 (OK)
qstylizer >=0.1.10            :  0.1.10 (OK)
qtawesome >=0.5.7             :  1.0.2 (OK)
qtconsole >=5.0.3             :  5.0.3 (OK)
qtpy >=1.5.0                  :  1.9.0 (OK)
rtree >=0.8.3                 :  None (NOK)
setuptools >=39.0.0           :  52.0.0.post20210125 (OK)
sphinx >=0.6.6                :  3.5.3 (OK)
spyder_kernels >=2.0.1;<2.1.0 :  2.0.1 (OK)
textdistance >=4.2.0          :  4.2.1 (OK)
three_merge >=0.1.1           :  0.1.1 (OK)
watchdog >=0.10.3;<2.0.0      :  1.0.2 (OK)
xdg >=0.26                    :  0.27 (OK)
zmq >=17                      :  20.0.0 (OK)

# Optional:
cython >=0.21                 :  0.29.22 (OK)
matplotlib >=2.0.0            :  3.3.4 (OK)
numpy >=1.7                   :  1.19.2 (OK)
pandas >=1.1.1                :  1.2.3 (OK)
scipy >=0.17.0                :  1.6.2 (OK)
sympy >=0.7.3                 :  1.7.1 (OK)
```



Discussion:
Hi @sweettyler,

Can you please let me know what size of screen are you working on?
@steff456 I am using an external monitor, which is 24" with resolution 3824x2160 (https://www.lg.com/us/monitors/lg-24UD58-B-4k-uhd-led-monitor).

There is a correction to what I have reported: I also checked with Spyder 4.2.5, it has the same issue. So it is not only with Spyder 5.0.0.

This might be related with the screen resolution etc. 

Resolving patch:
diff --git a/spyder/utils/stylesheet.py b/spyder/utils/stylesheet.py
--- a/spyder/utils/stylesheet.py
+++ b/spyder/utils/stylesheet.py
@@ -14,11 +14,15 @@
 import qdarkstyle
 import qstylizer
 from qstylizer.parser import parse as parse_stylesheet
+from qtpy import PYQT_VERSION
 
 # Local imports
 from spyder.utils.palette import QStylePalette
+from spyder.utils import programs
 
 
+OLD_PYQT = programs.check_version(PYQT_VERSION, "5.12", "<")
+
 # =============================================================================
 # ---- Base stylesheet class
 # =============================================================================
@@ -132,7 +136,7 @@ def _customize_stylesheet(self):
             # iconSize='0.8em'
         )
 
-        if sys.platform == 'darwin':
+        if OLD_PYQT:
             css["QMenu::item"].setValues(
                 padding='4px 24px 4px 28px',
             )


Test patch: