Linux Mint Cinnamon - tooltip font color bug

Matic Kukovec kukovecmatic at hotmail.com
Wed Aug 23 23:22:00 BST 2023


Excellent, that works perfectly, thanks Maurizio 👍

Best regards
Matic
________________________________
From: Maurizio Berti <maurizio.berti at gmail.com>
Sent: Wednesday, August 23, 2023 11:47 PM
To: Matic Kukovec <kukovecmatic at hotmail.com>
Cc: PyQt at riverbankcomputing.com <pyqt at riverbankcomputing.com>
Subject: Re: Linux Mint Cinnamon - tooltip font color bug

Try to see if it works if you set a custom palette for QToolTip with the ToolTipText role set (and maybe other text roles) without setting the color property in the stylesheet. If it does work, then add some sort of checking for OS, style (I assume that cinnamon uses a custom style, possibly with a valid object name) and OS version so that you could eventually fix that specific target, if you want.

tipPalette = app.palette()
tipPalette.setColor(QPalette.ColorRole.ToolTipText, QColor('red'))
QToolTip.setPalette(tipPalette)

Ensure that you're not setting the color property for generic selectors (like 'QWidget { ... }')

Maurizio

Il giorno lun 21 ago 2023 alle ore 09:29 Matic Kukovec <kukovecmatic at hotmail.com<mailto:kukovecmatic at hotmail.com>> ha scritto:
Hi,

Specs:

  *   Linux Mint 21.2 - Cinnamon desktop
  *   Python 3.10
  *   PyQt 6.5.1

Note: this is an issue exclusive to Linux Mint Cinnamon.
When setting a custom stylesheet for QTooltip, the application does not respect the font. Example:
The global stylesheet is:
"""
...

QTooltip {
      background: red;
      color: white;
      border: white;
}

...
"""
and the tooltips look like this:
[cid:18a245577b4cb971f161]
The font is black, but it should be white!

This is probably a Qt issue, because if the QTooltip style is removed from the stylesheet and default
OS stylesheets are used, they have the same problem as reported by this user:
https://github.com/linuxmint/cinnamon/issues/11820 (the first post)

Is there a way to circumvent this in PyQt6 until this is fixed?

Thanks
Matic



--
È difficile avere una convinzione precisa quando si parla delle ragioni del cuore. - "Sostiene Pereira", Antonio Tabucchi
http://www.jidesk.net
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20230823/3aad5f61/attachment-0001.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 71154 bytes
Desc: image.png
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20230823/3aad5f61/attachment-0001.png>


More information about the PyQt mailing list