Skip to content

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

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

Feature request: Add rich text support back #1164

Closed
stevenxxiu opened this issue Jan 7, 2023 · 3 comments
Closed

Feature request: Add rich text support back #1164

stevenxxiu opened this issue Jan 7, 2023 · 3 comments
Assignees
Labels
Suggestion Feature request or some other idea

Comments

@stevenxxiu
Copy link

stevenxxiu commented Jan 7, 2023

I see in https://github.com/albertlauncher/albert/blob/5694e94d02cd8c9a065b8bbdb5c1587b42c763d0/CHANGELOG.md that rich text support got removed.

This really reduces the expressiveness of a plugin.

For example, in my custom Arch Linux packages search plugin for the previous version of Albert Launcher. I added red text to indicate a package is out-of-date. The code I used was:

f'<font color="red">[Out of date: {date_text}]</font>

I also used italic text in some other plugins to deemphasize text.

Could this be added back for plugins, especially Python plugins?

@ManuelSchneid3r
Copy link
Member

I gave it a shot again, yesterday. Theres no easy solution to provide rich text and text elision. Also there is no solutoin on how to use the colors provided by the theme. I am not sure on how proceed with this one.

@stevenxxiu
Copy link
Author

stevenxxiu commented Jan 10, 2023

I don't know much about Qt. If this was HTML I'd just use CSS for both. I'm guessing you tried that already and Qt doesn't support CSS that well.

I tried to restore part of your previous code in plugins/widgetsboxmodel/src/resultslist.cpp to plugins/widgetsboxmodel/src/itemslist.cpp. That seemed to work for me, while ignoring text elision and theme colors.

If this isn't possible, will it be reasonable then for an option to choose to have rich text while ignoring text elision and theme colors?

@ManuelSchneid3r
Copy link
Member

I don't know much about Qt. If this was HTML I'd just use CSS for both. I'm guessing you tried that already and Qt doesn't support CSS that well.

it does somehow but it is cumbersome because it passes through QStyle which is not that trivial and not well documented. also its purpose lies somewhere else (platform look n feel).

If this isn't possible, will it be reasonable then for an option to choose to have rich text while ignoring text elision and theme colors?

not in an easy well generalizing way. iguess ill tinker with that in the future but for now plaintext is way more robust and "pretty" in the sense that is does not break the ui

Bierchermuesli pushed a commit to Bierchermuesli/albert-vscode that referenced this issue Feb 19, 2023
  - temporary removed rich html support due albertlauncher/albert#1164
@ManuelSchneid3r ManuelSchneid3r added the Suggestion Feature request or some other idea label Mar 29, 2023
@albertlauncher albertlauncher locked and limited conversation to collaborators Apr 24, 2023
@ManuelSchneid3r ManuelSchneid3r converted this issue into discussion #1225 Apr 24, 2023

This issue was moved to a discussion.

You can continue the conversation there. Go to discussion →

Labels
Suggestion Feature request or some other idea
Development

No branches or pull requests

2 participants