forked from qt-creator/qt-creator
QmlProfiler: Reduce code duplication and add more anchoring
Anchors are supposed to reduce graphical glitches such as the gradient borders getting detached from the edges of the timeline while resizing. I'm not sure if it's actually better like this, but the code certainly looks nicer. Change-Id: I9eb6a6a50780ce642ad7cb551d2895a80b00690e Reviewed-by: Kai Koehne <kai.koehne@digia.com>
This commit is contained in:
@@ -435,22 +435,12 @@ Rectangle {
|
||||
}
|
||||
|
||||
// Gradient borders
|
||||
Item {
|
||||
VerticalGradientBorder {
|
||||
anchors.left: labels.right
|
||||
anchors.top: labels.top
|
||||
anchors.bottom: labelsTail.bottom
|
||||
width: 6
|
||||
Rectangle {
|
||||
x: parent.width
|
||||
transformOrigin: Item.TopLeft
|
||||
rotation: 90
|
||||
width: parent.height
|
||||
height: parent.width
|
||||
gradient: Gradient {
|
||||
GradientStop { position: 0.0; color: "#00000000"; }
|
||||
GradientStop { position: 1.0; color: "#86000000"; }
|
||||
}
|
||||
}
|
||||
leftColor: "#00000000"
|
||||
rightColor: "#86000000"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -526,32 +516,19 @@ Rectangle {
|
||||
}
|
||||
}
|
||||
|
||||
Item {
|
||||
VerticalGradientBorder {
|
||||
anchors.right: root.right
|
||||
width: 6
|
||||
anchors.top: root.top
|
||||
anchors.bottom: root.bottom
|
||||
Rectangle {
|
||||
x: parent.width
|
||||
transformOrigin: Item.TopLeft
|
||||
rotation: 90
|
||||
width: parent.height
|
||||
height: parent.width
|
||||
gradient: Gradient {
|
||||
GradientStop { position: 0.0; color: "#86000000"; }
|
||||
GradientStop { position: 1.0; color: "#00000000"; }
|
||||
}
|
||||
}
|
||||
rightColor: "#00000000"
|
||||
leftColor: "#86000000"
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
y: root.height - height
|
||||
height: 6
|
||||
width: root.width
|
||||
x: 0
|
||||
gradient: Gradient {
|
||||
GradientStop { position: 0.0; color: "#00000000"; }
|
||||
GradientStop { position: 1.0; color: "#86000000"; }
|
||||
}
|
||||
HorizontalGradientBorder {
|
||||
anchors.bottom: root.bottom
|
||||
anchors.left: root.left
|
||||
anchors.right: root.right
|
||||
bottomColor: "#00000000"
|
||||
topColor: "#86000000"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user