mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
new button on top
This commit is contained in:
parent
4eec991a3c
commit
c8eef2e789
1 changed files with 26 additions and 27 deletions
|
|
@ -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() {});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue