diff --git a/applets/kickoff/package/contents/ui/Header.qml b/applets/kickoff/package/contents/ui/Header.qml --- a/applets/kickoff/package/contents/ui/Header.qml +++ b/applets/kickoff/package/contents/ui/Header.qml @@ -16,12 +16,13 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -import QtQuick 2.0 +import QtQuick 2.4 import org.kde.plasma.core 2.0 as PlasmaCore import org.kde.plasma.components 2.0 as PlasmaComponents import org.kde.plasma.extras 2.0 as PlasmaExtras import org.kde.kcoreaddons 1.0 as KCoreAddons import org.kde.kquickcontrolsaddons 2.0 +import QtGraphicalEffects 1.0 Item { id: header @@ -52,11 +53,10 @@ } Image { - id: faceIcon + id: squareFace source: kuser.faceIconUrl cache: false - visible: source !== "" - + visible: false; width: units.gridUnit * 3 height: width @@ -73,21 +73,46 @@ } } + + + OpacityMask { + anchors.fill: squareFace + source: squareFace + // this Rectangle is a circle due to radius size + maskSource: Rectangle { + width: squareFace.width + height: squareFace.height + radius: height / 2 + visible: false + } + } + + // another round Rectangle to draw a circle around the icon + Rectangle { + width: squareFace.width + height: squareFace.height + anchors.fill: squareFace + color: "#00000000" + border.color: PlasmaCore.ColorScope.textColor + border.width: units.smallSpacing / 2 + radius: width / 2 + } + + PlasmaCore.IconItem { - source: "user-identity" - visible: faceIcon.status !== Image.Ready + source: squareFace width: units.gridUnit * 3 height: width anchors { - top: faceIcon.top - right: faceIcon.right + top: squareFace.top + right: squareFace.right rightMargin: -units.gridUnit/2 } usesPlasmaTheme: false } MouseArea { - anchors.fill: faceIcon + anchors.fill: squareFace acceptedButtons: Qt.LeftButton cursorShape: Qt.PointingHandCursor onClicked: { @@ -107,8 +132,8 @@ height: paintedHeight anchors { - left: faceIcon.right - top: faceIcon.top + left: squareFace.right + top: squareFace.top right: parent.right leftMargin: units.gridUnit rightMargin: units.gridUnit