Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Notifications don't respect markup #122

Open
kanyck opened this issue Dec 20, 2021 · 13 comments
Open

Notifications don't respect markup #122

kanyck opened this issue Dec 20, 2021 · 13 comments

Comments

@kanyck
Copy link

kanyck commented Dec 20, 2021

While on mouse-over it renders just fine (on the dark gray background), change notifications are shown with tags (on the yellow background) as follows:
screenshot1
You can see <b> tags instead of bold font.

@dglent
Copy link
Owner

dglent commented Dec 20, 2021

I saw this in iceWM but not in LXQt
Which DE do you use ?
I'm afraid that is DE depended, but i try to workaround the (deactivate) rich html if the DE does not support them in notifications

@kanyck
Copy link
Author

kanyck commented Dec 20, 2021

No DE. Crafted handmade Compiz standalone + tint2)) No idea if it uses libnotify.

@kanyck
Copy link
Author

kanyck commented Dec 22, 2021

Tried to replace notification-daemon with dunst that supposed to accept html tags -- no difference. What do you use to show notifications?
UPD: my bad. Typing faster than thinking)) Notification position suggests that probably it's not notification-daemon who shows the notification.

@dglent
Copy link
Owner

dglent commented Dec 22, 2021

The notifications are shown by QSystemTrayIcon
After i suppose that QT communicate the message to the system's notifier.
I don't define if it will be in plain or rich text somewhere (i d'on't think that this is possible). So it is defined by the host tray (?)
I show that in icewm the notification bubble doesn't use rich text.
Probably some notification systems doesn't support rich formating, maybe is better to detect (by having a list of supported DE ... ?) and deactivated the html tags.

@kanyck
Copy link
Author

kanyck commented Dec 22, 2021

It looks like it works as supposed -- the spec states plain text for balloon:

void QSystemTrayIcon::showMessage(const QString &title, const QString &message, QSystemTrayIcon::MessageIcon icon = QSystemTrayIcon::Information, int millisecondsTimeoutHint = 10000)

Shows a balloon message for the entry with the given title, message and icon for the time specified in millisecondsTimeoutHint. title and message must be plain text strings.

@kanyck
Copy link
Author

kanyck commented Dec 22, 2021

@dglent
Copy link
Owner

dglent commented Dec 23, 2021

So it means that in order to use rich text everywhere it needs the usage of a widget which will be shown at the area of the tray icon.
This is interesting approach as the widget can contain whatever element, as the icon of the weather...
The rich text in balloons message of the system tray is managed by the DE, if i'm not wrong in LXQt is here: https://github.com/lxqt/lxqt-notificationd/blob/9b46ceee1222f119328aba20b94febc8b2bc0aa1/src/notification.cpp#L148

@kanyck
Copy link
Author

kanyck commented Dec 23, 2021

I may try to replace notification-daemon with lxqt-notification in a shout while. Will let you know about the result))

@kanyck
Copy link
Author

kanyck commented Dec 23, 2021

Well, it didn't help. Apparently meteo-qt don't use these daemons for notification.
(both lxqt-notificationd and notification-daemon do understand <b> tags, when I issue notify-send "Summary" "Notification <b>text</b>." I can see "text" in bold, but the form and placing of the balloon differ from meteo-qt shows).

@dglent
Copy link
Owner

dglent commented Dec 24, 2021

I found this:
https://code.woboq.org/qt5/qtbase/src/widgets/util/qsystemtrayicon.cpp.html#513
I understand that It depends in the config of qt and maybe in lxqt is configured differently (to support plain text), i 'll try to find if there is a specific configuration in the DE

@BeholdersEye
Copy link

Any progress here? The "<b>"...</b> tags in the notification are the only flaws I perceive with this software.

Seems to me the obvious solution is to remove the inline tags since:

  1. As kanyck mentioned, the spec says "title and message must be plain text strings".

  2. They are not serving their intended function: Making the text bold.

@dglent
Copy link
Owner

dglent commented Jun 11, 2024

I can add an option in the settings to disable the formatting.
I think that you reproduce it only in the notification with the Tomorrow here: https://github.com/dglent/meteo-qt/blob/acdd3efc6e91a466231fba7bc608b775afaa760a/meteo_qt/meteo_qt.py#L70C26-L70C30
right ?
Because the alerts don't work any more with the free openweathermap key
In this case, to not wait the evolution you can remove the tags manually (i don't know if you are comfortable or not to modify the code)

@dglent
Copy link
Owner

dglent commented Jun 26, 2024

Or if you use a translation version you can modify locally the translation file
Example for French language:
https://translate.lxqt-project.org/translate/dglent/meteo-qt/fr/?offset=1&q=tomorrow&sort_by=-priority%2Cposition&checksum=

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants