forked from qt-creator/qt-creator
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:
@@ -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
|
||||||
|
|
||||||
Image {
|
Row {
|
||||||
id: icon
|
id: row
|
||||||
source: "images/project.png"
|
spacing: 5
|
||||||
anchors.verticalCenter: projectNameText.verticalCenter
|
|
||||||
width: 16
|
Image {
|
||||||
height: 16
|
y: 3
|
||||||
|
source: "images/project.png"
|
||||||
|
}
|
||||||
|
|
||||||
|
Column {
|
||||||
|
id: text
|
||||||
|
|
||||||
|
LinkedText {
|
||||||
|
id: projectNameText
|
||||||
|
height: 20
|
||||||
|
font.underline: mouseArea.containsMouse
|
||||||
|
font.pixelSize: fonts.linkFont.pixelSize
|
||||||
|
enlargeMouseArea: false
|
||||||
|
}
|
||||||
|
NativeText {
|
||||||
|
id: pathText
|
||||||
|
height: 20
|
||||||
|
color: "#6b6b6b"
|
||||||
|
font: fonts.smallPath
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
LinkedText {
|
MouseArea {
|
||||||
id: projectNameText
|
id: mouseArea
|
||||||
y: 2
|
anchors.fill: parent
|
||||||
anchors.left: parent.left
|
hoverEnabled: true
|
||||||
anchors.leftMargin: 5 + icon.width
|
cursorShape: Qt.PointingHandCursor
|
||||||
|
onClicked: projectWelcomePage.requestProject(filePath);
|
||||||
onClicked: projectWelcomePage.requestProject(filePath)
|
|
||||||
}
|
|
||||||
|
|
||||||
NativeText {
|
|
||||||
id: pathText
|
|
||||||
y: 18
|
|
||||||
color: "#6b6b6b"
|
|
||||||
|
|
||||||
anchors.left: parent.left
|
|
||||||
anchors.leftMargin: projectNameText.anchors.leftMargin
|
|
||||||
font: fonts.smallPath
|
|
||||||
MouseArea {
|
|
||||||
anchors.fill: parent
|
|
||||||
hoverEnabled: true
|
|
||||||
onEntered: {
|
|
||||||
toolTip.show();
|
|
||||||
}
|
|
||||||
onExited: {
|
|
||||||
toolTip.hide()
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
ToolTip {
|
|
||||||
x: 10
|
|
||||||
y: 20
|
|
||||||
id: toolTip
|
|
||||||
text: pathText.text
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -45,7 +45,6 @@ Rectangle {
|
|||||||
|
|
||||||
Column {
|
Column {
|
||||||
id: column
|
id: column
|
||||||
spacing: 6
|
|
||||||
|
|
||||||
Repeater {
|
Repeater {
|
||||||
id: repeater
|
id: repeater
|
||||||
|
Reference in New Issue
Block a user