diff --git a/modules/accounts/package/contents/ui/Accounts.qml b/modules/accounts/package/contents/ui/Accounts.qml index 2308867..dfc5732 100644 --- a/modules/accounts/package/contents/ui/Accounts.qml +++ b/modules/accounts/package/contents/ui/Accounts.qml @@ -1,148 +1,147 @@ /* * Copyright 2015 Martin Klapetek * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 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 Library General Public License for more details * * You should have received a copy of the GNU Library 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 2.7 import QtQuick.Layouts 1.11 import QtQuick.Controls 2.0 as Controls import org.kde.kirigami 2.4 as Kirigami -import org.kde.active.settings 2.0 as ActiveSettings import org.kde.kaccounts 1.0 import org.kde.kcm 1.2 import Ubuntu.OnlineAccounts 0.1 as OA ScrollViewKCM { id: kaccountsRoot objectName: "kaccountsModule" // Existing accounts view: ListView { clip: true model: OA.AccountServiceModel { id: accountsModel service: "global" includeDisabled: true } delegate: Kirigami.SwipeListItem { width: ListView.view.width contentItem: Controls.Label { text: model.displayName + " (" + providerName + ")" OA.Account { id: account objectHandle: model.accountHandle } } actions: [ Kirigami.Action { iconName: "bookmark-remove" onTriggered: { account.remove() } } ] onClicked: { availableServicesSheet.open() servicesModel.accountId = model.accountId } } } footer: RowLayout { Controls.Button { Layout.alignment: Qt.AlignRight text: i18n("Add new Account") icon.name: "contact-new" onClicked: { availableAccountsSheet.open() } } } Component { id: jobComponent CreateAccount { onFinished: { availableAccountsSheet.close() } } } Kirigami.OverlaySheet { id: availableAccountsSheet parent: kaccountsRoot.parent ListView { Layout.fillWidth: true Layout.fillHeight: true model: OA.ProviderModel {} delegate: Kirigami.BasicListItem { icon: model.iconName label: model.displayName Layout.fillWidth: true onClicked: { var job = jobComponent.createObject(kaccountsRoot, { "providerName": providerId }) job.start() } } } } OA.AccountServiceModel { id: servicesModel } Kirigami.OverlaySheet { id: availableServicesSheet parent: kaccountsRoot.parent ColumnLayout { Kirigami.Heading { Layout.fillWidth: true text: i18n("Available Services") } ColumnLayout { Layout.fillHeight: true Layout.fillWidth: true spacing: Kirigami.Units.smallSpacing Repeater { Layout.fillWidth: true model: servicesModel Controls.CheckDelegate { Layout.fillWidth: true text: model.serviceName checked: model.enabled } } } } } } diff --git a/modules/time/package/contents/ui/DatePicker.qml b/modules/time/package/contents/ui/DatePicker.qml index 2d8cde8..d81398f 100644 --- a/modules/time/package/contents/ui/DatePicker.qml +++ b/modules/time/package/contents/ui/DatePicker.qml @@ -1,180 +1,179 @@ /* * Copyright 2011 Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 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 Library General Public License for more details * * You should have received a copy of the GNU Library 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 2.1 import org.kde.plasma.core 2.0 as PlasmaCore -//import org.kde.active.settings.time 2.0 //import "private" //FIXME: shouldn't be a FrameSvgItem Item { id: root clip: true //////// API property int day property int month property int year property bool userConfiguring: false property string isoDate: year + "-" + clockRow.twoDigitString(month) + "-" + clockRow.twoDigitString(day) property int fontSize: 14 property int _margin: units.gridUnit opacity: enabled ? 1.0 : 0.5 Rectangle { color: "transparent" border.width: 1 border.color: theme.textColor anchors.fill: parent opacity: 0.3 } /////// Implementation Connections { target: root onDayChanged: clockRow.day = root.day onMonthChanged: clockRow.month = root.month onYearChanged: clockRow.year = root.year } //imagePath: "widgets/picker" width: clockRow.width + root._margin * 2 height: clockRow.height + root._margin * 2 Timer { id: userConfiguringTimer repeat: false interval: 1500 running: false onTriggered: { root.day = clockRow.day root.month = clockRow.month root.year = clockRow.year userConfiguring = false } } Row { id: clockRow spacing: 3 x: root._margin y: root._margin property int day property int month property int year function twoDigitString(number) { return number < 10 ? "0"+number : number } Digit { id: dayDigit model: { var dd = new Date(year, month, 0); return dd.getDate() } currentIndex: ((day - 1) < model) ? day-1 : 1 onSelectedIndexChanged: { if (selectedIndex > -1) { day = selectedIndex+1 } } delegate: Text { horizontalAlignment: Text.AlignHCenter width: dayDigit.width property int ownIndex: index text: index+1 color: theme.textColor font.pointSize: root.fontSize opacity: PathView.itemOpacity } } PlasmaCore.SvgItem { svg: PlasmaCore.Svg {imagePath: "widgets/line"} elementId: "vertical-line" width: naturalSize.width anchors { top: parent.top bottom:parent.bottom } } Digit { id: monthDigit model: 12 currentIndex: month -1 onSelectedIndexChanged: { if (selectedIndex > -1) { month = selectedIndex + 1 } } delegate: Text { horizontalAlignment: Text.AlignHCenter width: monthDigit.width property int ownIndex: index property variant months: Array(i18n("Jan"), i18n("Feb"), i18n("Mar"), i18n("Apr"), i18n("May"), i18n("Jun"), i18n("Jul"), i18n("Aug"), i18n("Sep"), i18n("Oct"), i18n("Nov"), i18n("Dec")) text: months[index] font.pointSize: root.fontSize color: theme.textColor opacity: PathView.itemOpacity } width: monthPlaceHolder.width Text { id: monthPlaceHolder visible: false font.pointSize: root.fontSize text: "0000" } } PlasmaCore.SvgItem { svg: PlasmaCore.Svg {imagePath: "widgets/line"} elementId: "vertical-line" width: naturalSize.width anchors { top: parent.top bottom: parent.bottom } } Digit { id: yearDigit //FIXME: yes, this is a tad lame ;) model: 3000 currentIndex: year onSelectedIndexChanged: { if (selectedIndex > -1) { year = selectedIndex } } width: yearPlaceHolder.width*1.3 Text { id: yearPlaceHolder visible: false font.pointSize: root.fontSize text: "0000" } } } } diff --git a/modules/time/package/contents/ui/Digit.qml b/modules/time/package/contents/ui/Digit.qml index f06b9a4..964bc46 100644 --- a/modules/time/package/contents/ui/Digit.qml +++ b/modules/time/package/contents/ui/Digit.qml @@ -1,88 +1,87 @@ /* * Copyright 2011 Marco Martin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU Library General Public License as * published by the Free Software Foundation; either version 2 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 Library General Public License for more details * * You should have received a copy of the GNU Library 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 2.7 -// import org.kde.active.settings.time 2.0 Item { id: root property alias model: spinnerView.model property alias currentIndex: spinnerView.currentIndex property alias delegate: spinnerView.delegate property alias moving: spinnerView.moving property int selectedIndex: -1 property int fontSize: 14 width: placeHolder.width*1.3 height: placeHolder.height*3 Text { id: placeHolder visible: false font.pointSize: root.fontSize text: "00" } PathView { id: spinnerView anchors.fill: parent model: 60 clip: true pathItemCount: 5 dragMargin: 800 preferredHighlightBegin: 0.5 preferredHighlightEnd: 0.5 delegate: Text { horizontalAlignment: Text.AlignHCenter width: spinnerView.width property int ownIndex: index text: index < 10 ? "0"+index : index color: theme.textColor font.pointSize: root.fontSize opacity: PathView.itemOpacity } onMovingChanged: { userConfiguring = true if (!moving) { userConfiguringTimer.restart() selectedIndex = childAt(width/2, height/2).ownIndex } } path: Path { startX: spinnerView.width/2 startY: spinnerView.height + 1.5*placeHolder.height PathAttribute { name: "itemOpacity"; value: 0 } PathLine { x: spinnerView.width/2 y: spinnerView.height/2 } PathAttribute { name: "itemOpacity"; value: 1 } PathLine { x: spinnerView.width/2 y: -1.5*placeHolder.height } PathAttribute { name: "itemOpacity"; value: 0 } } } }