QML: Turn subscribe page into a Dialog
This commit is contained in:
parent
de190e763f
commit
8a9b29aed2
1 changed files with 21 additions and 35 deletions
|
@ -21,48 +21,34 @@
|
||||||
import QtQuick 2.0
|
import QtQuick 2.0
|
||||||
import Sailfish.Silica 1.0
|
import Sailfish.Silica 1.0
|
||||||
|
|
||||||
Page {
|
Dialog {
|
||||||
id: subscribe
|
id: subscribe
|
||||||
|
canAccept: input.text != ''
|
||||||
|
|
||||||
PageHeader { title: 'Add subscription' }
|
SubscribeProgress {
|
||||||
|
id: progress
|
||||||
|
}
|
||||||
|
|
||||||
|
onAccepted: {
|
||||||
|
py.call('main.subscribe', [input.text], function () {
|
||||||
|
// TODO
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
Column {
|
Column {
|
||||||
anchors.centerIn: parent
|
anchors.fill: parent
|
||||||
spacing: 30 * pgst.scalef
|
|
||||||
|
DialogHeader {
|
||||||
|
title: 'Add subscription'
|
||||||
|
acceptText: 'Subscribe'
|
||||||
|
}
|
||||||
|
|
||||||
TextField {
|
TextField {
|
||||||
id: input
|
id: input
|
||||||
width: subscribe.width *.8
|
width: parent.width
|
||||||
placeholderText: 'Feed URL'
|
label: 'Feed URL'
|
||||||
}
|
placeholderText: label
|
||||||
|
inputMethodHints: Qt.ImhUrlCharactersOnly | Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase
|
||||||
BackgroundItem {
|
|
||||||
id: button
|
|
||||||
width: input.width
|
|
||||||
height: input.height
|
|
||||||
|
|
||||||
Label {
|
|
||||||
anchors.centerIn: parent
|
|
||||||
text: 'Subscribe'
|
|
||||||
}
|
|
||||||
|
|
||||||
onClicked: {
|
|
||||||
loading.visible = true;
|
|
||||||
button.visible = false;
|
|
||||||
input.visible = false;
|
|
||||||
py.call('main.subscribe', [input.text], function () {
|
|
||||||
if (pageStack.currentPage == subscribe) {
|
|
||||||
pageStack.pop();
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
BusyIndicator {
|
|
||||||
id: loading
|
|
||||||
visible: false
|
|
||||||
running: visible
|
|
||||||
anchors.horizontalCenter: parent.horizontalCenter
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue