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 Sailfish.Silica 1.0
|
||||
|
||||
Page {
|
||||
Dialog {
|
||||
id: subscribe
|
||||
canAccept: input.text != ''
|
||||
|
||||
PageHeader { title: 'Add subscription' }
|
||||
SubscribeProgress {
|
||||
id: progress
|
||||
}
|
||||
|
||||
onAccepted: {
|
||||
py.call('main.subscribe', [input.text], function () {
|
||||
// TODO
|
||||
});
|
||||
}
|
||||
|
||||
Column {
|
||||
anchors.centerIn: parent
|
||||
spacing: 30 * pgst.scalef
|
||||
anchors.fill: parent
|
||||
|
||||
DialogHeader {
|
||||
title: 'Add subscription'
|
||||
acceptText: 'Subscribe'
|
||||
}
|
||||
|
||||
TextField {
|
||||
id: input
|
||||
width: subscribe.width *.8
|
||||
placeholderText: 'Feed URL'
|
||||
}
|
||||
|
||||
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
|
||||
width: parent.width
|
||||
label: 'Feed URL'
|
||||
placeholderText: label
|
||||
inputMethodHints: Qt.ImhUrlCharactersOnly | Qt.ImhNoPredictiveText | Qt.ImhNoAutoUppercase
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue