You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm really impressed with this repository, particularly the animations. However, I've encountered a challenge when using the library. There doesn't seem to be a straightforward method for changing the colors of controls, such as the foreground font or background colors. This feature is particularly necessary when differentiating individual buttons among a group, where some buttons require color highlighting for emphasis.
My attempts to use the widget's palette and stylesheet, which are generally considered the standard approach, were unsuccessful. Further investigation into the source code revealed that the buttonBackgroundColor is governed by the theme in qlementinestyle. As I understand it, this theme isn't intended for frequent dynamic updates during the entire application session.
While I could follow the example in the source code and create a qproxystyle to modify the colors, ensuring that the corner radius remains consistent with qlementine, I find this solution rather cumbersome. Is there a simpler method to alter specific colors within the library?
The text was updated successfully, but these errors were encountered:
Qt's CSS is not supported by choice in Qlementine. When you define CSS on a QWidget, its style becomes QStylesheetStyle, which is painfully slow, buggy (it can't even draw clean rounded corners...) and complex, and can't do animations. I want to avoid that at all costs. This is the raison d'être of Qlementine.
Currently, the theming system is minimal on purpose. The goal is to avoid having a 3000-line CSS file as commonly seen in entreprise Qt projects. Also, a corollary is that it forces developers to use a simple design system instead of making lots of special cases and mixing style code and UI code.
Also, currently, proxy styles are not supported yet, since it adds a whole layer of complexity and could create many bugs in the developer's proxy style code. I would like to add this feature someday, though.
Here are 2 alternative solutions to your problem:
If you need to highlight a button among a group, have you thought about making it checked?
You can inherit QlementineStyle and override the methods that give the color. These methods act as kind of a proxy to the JSON theme. Set a dynamic QProperty on your button, and check if the value of that property in the method you're overidding, and return a specific color in that case. It won't break the animation system.
Hi, oclero,
I'm really impressed with this repository, particularly the animations. However, I've encountered a challenge when using the library. There doesn't seem to be a straightforward method for changing the colors of controls, such as the foreground font or background colors. This feature is particularly necessary when differentiating individual buttons among a group, where some buttons require color highlighting for emphasis.
My attempts to use the widget's palette and stylesheet, which are generally considered the standard approach, were unsuccessful. Further investigation into the source code revealed that the buttonBackgroundColor is governed by the theme in qlementinestyle. As I understand it, this theme isn't intended for frequent dynamic updates during the entire application session.
While I could follow the example in the source code and create a qproxystyle to modify the colors, ensuring that the corner radius remains consistent with qlementine, I find this solution rather cumbersome. Is there a simpler method to alter specific colors within the library?
The text was updated successfully, but these errors were encountered: