[prev in list] [next in list] [prev in thread] [next in thread] 

List:       pykde
Subject:    Re: Linux Mint Cinnamon - tooltip font color bug
From:       Matic Kukovec <kukovecmatic () hotmail ! com>
Date:       2023-08-23 22:22:00
Message-ID: VE1PR09MB32806180DB527115F590597DD71CA () VE1PR09MB3280 ! eurprd09 ! prod ! outlook ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]

[Attachment #4 (text/plain)]

Excellent, that works perfectly, thanks Maurizio πŸ‘

Best regards
Matic
________________________________
From: Maurizio Berti <maurizio.berti@gmail.com>
Sent: Wednesday, August 23, 2023 11:47 PM
To: Matic Kukovec <kukovecmatic@hotmail.com>
Cc: PyQt@riverbankcomputing.com <pyqt@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@hotmail.com<mailto:kukovecmatic@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


[Attachment #5 (text/html)]

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} \
</style> </head>
<body dir="ltr">
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);" class="elementToProof"> Excellent, that works perfectly, thanks \
Maurizio πŸ‘</div> <div style="font-family: Calibri, Helvetica, sans-serif; \
font-size: 12pt; color: rgb(0, 0, 0);" class="elementToProof"> <br>
</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);" class="elementToProof"> Best regards</div>
<div style="font-family: Calibri, Helvetica, sans-serif; font-size: 12pt; color: \
rgb(0, 0, 0);" class="elementToProof"> Matic<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" \
style="font-size:11pt" color="#000000"><b>From:</b> Maurizio Berti \
&lt;maurizio.berti@gmail.com&gt;<br> <b>Sent:</b> Wednesday, August 23, 2023 11:47 \
PM<br> <b>To:</b> Matic Kukovec &lt;kukovecmatic@hotmail.com&gt;<br>
<b>Cc:</b> PyQt@riverbankcomputing.com &lt;pyqt@riverbankcomputing.com&gt;<br>
<b>Subject:</b> Re: Linux Mint Cinnamon - tooltip font color bug</font>
<div>&nbsp;</div>
</div>
<div>
<div dir="ltr">Try to see if it works if you set a custom palette for QToolTip with \
the ToolTipText role set (and maybe other text roles) <b>without</b>&nbsp;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. <div><br>
</div>
<div><font face="monospace">tipPalette = app.palette()<br>
tipPalette.setColor(QPalette.ColorRole.ToolTipText, QColor('red'))</font></div>
<div><font face="monospace">QToolTip.setPalette(tipPalette)</font></div>
<div><br>
</div>
<div>Ensure that you're not setting the color property for generic selectors (like
<font face="monospace">'QWidget { ... }'</font>)</div>
<div>
<div><br>
</div>
<div>Maurizio</div>
</div>
</div>
<br>
<div class="x_gmail_quote">
<div dir="ltr" class="x_gmail_attr">Il giorno lun 21 ago 2023 alle ore 09:29 Matic \
Kukovec &lt;<a href="mailto:kukovecmatic@hotmail.com">kukovecmatic@hotmail.com</a>&gt; \
ha scritto:<br> </div>
<blockquote class="x_gmail_quote" style="margin:0px 0px 0px 0.8ex; border-left:1px \
solid rgb(204,204,204); padding-left:1ex"> <div class="x_msg6159829305205760992">
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)"> Hi,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)"> <br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)"> Specs:</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)"> <ul>
<li style="list-style-type:disc">Linux Mint 21.2 - Cinnamon desktop</li><li \
style="list-style-type:disc">Python 3.10</li><li style="list-style-type:disc">PyQt \
6.5.1</li></ul> <div>Note: this is an issue exclusive to Linux Mint Cinnamon.<br>
</div>
<div>When setting a custom stylesheet for QTooltip, the application does not respect \
the font. Example:</div> <blockquote style="margin-top:0px; margin-bottom:0px">
<div>The global stylesheet is:</div>
<div>&quot;&quot;&quot;</div>
<div>...</div>
<div><br>
</div>
<div>QTooltip {</div>
<div><span>      </span>background: red;</div>
<div><span>      </span>color: white;</div>
<div><span>      </span>border: white;<br>
</div>
<div>}</div>
<div><br>
</div>
<div>...<br>
</div>
<div>&quot;&quot;&quot;</div>
<div>and the tooltips look like this:</div>
<div><img size="71154" style="max-width:100%" data-outlook-trace="F:1|T:1" \
src="cid:18a245577b4cb971f161"></div> <div>The font is black, but it should be \
white!<br> </div>
</blockquote>
<div><br>
</div>
<div>This is probably a Qt issue, because if the QTooltip style is removed from the \
stylesheet and default<br> </div>
<div>OS&nbsp;stylesheets are used, they have the same problem as reported by this \
user:<br> </div>
<div><a href="https://github.com/linuxmint/cinnamon/issues/11820" \
id="x_m_6159829305205760992LPNoLPOWALinkPreview" \
target="_blank">https://github.com/linuxmint/cinnamon/issues/11820</a> (the first \
post)<br> </div>
<div><br>
</div>
<div>Is there a way to circumvent this in PyQt6 until this is fixed?</div>
<div><br>
</div>
<div>Thanks</div>
<div>Matic<br>
</div>
<div>
<div></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; \
color:rgb(0,0,0)"> <br>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
<br clear="all">
<div><br>
</div>
<span class="x_gmail_signature_prefix">-- </span><br>
<div dir="ltr" class="x_gmail_signature">È difficile avere una convinzione precisa \
quando si parla delle ragioni del cuore. - &quot;Sostiene Pereira&quot;, Antonio \
Tabucchi<br> <a href="http://www.jidesk.net" \
target="_blank">http://www.jidesk.net</a></div> </div>
</body>
</html>


["image.png" (image/png)]

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic