When panel clock plugin is used with custom fonts, they aren't applied correclty on panel start due to conflict and race condition with qss theme. When settings are changed fonts are set correctly.
Using delayed initialisation this patch fixes the problem.
Custom font for clock plugin applied correctly
This doesn't look right... You're creating a copy of the timeLabel's font, and then you're immediately replacing with a new font from settings.
Also, why do you have the empty brace blocks?
font is not replaced. Its parts are actually used as default values when reading from settings. Settings can be empty, in this case font is not changed.
Empty brace blocks are here just to reuse variable font and use constructor initialisation instead of assignment, but since Qt uses COW it's not really necessary. I can rewrite it if you want.
Ok, I'll improve this part ASAP.
This doesn't fix it when theme is changed in the Appearance Configuration.
You should be able to use RazorSettings::globalSettings() to detect this.
Font set correctly on theme change
Now it reacts on theme change.
Merge branch 'panel-clock-font-fix' of git://github.com/kuzmas/razor-…
90% of the time
90% of the time
this is weird. As you can see, the plugin has special ClockLabel fakeThemedLabel object which detects font changes caused by theme change and then settings reapplied to real QLabels. Could you please debug it and find out where exactly it works not as expected, since it works fine all the time for me.
Expected sequence on theme change is:
1. Theme change causes 'ClockLabel::event' to be called with (event->type() == QEvent::FontChange)
2. it emits fontChanged() signal which in its turn raises RazorClock::fontChanged() slot
3. new font merged with custom font and applied to QLabels