forked from qt-creator/qt-creator
QmlDesigner: Improve Welcome screen scollbar
- scroll bar only visible when needed - change color when active - remove useless stuff - remove 3 warnings Change-Id: I0fbab4ca574c060f85adb0d5b6b54381337a7eae Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
@@ -35,23 +35,20 @@ Controls.ScrollBar {
|
|||||||
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
implicitHeight: Math.max(implicitBackgroundHeight + topInset + bottomInset,
|
||||||
implicitContentHeight + topPadding + bottomPadding)
|
implicitContentHeight + topPadding + bottomPadding)
|
||||||
|
|
||||||
padding: control.interactive ? 1 : 2
|
padding: active ? 1 : 2
|
||||||
visible: control.policy !== Controls.ScrollBar.AlwaysOff
|
visible: orientation === Qt.Horizontal ? contentWidth > width : contentHeight > height
|
||||||
minimumSize: orientation == Qt.Horizontal ? height / width : width / height
|
minimumSize: orientation === Qt.Horizontal ? height / width : width / height
|
||||||
|
|
||||||
contentItem: Rectangle {
|
contentItem: Rectangle {
|
||||||
implicitWidth: 13
|
implicitWidth: 13
|
||||||
implicitHeight: 13
|
implicitHeight: 13
|
||||||
|
color: active ? Constants.textHoverColor : Constants.textDefaultColor
|
||||||
color: Constants.textDefaultColor
|
|
||||||
}
|
}
|
||||||
|
|
||||||
background: Rectangle {
|
background: Rectangle {
|
||||||
implicitWidth: 16
|
implicitWidth: 16
|
||||||
implicitHeight: 16
|
implicitHeight: 16
|
||||||
color: "#2d2e30"
|
color: "#3b3c3d"
|
||||||
visible: control.interactive
|
visible: active
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -33,10 +33,5 @@ Controls.ScrollView {
|
|||||||
x: control.mirrored ? 0 : control.width - width
|
x: control.mirrored ? 0 : control.width - width
|
||||||
y: control.topPadding
|
y: control.topPadding
|
||||||
height: control.availableHeight
|
height: control.availableHeight
|
||||||
active: control.ScrollBar.horizontal.active
|
|
||||||
}
|
|
||||||
|
|
||||||
Controls.ScrollBar.horizontal: CustomScrollBar {
|
|
||||||
visible: false
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user