mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-07-31 16:54:46 +00:00
hide edit boxes when needed
This commit is contained in:
parent
49cde86d37
commit
efc09b0011
1 changed files with 87 additions and 67 deletions
|
|
@ -25,6 +25,7 @@ import org.kde.activities 0.1 as Activities
|
|||
|
||||
ColumnLayout {
|
||||
PlasmaComponents.ToolButton {
|
||||
id: newButton
|
||||
Layout.fillWidth: true
|
||||
text: i18n("New Activity...")
|
||||
onClicked: {
|
||||
|
|
@ -50,10 +51,15 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
}
|
||||
ListView {
|
||||
id: listView
|
||||
MouseArea {
|
||||
id: rootMouseArea
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
drag.filterChildren: true
|
||||
onClicked: newEdit.visible = false
|
||||
ListView {
|
||||
id: listView
|
||||
anchors.fill: parent
|
||||
model: Activities.ActivityModel {
|
||||
id: activityModel
|
||||
}
|
||||
|
|
@ -67,6 +73,18 @@ ColumnLayout {
|
|||
visible: model.current
|
||||
anchors.fill:parent
|
||||
}
|
||||
Connections {
|
||||
target: rootMouseArea
|
||||
onClicked: {
|
||||
if (!delegate.contains(rootMouseArea.mapToItem(delegate, mouse.x, mouse.y))) {
|
||||
edit.visible = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
Connections {
|
||||
target: newButton
|
||||
onClicked: edit.visible = false;
|
||||
}
|
||||
SequentialAnimation {
|
||||
id: positionAnim
|
||||
property alias to: xAnim.to
|
||||
|
|
@ -86,7 +104,7 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
width: listView.width
|
||||
height: label.height
|
||||
height: Math.max(label.height, label.height)
|
||||
onClicked: {
|
||||
listView.currentIndex = index;
|
||||
activityModel.setCurrentActivity(model.id, function() {});
|
||||
|
|
@ -113,6 +131,7 @@ ColumnLayout {
|
|||
PlasmaComponents.Label {
|
||||
id: label
|
||||
text: model.name
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
x: units.smallSpacing
|
||||
}
|
||||
PlasmaComponents.TextField {
|
||||
|
|
@ -134,3 +153,4 @@ ColumnLayout {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue