Code review comment for lp:~pkunal-parmar/ubuntu-calendar-app/yearview_fix

Revision history for this message
Olivier Tilloy (osomon) wrote :

46 + property bool shouldCreateHighlight: date.isSameDay(DateExt.today()) && isCurrentMonth
47 +
48 + onShouldCreateHighlightChanged: {
49 + if( shouldCreateHighlight ) {
50 + highlightLoader.sourceComponent = highLightComp;
51 + } else {
52 + //unloading the highlight
53 + highlightLoader.sourceComponent = undefined
54 + }
55 + }

This is better, but it can be taken one step further to make it fully declarative: remove entirely the shouldCreateHighlight property, and do this:

    Loader {
        sourceComponent: date.isSameDay(DateExt.today()) && isCurrentMonth ? highLightComp : undefined
        […]
    }

(and you can then remove the 'highlightLoader' id which will be unused).

review: Needs Fixing

« Back to merge proposal