View Single Post
Posts: 34 | Thanked: 30 times | Joined on Nov 2011
#69
Originally Posted by coderus View Post
if you want to detect color scheme change then bind it to property and watch onPropertyChanged
I needed reaction of ambience change to do stuff I need it to do (change some colors based on if the ambience is actually dark or light, because buttons and text to buttons were based on that), If I will do it by binding, it would probably be a little bit less needy for system resources (don't do it everytime, do it only if this changes), so good point

EDIT: works!
Code:
    property real themeType: Theme.colorScheme

    onThemeTypeChanged: console.log ("AmbienceChange");

Last edited by bobsikus; 2020-01-10 at 09:40.
 

The Following 2 Users Say Thank You to bobsikus For This Useful Post: