Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Port to new connections syntax #5

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/controls/FormLayout.qml
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,7 @@ Item {
Component.onCompleted: item.x = x + lay.x;
Connections {
target: lay
onXChanged: item.x = x + lay.x;
function onXChanged(x) { item.x = x + lay.x }
}
}
}
Expand Down
4 changes: 2 additions & 2 deletions src/controls/PagePoolAction.qml
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ Kirigami.Action {
Connections {
target: pageStack

onCurrentItemChanged: {
function onCurrentItemChanged() {
if (root.useLayers) {
if (root.layerContainsPage()) {
_private.clearLayers()
Expand All @@ -192,7 +192,7 @@ Kirigami.Action {
enabled: pageStack.hasOwnProperty("layers")
target: pageStack.layers

onCurrentItemChanged: {
function onCurrentItemChanged() {
if (root.useLayers && root.checkable) {
_private.setChecked(root.layerContainsPage());

Expand Down
4 changes: 2 additions & 2 deletions src/controls/private/ActionButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -200,15 +200,15 @@ Item {
}
Connections {
target: root.hasGlobalDrawer ? globalDrawer : null
onPositionChanged: {
function onPositionChanged() {
if ( globalDrawer && globalDrawer.modal && !mouseArea.pressed && !edgeMouseArea.pressed && !fakeContextMenuButton.pressed) {
button.x = globalDrawer.contentItem.width * globalDrawer.position + root.width/2 - button.width/2;
}
}
}
Connections {
target: root.hasContextDrawer ? contextDrawer : null
onPositionChanged: {
function onPositionChanged() {
if (contextDrawer && contextDrawer.modal && !mouseArea.pressed && !edgeMouseArea.pressed && !fakeContextMenuButton.pressed) {
button.x = root.width/2 - button.width/2 - contextDrawer.contentItem.width * contextDrawer.position;
}
Expand Down
2 changes: 1 addition & 1 deletion src/controls/private/RefreshableScrollView.qml
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ P.ScrollView {
Connections {
enabled: typeof applicationWindow !== "undefined"
target: typeof applicationWindow !== "undefined" ? applicationWindow() : null
onReachableModeChanged: {
function onReachableModeChanged() {
overshootResetTimer.running = applicationWindow().reachableMode;
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/controls/private/globaltoolbar/BreadcrumbControl.qml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Flickable {

Connections {
target: pageRow
onCurrentIndexChanged: {
function onCurrentIndexChanged() {
var currentItem = mainLayout.children[pageRow.currentIndex];
listScrollAnim.running = false
listScrollAnim.from = root.contentX;
Expand Down
10 changes: 5 additions & 5 deletions src/controls/templates/AbstractApplicationHeader.qml
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ Item {
}
Connections {
target: __appWindow
onControlsVisibleChanged: {
function onControlsVisibleChanged() {
heightAnim.from = root.implicitHeight
heightAnim.to = __appWindow.controlsVisible ? root.preferredHeight : 0;
heightAnim.restart();
Expand All @@ -102,7 +102,7 @@ Item {
Connections {
target: root.page ? root.page.globalToolBarItem : null
enabled: headerSlideConnection.passive && target
onImplicitHeightChanged: root.implicitHeight = root.page.globalToolBarItem.implicitHeight
function onImplicitHeightChanged() { root.implicitHeight = root.page.globalToolBarItem.implicitHeight }
}

Connections {
Expand All @@ -116,7 +116,7 @@ Item {
//A better solution is needed
readonly property bool passive: root.pageRow && parent.parent == root.pageRow && root.pageRow.globalToolBar.actualStyle !== ApplicationHeaderStyle.TabBar && root.pageRow.globalToolBar.actualStyle != ApplicationHeaderStyle.Breadcrumb

onContentYChanged: {
function onContentYChanged() {
if(root.page && root.page.flickable && root.page.flickable.contentHeight < root.page.height) {
return
}
Expand All @@ -137,7 +137,7 @@ Item {
}
}

onMovementEnded: {
function onMovementEnded() {
if ((root.pageRow ? root.pageRow.wideMode : (__appWindow && __appWindow.wideScreen)) || !Settings.isMobile) {
return;
}
Expand All @@ -152,7 +152,7 @@ Item {
}
Connections {
target: pageRow
onCurrentItemChanged: {
function onCurrentItemChanged() {
if (!root.page) {
return;
}
Expand Down
6 changes: 3 additions & 3 deletions src/controls/templates/ApplicationHeader.qml
Original file line number Diff line number Diff line change
Expand Up @@ -350,8 +350,8 @@ AbstractApplicationHeader {
width: parent.width - x

Connections {
target: delegateLoader.page
Component.onDestruction: delegateLoader.sourceComponent = null
target: delegateLoader.page.Component
function onDestruction() { delegateLoader.sourceComponent = null }
}

sourceComponent: header.pageDelegate
Expand All @@ -369,7 +369,7 @@ AbstractApplicationHeader {
}
Connections {
target: titleList.scrollingLocked ? pageRow.contentItem : null
onContentXChanged: {
function onContentXChanged() {
if (!titleList.dragging && !titleList.movingHorizontally && !titleList.scrollMutex) {
titleList.contentX = pageRow.contentItem.contentX - pageRow.contentItem.originX + titleList.originX;
}
Expand Down
4 changes: 2 additions & 2 deletions src/controls/templates/OverlayDrawer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -290,12 +290,12 @@ T2.Drawer {
//NOTE: this is NOT a binding, otherwise it causes a binding loop in implicitHeight
Connections {
target: parent
onWidthChanged: {
function onWidthChanged() {
if (edge === Qt.TopEdge || edge === Qt.BottomEdge) {
width = parent.width;
}
}
onHeightChanged: {
function onHeightChanged() {
if (edge === Qt.LeftEdge || edge === Qt.RightEdge) {
height = parent.height;
}
Expand Down
6 changes: 3 additions & 3 deletions src/controls/templates/OverlaySheet.qml
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ QtObject {
Connections {
target: enabled ? flickableContents.Window.activeFocusItem : null
enabled: flickableContents.focus && flickableContents.Window.activeFocusItem && flickableContents.Window.activeFocusItem.hasOwnProperty("text")
onTextChanged: {
function onTextChanged() {
if (Qt.inputMethod.cursorRectangle.y + Qt.inputMethod.cursorRectangle.height > mainItem.Window.height) {
scrollView.flickableItem.contentY += (Qt.inputMethod.cursorRectangle.y + Qt.inputMethod.cursorRectangle.height) - mainItem.Window.height
}
Expand All @@ -364,7 +364,7 @@ QtObject {

Connections {
target: scrollView.flickableItem
onContentHeightChanged: {
function onContentHeightChanged() {
if (openAnimation.running) {
openAnimation.running = false;
open();
Expand Down Expand Up @@ -528,7 +528,7 @@ QtObject {
Connections {
target: scrollView.flickableItem
property real oldContentY: 0
onContentYChanged: {
function onContentYChanged() {
if (outerFlickable.moving) {
oldContentY = scrollView.flickableItem.contentY;
return;
Expand Down
12 changes: 6 additions & 6 deletions src/controls/templates/SwipeListItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,7 @@ T2.SwipeDelegate {

Connections {
target: Kirigami.Settings
onTabletModeChanged: {
function onTabletModeChanged() {
if (Kirigami.Settings.tabletMode) {
if (!internal.swipeFilterItem) {
var component = Qt.createComponent(Qt.resolvedUrl("../private/SwipeItemEventFilter.qml"));
Expand Down Expand Up @@ -317,7 +317,7 @@ T2.SwipeDelegate {
id: swipeFilterConnection

target: internal.edgeEnabled ? internal.swipeFilterItem : null
onPeekChanged: {
function onPeekChanged() {
if (!listItem.actionsVisible) {
return;
}
Expand All @@ -333,22 +333,22 @@ T2.SwipeDelegate {

dragButton.lastPosition = listItem.swipe.position;
}
onPressed: {
function onPressed() {
if (internal.edgeEnabled) {
dragButton.onPressed(mouse);
}
}
onClicked: {
function onClicked() {
if (Math.abs(listItem.background.x) < Kirigami.Units.gridUnit && internal.edgeEnabled) {
dragButton.clicked(mouse);
}
}
onReleased: {
function onReleased() {
if (internal.edgeEnabled) {
dragButton.released(mouse);
}
}
onCurrentItemChanged: {
function onCurrentItemChanged() {
if (!internal.edgeEnabled) {
slideAnim.to = 0;
slideAnim.restart();
Expand Down