forked from qt-creator/qt-creator
QmlDesigner: Fix item library header
Title text of tab buttons no longer overlaps the plus sign. Fixes: QDS-3842 Change-Id: Iec51ebf00e6f719eac8b7204634ae8dc7696939a Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -66,25 +66,33 @@ Item {
|
|||||||
{title: qsTr("Assets"), addToolTip: qsTr("Add new assets to project.")}]
|
{title: qsTr("Assets"), addToolTip: qsTr("Add new assets to project.")}]
|
||||||
|
|
||||||
TabButton {
|
TabButton {
|
||||||
contentItem: Text { // TabButton text
|
topPadding: 4
|
||||||
text: modelData.title
|
bottomPadding: 4
|
||||||
font.pixelSize: 13
|
contentItem: Item {
|
||||||
font.bold: true
|
implicitHeight: plusButton.height
|
||||||
color: tabBar.currentIndex === index ? "#0094ce" : "#dadada"
|
|
||||||
anchors.bottomMargin: 2
|
|
||||||
horizontalAlignment: Text.AlignLeft
|
|
||||||
verticalAlignment: Text.AlignBottom
|
|
||||||
elide: Text.ElideRight
|
|
||||||
}
|
|
||||||
|
|
||||||
background: Item { // TabButton background
|
Text { // TabButton text
|
||||||
Rectangle { // + button
|
text: modelData.title
|
||||||
anchors.right: parent.right
|
font.pixelSize: 13
|
||||||
|
font.bold: true
|
||||||
|
color: tabBar.currentIndex === index ? "#0094ce" : "#dadada"
|
||||||
|
anchors.left: parent.left
|
||||||
|
anchors.top: parent.top
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
anchors.rightMargin: 2
|
anchors.right: plusButton.left
|
||||||
anchors.bottomMargin: 2
|
anchors.bottomMargin: 2
|
||||||
width: 25
|
horizontalAlignment: Text.AlignLeft
|
||||||
height: 25
|
verticalAlignment: Text.AlignBottom
|
||||||
|
elide: Text.ElideRight
|
||||||
|
}
|
||||||
|
|
||||||
|
Rectangle { // + button
|
||||||
|
id: plusButton
|
||||||
|
anchors.right: parent.right
|
||||||
|
anchors.top: parent.top
|
||||||
|
anchors.topMargin: 1
|
||||||
|
width: 24
|
||||||
|
height: 24
|
||||||
color: mouseArea.containsMouse ? "#353535" : "#262626"
|
color: mouseArea.containsMouse ? "#353535" : "#262626"
|
||||||
|
|
||||||
ToolTip.delay: 500
|
ToolTip.delay: 500
|
||||||
@@ -109,7 +117,9 @@ Item {
|
|||||||
: rootView.handleAddAsset()
|
: rootView.handleAddAsset()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
background: Item { // TabButton background
|
||||||
Rectangle { // bottom strip
|
Rectangle { // bottom strip
|
||||||
anchors.bottom: parent.bottom
|
anchors.bottom: parent.bottom
|
||||||
width: parent.width
|
width: parent.width
|
||||||
|
Reference in New Issue
Block a user