Skip to content
Merged
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
22 changes: 21 additions & 1 deletion panels/dock/tray/package/ActionToggleCollapseDelegate.qml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ AppletItemButton {

z: 5

icon.name: isHorizontal ? (collapsed ? "expand-left" : "expand-right") : (collapsed ? "expand-up" : "expand-down")
icon.name: isHorizontal ? "expand-right" : "expand-up"

padding: itemPadding

Expand All @@ -25,6 +25,26 @@ AppletItemButton {
toolTip.close()
}

states: [
State {
name: "opened"
when: !collapsed
PropertyChanges { target: root.contentItem; rotation: 180 }
},

State {
name: "closed"
when: collapsed
PropertyChanges { target: root.contentItem; rotation: 0 }
}
]

transitions: [
Transition {
RotationAnimation { duration: 200; }
}
]

PanelToolTip {
id: toolTip
text: qsTr("Collapse tray")
Expand Down
4 changes: 2 additions & 2 deletions panels/dock/tray/package/TrayContainer.qml
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,11 @@ Item {
height: containerSize.height

Behavior on width {
NumberAnimation { duration: 200; easing.type: Easing.OutQuad }
NumberAnimation { duration: 200; easing.type: collapsed ? Easing.OutQuad : Easing.InQuad }
}

Behavior on height {
NumberAnimation { duration: 200; easing.type: Easing.OutQuad }
NumberAnimation { duration: 200; easing.type: collapsed ? Easing.OutQuad : Easing.InQuad }
}

// Delegates
Expand Down
12 changes: 7 additions & 5 deletions panels/dock/tray/package/TrayItemPositioner.qml
Original file line number Diff line number Diff line change
Expand Up @@ -26,33 +26,35 @@ Control {
x: visualPosition.x
y: visualPosition.y
Behavior on x {
NumberAnimation { duration: 200; easing.type: Easing.OutQuad }
NumberAnimation { duration: 200; easing.type: collapsed ? Easing.OutQuad : Easing.InQuad }
}
Behavior on y {
NumberAnimation { duration: 200; easing.type: Easing.OutQuad }
NumberAnimation { duration: 200; easing.type: collapsed ? Easing.OutQuad : Easing.InQuad }
}
states: [
State {
when: root.itemVisible
PropertyChanges { target: root; opacity: 1.0 }
PropertyChanges { target: root; scale: 1.0 }
PropertyChanges { target: root; visible: true }
},
State {
name: "item-invisible"
when: !root.itemVisible
PropertyChanges { target: root; opacity: 0.0 }
PropertyChanges { target: root; opacity: 0 }
PropertyChanges { target: root; scale: 0.2 }
}
]
transitions: [
Transition {
to: "item-invisible"
SequentialAnimation {
NumberAnimation { property: "opacity"; easing.type: Easing.InQuad; duration: 200 }
NumberAnimation { properties: "opacity,scale"; easing.type: Easing.OutQuad; duration: 200 }
PropertyAction { target: root; property: "visible"; value: false }
}
},
Transition {
NumberAnimation { property: "opacity"; easing.type: Easing.OutQuad; duration: 200 }
NumberAnimation { properties: "opacity,scale"; easing.type: Easing.InQuad; duration: 200 }
}
]
}
5 changes: 3 additions & 2 deletions panels/dock/tray/traysortordermodel.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -363,9 +363,10 @@ void TraySortOrderModel::updateVisualIndexes()
results[0]->setData(-1, TraySortOrderModel::VisualIndexRole);
if (itemVisible) {
toogleCollapseActionVisible = true;
results[0]->setData(currentVisualIndex, TraySortOrderModel::VisualIndexRole);
if (!m_collapsed) {
currentVisualIndex++;
results[0]->setData(currentVisualIndex++, TraySortOrderModel::VisualIndexRole);
} else {
results[0]->setData(currentVisualIndex-1, TraySortOrderModel::VisualIndexRole);
}
}
}
Expand Down