Commit df88a536 authored by Thomas Hartmann's avatar Thomas Hartmann
Browse files

QmlDesigner.itemLibrary: adept to qml syntax changes

parent e2f5a873
......@@ -81,10 +81,9 @@ Rectangle {
onItemSelected: itemsView.itemSelected(itemLibId)
onItemDragged: itemsView.itemDragged(itemLibId)
Connection {
sender: itemsView
signal: "expandAllEntries()"
script: section.expand()
Connections {
target: itemsView
onExpandAllEntries: section.expand();
}
}
}
......@@ -101,7 +100,7 @@ Rectangle {
clip: true
interactive: false
viewportHeight: col.height
contentHeight: col.height
Column {
id: col
......
......@@ -51,12 +51,12 @@ Item {
border.color: style.scrollbarBorderColor;
}
function moveHandle(viewportPos, updateFlickable) {
function moveHandle(contentPos, updateFlickable) {
handle.updateFlickable = updateFlickable
if (flickable)
handle.y = scrollHeight * Math.min(
viewportPos / (flickable.viewportHeight - flickable.height),
contentPos / (flickable.contentHeight - flickable.height),
1);
else
handle.y = 0;
......@@ -65,27 +65,24 @@ Item {
}
function updateHandle() {
moveHandle(flickable.viewportY, false);
moveHandle(flickable.contentY, false);
}
onFlickableChanged: moveHandle(0, true)
Connection {
sender: flickable
signal: "heightChanged"
script: moveHandle(0, true)
Connections {
target: flickable
onHeightChanged: moveHandle(0, true)
}
Connection {
sender: flickable
signal: "viewportHeightChanged"
script: updateHandle()
Connections {
target: flickable
onContentHeightChanged: updateHandle()
}
Connection {
sender: flickable
signal: "positionYChanged"
script: updateHandle()
Connections {
target: flickable
onContentYChanged: updateHandle()
}
onHeightChanged: updateHandle()
......@@ -105,13 +102,13 @@ Item {
anchors.leftMargin: 1
anchors.right: parent.right
// anchors.rightMargin: 1
height: Math.max(width, bar.height * Math.min(1, flickable.height / flickable.viewportHeight))
height: Math.max(width, bar.height * Math.min(1, flickable.height / flickable.contentHeight))
property bool updateFlickable: true
onYChanged: {
if (updateFlickable)
flickable.viewportY = Math.max(0, flickable.viewportHeight * y / bar.height)
flickable.contentY = Math.max(0, flickable.contentHeight * y / bar.height)
}
Rectangle {
......
......@@ -138,10 +138,9 @@ Column {
id: gridView
// workaround
Connection {
sender: itemLibraryModel
signal: "visibilityUpdated()"
script: gridView.positionViewAtIndex(0)
Connections {
target: itemLibraryModel
onVisibilityUpdated: gridView.positionViewAtIndex(0);
}
anchors.fill: parent
......
......@@ -50,10 +50,9 @@ Item {
x: (section && item)? (section.x + item.x + sectionXOffset):0;
y: (section && item)? (section.y + style.selectionSectionOffset + item.y + sectionYOffset):0;
Connection {
sender: itemLibraryModel
signal: "visibilityUpdated()"
script: unselect()
Connections {
target: itemLibraryModel
onVisibilityUpdated: unselect()
}
function select(section, item, sectionXOffset, sectionYOffset) {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment