Commit c8eef2e7 authored by Marco Martin's avatar Marco Martin

new button on top

parent 4eec991a
......@@ -24,6 +24,32 @@ import org.kde.plasma.components 2.0 as PlasmaComponents
import org.kde.activities 0.1 as Activities
ColumnLayout {
PlasmaComponents.ToolButton {
Layout.fillWidth: true
text: i18n("New Activity...")
onClicked: {
newEdit.visible = true;
newEdit.forceActiveFocus();
}
PlasmaComponents.TextField {
id: newEdit
visible: false
width: parent.width
onFocusChanged: {
if (!focus) {
visible = false
}
}
onAccepted: {
if (text != "") {
activityModel.addActivity(text, function(id) {
visible = false;
activityModel.setCurrentActivity(id, function() {});
});
}
}
}
}
ListView {
id: listView
Layout.fillWidth: true
......@@ -107,31 +133,4 @@ ColumnLayout {
}
}
}
PlasmaComponents.ToolButton {
Layout.fillWidth: true
text: i18n("New Activity...")
onClicked: {
newEdit.visible = true;
newEdit.forceActiveFocus();
}
PlasmaComponents.TextField {
id: newEdit
visible: false
width: parent.width
onFocusChanged: {
if (!focus) {
visible = false
}
}
onAccepted: {
if (text != "") {
activityModel.addActivity(text, function(id) {
visible = false;
print("AAA"+id)
activityModel.setCurrentActivity(id, function() {});
});
}
}
}
}
}
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