← Back to team overview

ubuntu-touch-coreapps-reviewers team mailing list archive

Re: [Merge] lp:~renatofilho/ubuntu-calendar-app/optimize into lp:ubuntu-calendar-app

 

Review: Needs Information

added inline comment

Diff comments:

> 
> === modified file 'MonthComponentDateDelegate.qml'
> --- MonthComponentDateDelegate.qml	2015-09-05 05:30:23 +0000
> +++ MonthComponentDateDelegate.qml	2016-01-12 18:02:54 +0000
> @@ -9,20 +9,21 @@
>      property bool isToday;
>      property bool showEvent;
>      property alias fontSize: dateLabel.font.pixelSize
> -
>      property bool isSelected: false
>  
> -    Loader {
> -        sourceComponent: (isToday && isCurrentMonth) || isSelected ? highLightComp : undefined
> +    UbuntuShape{

I don't know now how heavy UbuntuShape component is, but this will create UbuntuShape for every date displayed on month and year. Which occupies memory unnecessarily. If Loader is not suitable here then we should just use dynamically to create UbuntuShape when needed.

> +        visible: (isToday && isCurrentMonth) || isSelected
> +        color: isToday && !isSelected ? "#DD4814" : "gray"
>  
> -        onSourceComponentChanged: {
> -            width = Qt.binding( function() {
> -                var width = dateRootItem.height > dateRootItem.width ? dateRootItem.width :dateRootItem.height
> -                return ( width / 1.3 );
> -            });
> -            height = Qt.binding ( function() { return width} );
> -            anchors.centerIn = Qt.binding( function() { return dateLabel});
> +        Rectangle{
> +            anchors.fill: parent
> +            anchors.margins: units.gu(0.5)
> +            color: isToday ? "#DD4814" : "darkgray"
>          }
> +
> +        width: Math.min(parent.height, parent.width) / 1.3
> +        height: width
> +        anchors.centerIn: dateLabel
>      }
>  
>      Label {
> @@ -47,46 +48,19 @@
>          }
>      }
>  
> -    Loader{
> -        sourceComponent: showEvent ? eventIndicatorComp : undefined
> -        onSourceComponentChanged: {
> -            width = Qt.binding( function() { return units.gu(0.8)})
> -            height = Qt.binding( function() { return width })
> -            anchors.horizontalCenter = Qt.binding( function() { return  parent.horizontalCenter })
> -            anchors.top = Qt.binding( function() { return parent.verticalCenter })
> -            anchors.topMargin = Qt.binding( function() {
> -                var w = (dateRootItem.height > dateRootItem.width ? dateRootItem.width :dateRootItem.height)/1.3
> -                return (w/2) + units.gu(0.1)
> -            });
> -        }
> -    }
> -
> -    Component{
> -        id: eventIndicatorComp
> -        Rectangle {
> -            anchors.fill: parent
> -            radius: height/2
> -            color: "black"
> -        }
> -    }
> -
> -    Component{
> -        id: highLightComp
> -        UbuntuShape{
> -            color: {
> -                if( isToday && !isSelected ) {
> -                    "#DD4814"
> -                } else {
> -                    "gray"
> -                }
> -            }
> -
> -            Rectangle{
> -                anchors.fill: parent
> -                anchors.margins: units.gu(0.5)
> -                color: isToday ? "#DD4814" : "darkgray"
> -            }
> -        }
> +    Rectangle {

Same comment as for Highlight visual

> +        id: eventIndicator
> +
> +        width: units.gu(0.8)
> +        height: width
> +        anchors {
> +            horizontalCenter: parent.horizontalCenter
> +            top: parent.verticalCenter
> +            topMargin: ((Math.min(parent.height, dateRootItem.width) / 1.3) / 2) + units.gu(0.1)
> +        }
> +        radius: height/2
> +        color:"black"
> +        visible: showEvent
>      }
>  
>      MouseArea {


-- 
https://code.launchpad.net/~renatofilho/ubuntu-calendar-app/optimize/+merge/254398
Your team Ubuntu Calendar Developers is subscribed to branch lp:ubuntu-calendar-app.


References