moved width segment calculation within qml file