falkTX / Cadence

Collection of tools useful for audio production
GNU General Public License v2.0
368 stars 80 forks source link

Tray icon hover popup formating issue #302

Closed AreYouLoco closed 3 years ago

AreYouLoco commented 3 years ago

When I hover the mouse over cadence icon some unformatted text is appearing as you can see on the screenshot attached. I think bug is minor but still a bug. Screenshot from 2020-09-16 14-55-51 I am using cadence version 5:0.9.1 from kxrepos on Debian Bullseye with MATE desktop.

vari-spec commented 3 years ago

Same issue on Manjaro KDE 20, looking at the code looks like it never runs as KDE version, just Qt. Word wrap is working on manjaro so it isn't as ugly as the above but it's still unformatted rich text. I played around and fixed it for myself by removing the rich text in cadence.py updateSystrayTooltip() function by using \n for linebreaks but can't figure out how to get the rich text to be read.

Marzal commented 3 years ago

Same issue on ArchLinux KDE 5.20.2 / 5.75.0 / QT 5.15.1

I also didn't have any luck getting rich text on the tooltip. I'm not sure if a QSystemTrayIcon can have it.

This is how I cleaned the html code/rich text: https://github.com/falkTX/Cadence/blob/a2e733abc9b6617fa00246334a1544e2795d1d1a/src/cadence.py#L1520

        systrayText  = "Cadence\n "
        systrayText += "%s: %s\n" % (self.tr("JACK Status"), self.label_jack_status.text())
        systrayText += "%s: %s\n" % (self.tr("Realtime"), self.label_jack_realtime.text())
        systrayText += "%s: %s\n" % (self.tr("DSP Load"), self.label_jack_dsp.text())
        systrayText += "%s: %s\n" % (self.tr("Xruns"), self.label_jack_xruns.text())
        systrayText += "%s: %s\n" % (self.tr("Buffer Size"), self.label_jack_bfsize.text())
        systrayText += "%s: %s\n" % (self.tr("Sample Rate"), self.label_jack_srate.text())
        systrayText += "%s: %s" % (self.tr("Block Latency"), self.label_jack_latency.text())
joan31 commented 3 years ago

Same probleme on Arch Linux :+1:

image

aekaisato commented 3 years ago

It looks like KDE removed HTML parsing due to a security risk, so it seems like the tray indicator will have to switch to being plaintext.

Sources: https://bugs.kde.org/show_bug.cgi?id=422616 https://invent.kde.org/frameworks/plasma-framework/-/merge_requests/6