mirror of
https://invent.kde.org/marcoa/shift-shell.git
synced 2026-04-26 14:23:09 +00:00
initialstart: Port to FormCard
This commit is contained in:
parent
c039bcef86
commit
d8f3146de5
7 changed files with 167 additions and 205 deletions
|
|
@ -8,7 +8,7 @@
|
|||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import org.kde.plasma.components 3.0 as PlasmaComponents
|
||||
import QtQuick.Controls as QQC2
|
||||
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
|
||||
import org.kde.kirigami as Kirigami
|
||||
|
||||
|
|
@ -37,10 +37,9 @@ Kirigami.Icon {
|
|||
}
|
||||
|
||||
// implementation
|
||||
|
||||
source: icon
|
||||
|
||||
PlasmaComponents.BusyIndicator {
|
||||
QQC2.BusyIndicator {
|
||||
id: connectingIndicator
|
||||
|
||||
anchors.fill: parent
|
||||
|
|
|
|||
|
|
@ -53,10 +53,10 @@ int main(int argc, char *argv[])
|
|||
aboutData.addAuthor(i18n("Devin Lin"), QString(), QStringLiteral("devin@kde.org"));
|
||||
KAboutData::setApplicationData(aboutData);
|
||||
|
||||
QQmlApplicationEngine *engine = new QQmlApplicationEngine;
|
||||
engine->rootContext()->setContextObject(new KLocalizedContext{engine});
|
||||
QQmlApplicationEngine engine;
|
||||
engine.rootContext()->setContextObject(new KLocalizedContext{&engine});
|
||||
|
||||
Wizard *wizard = new Wizard{nullptr, engine};
|
||||
Wizard *wizard = new Wizard{nullptr, &engine};
|
||||
wizard->setTestingMode(testWizard);
|
||||
wizard->load();
|
||||
|
||||
|
|
@ -64,7 +64,7 @@ int main(int argc, char *argv[])
|
|||
return wizard;
|
||||
});
|
||||
|
||||
engine->load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
|
||||
engine.load(QUrl(QStringLiteral("qrc:/qml/main.qml")));
|
||||
|
||||
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("start-here-symbolic")));
|
||||
|
||||
|
|
|
|||
|
|
@ -1,13 +1,13 @@
|
|||
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import org.kde.kirigami 2.20 as Kirigami
|
||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
||||
import org.kde.plasma.mm 1.0 as PlasmaMM
|
||||
import org.kde.kirigami as Kirigami
|
||||
import org.kde.kirigamiaddons.formcard 1 as FormCard
|
||||
import org.kde.plasma.mm 1 as PlasmaMM
|
||||
|
||||
Item {
|
||||
id: root
|
||||
|
|
@ -61,18 +61,13 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
MobileForm.FormCard {
|
||||
FormCard.FormCard {
|
||||
visible: PlasmaMM.SignalIndicator.modemAvailable && PlasmaMM.SignalIndicator.mobileDataSupported
|
||||
maximumWidth: root.cardWidth
|
||||
|
||||
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 0
|
||||
|
||||
MobileForm.FormSwitchDelegate {
|
||||
Layout.fillWidth: true
|
||||
FormCard.FormSwitchDelegate {
|
||||
text: i18n("Mobile Data")
|
||||
checked: PlasmaMM.SignalIndicator.mobileDataEnabled
|
||||
onCheckedChanged: {
|
||||
|
|
@ -82,18 +77,13 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MobileForm.FormCard {
|
||||
FormCard.FormCard {
|
||||
visible: PlasmaMM.SignalIndicator.modemAvailable && !PlasmaMM.SignalIndicator.simEmpty
|
||||
maximumWidth: root.cardWidth
|
||||
|
||||
Layout.fillHeight: true
|
||||
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 0
|
||||
|
||||
ListView {
|
||||
id: listView
|
||||
|
|
@ -105,7 +95,7 @@ Item {
|
|||
|
||||
model: PlasmaMM.SignalIndicator.profiles
|
||||
|
||||
delegate: MobileForm.FormRadioDelegate {
|
||||
delegate: FormCard.FormRadioDelegate {
|
||||
width: listView.width
|
||||
text: modelData.name
|
||||
description: modelData.apn
|
||||
|
|
@ -136,7 +126,7 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
MobileForm.FormButtonDelegate {
|
||||
FormCard.FormButtonDelegate {
|
||||
icon.name: "list-add"
|
||||
text: i18n("Add APN")
|
||||
onClicked: {
|
||||
|
|
@ -147,6 +137,3 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import QtQuick.Controls 2.15
|
|||
import QtQuick.Layouts 1.15
|
||||
|
||||
import org.kde.kirigami 2.20 as Kirigami
|
||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
||||
import org.kde.kirigamiaddons.formcard 1.0 as FormCard
|
||||
import org.kde.plasma.mobileinitialstart.prepare 1.0 as Prepare
|
||||
import org.kde.plasma.plasma5support 2.0 as P5Support
|
||||
|
||||
|
|
@ -82,19 +82,13 @@ Item {
|
|||
text: i18n("Adjust the screen brightness to be comfortable for the installation process.")
|
||||
}
|
||||
|
||||
MobileForm.FormCard {
|
||||
FormCard.FormCard {
|
||||
maximumWidth: root.cardWidth
|
||||
|
||||
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 0
|
||||
|
||||
MobileForm.AbstractFormDelegate {
|
||||
Layout.fillWidth: true
|
||||
|
||||
background: Item {}
|
||||
FormCard.AbstractFormDelegate {
|
||||
background: null
|
||||
|
||||
contentItem: RowLayout {
|
||||
spacing: Kirigami.Units.gridUnit
|
||||
|
|
@ -122,7 +116,6 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Label {
|
||||
Layout.leftMargin: Kirigami.Units.gridUnit
|
||||
|
|
@ -135,20 +128,15 @@ Item {
|
|||
text: i18n("Adjust the size of elements on the screen.")
|
||||
}
|
||||
|
||||
MobileForm.FormCard {
|
||||
FormCard.FormCard {
|
||||
maximumWidth: root.cardWidth
|
||||
|
||||
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 0
|
||||
|
||||
MobileForm.FormComboBoxDelegate {
|
||||
FormCard.FormComboBoxDelegate {
|
||||
id: displayScaling
|
||||
Layout.fillWidth: true
|
||||
text: i18n("Display Scaling")
|
||||
displayMode: MobileForm.FormComboBoxDelegate.Dialog
|
||||
displayMode: FormCard.FormComboBoxDelegate.Dialog
|
||||
currentIndex: Prepare.PrepareUtil.scalingOptions.indexOf(Prepare.PrepareUtil.scaling.toString() + "%");
|
||||
model: Prepare.PrepareUtil.scalingOptions
|
||||
|
||||
|
|
@ -159,4 +147,3 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import QtQuick.Controls 2.15
|
|||
import QtQuick.Layouts 1.15
|
||||
|
||||
import org.kde.kirigami 2.20 as Kirigami
|
||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
||||
import org.kde.kirigamiaddons.formcard 1.0 as FormCard
|
||||
import org.kde.plasma.mobileinitialstart.time 1.0 as Time
|
||||
|
||||
Item {
|
||||
|
|
@ -36,16 +36,13 @@ Item {
|
|||
text: i18n("Select your time zone and preferred time format.")
|
||||
}
|
||||
|
||||
MobileForm.FormCard {
|
||||
FormCard.FormCard {
|
||||
maximumWidth: root.cardWidth
|
||||
|
||||
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 0
|
||||
|
||||
MobileForm.FormSwitchDelegate {
|
||||
FormCard.FormSwitchDelegate {
|
||||
Layout.fillWidth: true
|
||||
text: i18n("24-Hour Format")
|
||||
checked: Time.TimeUtil.is24HourTime
|
||||
|
|
@ -56,21 +53,18 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MobileForm.FormCard {
|
||||
FormCard.FormCard {
|
||||
maximumWidth: root.cardWidth
|
||||
|
||||
Layout.fillHeight: true
|
||||
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 0
|
||||
|
||||
ListView {
|
||||
clip: true
|
||||
id: listView
|
||||
|
||||
clip: true
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
model: Time.TimeUtil.timeZones
|
||||
|
|
@ -99,7 +93,7 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
delegate: MobileForm.FormRadioDelegate {
|
||||
delegate: FormCard.FormRadioDelegate {
|
||||
required property string timeZoneId
|
||||
|
||||
width: ListView.view.width
|
||||
|
|
@ -116,5 +110,4 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ import QtQuick.Controls 2.15 as Controls
|
|||
|
||||
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
|
||||
import org.kde.kirigami 2.2 as Kirigami
|
||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
||||
import org.kde.kirigamiaddons.formcard 1.0 as FormCard
|
||||
import org.kde.ksvg 1.0 as KSvg
|
||||
|
||||
MobileForm.AbstractFormDelegate {
|
||||
FormCard.AbstractFormDelegate {
|
||||
topPadding: Kirigami.Units.smallSpacing
|
||||
bottomPadding: Kirigami.Units.smallSpacing
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,12 @@
|
|||
// SPDX-FileCopyrightText: 2023 Devin Lin <devin@kde.org>
|
||||
// SPDX-License-Identifier: GPL-2.0-or-later
|
||||
|
||||
import QtQuick 2.15
|
||||
import QtQuick.Controls 2.15
|
||||
import QtQuick.Layouts 1.15
|
||||
import QtQuick
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Layouts
|
||||
|
||||
import org.kde.kirigami 2.20 as Kirigami
|
||||
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm
|
||||
import org.kde.kirigamiaddons.formcard 1.0 as FormCard
|
||||
import org.kde.plasma.networkmanagement 0.2 as PlasmaNM
|
||||
import org.kde.plasma.mobileinitialstart.wifi 1.0 as WiFi
|
||||
|
||||
|
|
@ -68,16 +68,13 @@ Item {
|
|||
text: i18n("Connect to a WiFi network for network access.")
|
||||
}
|
||||
|
||||
MobileForm.FormCard {
|
||||
FormCard.FormCard {
|
||||
maximumWidth: root.cardWidth
|
||||
|
||||
Layout.fillHeight: true
|
||||
Layout.alignment: Qt.AlignTop | Qt.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 0
|
||||
|
||||
ListView {
|
||||
id: listView
|
||||
currentIndex: -1
|
||||
|
|
@ -112,6 +109,5 @@ Item {
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue