diff --git a/src/contents/ui/AuthSheet.qml b/src/contents/ui/AuthSheet.qml index 428905b..cbedd3b 100644 --- a/src/contents/ui/AuthSheet.qml +++ b/src/contents/ui/AuthSheet.qml @@ -1,60 +1,60 @@ import QtQuick 2.0 import QtQuick.Layouts 1.1 import QtQuick.Controls 2.2 as Controls import org.kde.kirigami 2.5 as Kirigami import QtWebEngine 1.4 Kirigami.OverlaySheet { id: authSheet property AuthenticationDialogRequest request - Kirigami.FormLayout { + header: Kirigami.Heading { + elide: Text.ElideRight + wrapMode: Text.WordWrap Layout.fillWidth: true - Kirigami.Heading { - elide: Text.ElideRight - wrapMode: Text.WordWrap - Layout.fillWidth: true + text: i18n("Authentication required") + } - text: i18n("Authentication required") - } + Kirigami.FormLayout { + Layout.fillWidth: true Controls.TextField { id: usernameField Kirigami.FormData.label: i18n("Username") Layout.fillWidth: true } Controls.TextField { id: passwordField echoMode: TextInput.Password Kirigami.FormData.label: i18n("Password") Layout.fillWidth: true } RowLayout { Layout.fillWidth: true Controls.Button { Layout.fillWidth: true text: i18n("Accept") onClicked: { authSheet.request.dialogAccept(usernameField.text, passwordField.text) authSheet.close() } } Controls.Button { Layout.fillWidth: true text: i18n("Cancel") onClicked: { authSheet.request.dialogReject() authSheet.close() } } } } } diff --git a/src/contents/ui/InputSheet.qml b/src/contents/ui/InputSheet.qml index cc014d9..ce13ebf 100644 --- a/src/contents/ui/InputSheet.qml +++ b/src/contents/ui/InputSheet.qml @@ -1,74 +1,74 @@ /*************************************************************************** * * * Copyright 2019 Jonah BrĂ¼chert * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * * * ***************************************************************************/ import QtQuick.Controls 2.1 as Controls import QtQuick.Layouts 1.7 import QtQuick 2.7 import org.kde.kirigami 2.5 as Kirigami Kirigami.OverlaySheet { id: inputSheet property string placeholderText property string description property string title property string text signal accepted function accept() { inputSheet.text = sheetTextField.text inputSheet.close() accepted() } - ColumnLayout { - Kirigami.Heading { - text: title - } + header: Kirigami.Heading { + text: title + } + ColumnLayout { Controls.Label { Layout.fillWidth: true text: inputSheet.description wrapMode: Text.WordWrap } Controls.TextField { id: sheetTextField Layout.fillWidth: true placeholderText: inputSheet.placeholderText text: inputSheet.text focus: true onAccepted: accept() } Controls.Button { text: i18n("OK") Layout.alignment: Qt.AlignRight onClicked: accept() } } onSheetOpenChanged: { if (sheetOpen) sheetTextField.forceActiveFocus() } } diff --git a/src/contents/ui/ShareSheet.qml b/src/contents/ui/ShareSheet.qml index e1e1f0c..a329599 100644 --- a/src/contents/ui/ShareSheet.qml +++ b/src/contents/ui/ShareSheet.qml @@ -1,58 +1,62 @@ /*************************************************************************** * * * Copyright 2019 Nicolas Fella * * * * This program is free software; you can redistribute it and/or modify * * it under the terms of the GNU General Public License as published by * * the Free Software Foundation; either version 2 of the License, or * * (at your option) any later version. * * * * This program is distributed in the hope that it will be useful, * * but WITHOUT ANY WARRANTY; without even the implied warranty of * * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * * GNU General Public License for more details. * * * * You should have received a copy of the GNU General Public License * * along with this program; if not, write to the * * Free Software Foundation, Inc., * * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA . * * * ***************************************************************************/ import QtQuick.Controls 2.1 as Controls import QtQuick.Layouts 1.7 import QtQuick 2.7 import org.kde.kirigami 2.5 as Kirigami import org.kde.purpose 1.0 as Purpose Kirigami.OverlaySheet { id: inputSheet property url url property string title + header: Kirigami.Heading { + text: i18n("Share page") + } + Purpose.AlternativesView { id: view pluginType: "ShareUrl" implicitHeight: initialItem.contentHeight clip: true delegate: Kirigami.BasicListItem { label: model.display icon: "arrow-right" onClicked: view.createJob (model.index) Keys.onReturnPressed: view.createJob (model.index) Keys.onEnterPressed: view.createJob (model.index) } onFinished: close() } onSheetOpenChanged: { view.inputData = { "urls": [inputSheet.url.toString()], "title": inputSheet.title } } }