WelcomeScreen: Improve hovering of recent project items

No gaps inbetween the items. The whole area is click-sensitive.

Change-Id: I269e657ef8940387d9844baf17741c1cb3a50dd9
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Alessandro Portale
2014-10-10 13:31:14 +02:00
parent cd90ddad55
commit 9d58d44941
2 changed files with 35 additions and 45 deletions

View File

@@ -31,60 +31,51 @@ import QtQuick 2.1
Item { Item {
id: projectItem id: projectItem
width: childrenRect.width width: row.width + 8
height: 32 height: text.height
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent
anchors.margins: -4
color: "#f9f9f9" color: "#f9f9f9"
opacity: projectNameText.hovered ? 1 : 0 visible: mouseArea.containsMouse
} }
property alias projectName: projectNameText.text property alias projectName: projectNameText.text
property alias projectPath: pathText.text property alias projectPath: pathText.text
Row {
id: row
spacing: 5
Image { Image {
id: icon y: 3
source: "images/project.png" source: "images/project.png"
anchors.verticalCenter: projectNameText.verticalCenter
width: 16
height: 16
} }
Column {
id: text
LinkedText { LinkedText {
id: projectNameText id: projectNameText
y: 2 height: 20
anchors.left: parent.left font.underline: mouseArea.containsMouse
anchors.leftMargin: 5 + icon.width font.pixelSize: fonts.linkFont.pixelSize
enlargeMouseArea: false
onClicked: projectWelcomePage.requestProject(filePath)
} }
NativeText { NativeText {
id: pathText id: pathText
y: 18 height: 20
color: "#6b6b6b" color: "#6b6b6b"
anchors.left: parent.left
anchors.leftMargin: projectNameText.anchors.leftMargin
font: fonts.smallPath font: fonts.smallPath
}
}
}
MouseArea { MouseArea {
id: mouseArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
onEntered: { cursorShape: Qt.PointingHandCursor
toolTip.show(); onClicked: projectWelcomePage.requestProject(filePath);
}
onExited: {
toolTip.hide()
}
}
ToolTip {
x: 10
y: 20
id: toolTip
text: pathText.text
}
} }
} }

View File

@@ -45,7 +45,6 @@ Rectangle {
Column { Column {
id: column id: column
spacing: 6
Repeater { Repeater {
id: repeater id: repeater