ubuntu-touch-coreapps-reviewers team mailing list archive
-
ubuntu-touch-coreapps-reviewers team
-
Mailing list archive
-
Message #09470
[Merge] lp:~renatofilho/ubuntu-calendar-app/majster-new-event-page into lp:ubuntu-calendar-app
Renato Araujo Oliveira Filho has proposed merging lp:~renatofilho/ubuntu-calendar-app/majster-new-event-page into lp:ubuntu-calendar-app.
Requested reviews:
Renato Araujo Oliveira Filho (renatofilho)
For more details, see:
https://code.launchpad.net/~renatofilho/ubuntu-calendar-app/majster-new-event-page/+merge/294499
this is very first proposal for new Event Page, adding new guest is currently to be work on... but first implementation is done.
--
Your team Ubuntu Calendar Developers is subscribed to branch lp:ubuntu-calendar-app.
=== modified file 'ContactChoicePopup.qml'
--- ContactChoicePopup.qml 2016-02-04 13:37:00 +0000
+++ ContactChoicePopup.qml 2016-05-12 12:41:23 +0000
@@ -1,154 +1,285 @@
-/*
- * Copyright (C) 2013-2014 Canonical Ltd
- *
- * This file is part of Ubuntu Calendar App
- *
- * Ubuntu Calendar App is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License version 3 as
- * published by the Free Software Foundation.
- *
- * Ubuntu Calendar App 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, see <http://www.gnu.org/licenses/>.
- */
+///*
+// * Copyright (C) 2013-2014 Canonical Ltd
+// *
+// * This file is part of Ubuntu Calendar App
+// *
+// * Ubuntu Calendar App is free software: you can redistribute it and/or modify
+// * it under the terms of the GNU General Public License version 3 as
+// * published by the Free Software Foundation.
+// *
+// * Ubuntu Calendar App 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, see <http://www.gnu.org/licenses/>.
+// */
import QtQuick 2.4
import Ubuntu.Components 1.3
-import Ubuntu.Components.Popups 1.3
-import Ubuntu.Components.ListItems 1.0
-import Ubuntu.Components.Themes.Ambiance 1.0
-import QtOrganizer 5.0
import QtContacts 5.0
-import "Defines.js" as Defines
-
-Popover {
+Item {
id: root
- objectName: "contactPopover"
+
+ width: parent.width
+ height: mainColumn.height
+
+ property bool contactOpen: false
+ property var openContanctObject
signal contactSelected(var contact, string emailAddress);
- Label {
- id: noContact
- anchors.centerIn: parent
- text: i18n.tr("No contact")
- visible: contactModel.contacts.length === 0
- }
-
- UnionFilter {
- id: filter
-
- property string searchString: ""
-
- filters: [
- DetailFilter{
- detail: ContactDetail.Name
- field: Name.FirstName
- matchFlags: Filter.MatchContains
- value: filter.searchString
- },
- DetailFilter{
- detail: ContactDetail.Name
- field: Name.LastName
- matchFlags: Filter.MatchContains
- value: filter.searchString
- },
- DetailFilter{
- detail: ContactDetail.DisplayLabel
- field: DisplayLabel.Label
- matchFlags: Filter.MatchContains
- value: filter.searchString
- }
- ]
- }
+ onContactOpenChanged: {
+ positionDelay.start()
+ }
+
+ Timer {
+ id: positionDelay
+ interval: 300
+ onTriggered: suggestionsFlickable.contentY = openContanctObject.y
+ }
+
+ states: [
+ State {
+ name: "open"
+ PropertyChanges { target: contactsSuggestionItem; height: units.gu(10)}
+ },
+ State {
+ name: "close"
+ PropertyChanges { target: contactsSuggestionItem; height: 0}
+ }
+
+ ]
+
+ Behavior on height {
+ UbuntuNumberAnimation {}
+ }
+
ContactModel {
id: contactModel
manager: "galera"
- filter: filter
autoUpdate: true
}
- Timer {
- id: idleSearch
- interval: 500
- repeat: false
- onTriggered: {
- filter.searchString = searchBox.text
- }
- }
Column {
- anchors.top: parent.top
- anchors.left: parent.left
- anchors.right: parent.right
- anchors.margins: units.gu(1)
+ id: mainColumn
+ width: parent.width
+ spacing: units.gu(1)
+
+ Item {
+ id: guestsAdded
+ width: parent.width
+
+ }
TextField {
- id: searchBox
- objectName: "contactPopoverInput"
- focus: true
+ id: addGuestTestField
+ objectName: "addGuestTestField"
+
width: parent.width
- placeholderText: i18n.tr("Search contact")
inputMethodHints: Qt.ImhNoPredictiveText
- primaryItem: Icon {
- height: parent.height*0.5
- width: parent.height*0.5
- anchors.verticalCenter: parent.verticalCenter
- name:"find"
- }
- onTextChanged: {
- idleSearch.restart()
- }
+ placeholderText: i18n.tr("Guests")
+
+ onActiveFocusChanged: {
+ if(addGuestTestField.activeFocus) {
+ lol2.state = "open"
+ flickable.makeMeVisible(addGuestListItem);
+ } else {
+ lol2.state = "close"
+ }
+ }
+
}
- ListView {
- id: contactList
- objectName: "contactPopoverList"
- width: parent.width
- model: contactModel
- height: units.gu(15)
- clip: true
- focus: false
- delegate: Column {
- width: contactList.width
- Repeater {
- anchors {
- left: parent.left
- right: parent.right
- }
- height: childrenRect.height
-
- model: Math.max(1, contact.emails.length)
- delegate: ListItem {
- property string emailAddress: contact.emails.length > index ? contact.emails[index].emailAddress : ""
-
+ Component {
+ id: suggestionsDelegate
+ Item {
+ id: rootSug
+
+ clip: true
+ width: String(contact.displayLabel.label).toLowerCase().search(addGuestTestField.text.toLowerCase()) == - 1 ? 0 : mainGrid.width
+ height: mainGrid.height
+
+ ListModel {
+ id: addressesModel
+ }
+
+
+ function getEmails() {
+ for(var i=0; contact.emails.length > i; i++) {
+ addressesModel.append({"email": contact.emails[i].emailAddress})
+ }
+ }
+
+
+ Behavior on width {
+ UbuntuNumberAnimation {}
+ }
+
+ Connections {
+ target: root
+ onContactOpenChanged: {
+ if(!contactOpen) {
+ emailAddressesColumn.state = "default"
+ }
+ }
+ }
+
+
+
+ Row {
+ id: mainGrid
+
+ AbstractButton {
+ id: contactNameAbstractButton
+
+ width: contactNameLabel.width + units.gu(1)
+ height: contactNameLabel.height + units.gu(1)
activeFocusOnPress: false
- opacity: emailAddress.length > 0 ? 1.0 : 0.3
- width: contactList.width
- objectName: "contactPopoverList%1".arg(index)
- ListItemLayout {
- title.text: contact.displayLabel.label
- subtitle.text: emailAddress
- }
- MouseArea {
+ enabled: contact.emails.length > 0
+
+ Rectangle {
anchors.fill: parent
- onClicked: {
- if (emailAddress.length > 0) {
- root.contactSelected(contact, emailAddress);
- PopupUtils.close(root)
- }
- }
- }
- }
- }
+ color: (parent.pressed || (emailAddressesColumn.state === "open")) ? UbuntuColors.lightGrey : "transparent"
+ }
+
+ Label {
+ id: contactNameLabel
+ text: emailAddressesColumn.state === "open" ? contact.displayLabel.label+":" : contact.displayLabel.label
+ anchors.centerIn: parent
+ color: contact.emails.length > 0 ? "black" : UbuntuColors.lightGrey
+ font.italic: contact.emails.length > 0 ? false : true
+ fontSize: "medium"
+ }
+ onClicked: {
+ if(contact.emails.length > 1) {
+ if(contactOpen) {
+ contactOpen = false
+ } else {
+ emailAddressesColumn.openClose()
+ openContanctObject = rootSug
+ }
+
+ } else {
+ root.contactSelected(contact, contact.email.emailAddress);
+ }
+ }
+ }
+ Column {
+ id: emailAddressesColumn
+
+ clip: true
+ state: "default"
+
+ function openClose() {
+ if(emailAddressesColumn.state === "open") {
+ emailAddressesColumn.state = "default"
+ } else {
+ emailAddressesColumn.state = "open"
+ }
+ }
+
+ states: [
+ State {
+ name: "default"
+ PropertyChanges { target: emailAddressesColumn; width: 0 }
+ },
+ State {
+ name: "open"
+ PropertyChanges { target: emailAddressesColumn; width: mainColumn.width - contactNameAbstractButton.width }
+ }
+
+ ]
+
+ onStateChanged: {
+ if(state === "open") {
+ rootSug.getEmails()
+ contactOpen = true
+ } else {
+ addressesModel.clear()
+ }
+ }
+
+ Repeater {
+ model: addressesModel
+ delegate: AbstractButton {
+ width: contactEmailLabel.width + units.gu(2)
+ height: contactEmailLabel.height + units.gu(1)
+ activeFocusOnPress: false
+
+ Rectangle {
+ anchors.fill: parent
+ color: parent.pressed ? UbuntuColors.lightGrey : "transparent"
+ }
+
+ Label {
+ id: contactEmailLabel
+ anchors.verticalCenter: parent.verticalCenter
+ anchors.left: parent.left
+ anchors.leftMargin: units.gu(1)
+ text: email
+ color: contact.emails.length > 0 ? "black" : UbuntuColors.lightGrey
+ font.italic: contact.emails.length > 0 ? false : true
+ fontSize: "medium"
+ elide: Text.ElideRight
+ }
+
+ onClicked: {
+ root.contactSelected(contact, email);
+ emailAddressesColumn.state = "default"
+ }
+ }
+
+ }
+
+ }
+ }
+
+
+ }
+
+ }
+
+ Item {
+ id: contactsSuggestionItem
+ width: parent.width
+ clip: true
+
+ Flickable {
+ id: suggestionsFlickable
+ width: parent.width - units.gu(0)
+ height: parent.height - units.gu(1)
+ anchors.top: parent.top
+ anchors.topMargin: units.gu(1)
+ contentHeight: suggestionsListView.height + units.gu(1)
+
+ // animation on flickable contentY change
+ Behavior on contentY {
+ UbuntuNumberAnimation {}
+ }
+
+ onFlickStarted: contactOpen = false
+ Flow {
+ id: suggestionsListView
+ width: parent.width
+ spacing: units.gu(1.5)
+
+ Repeater {
+ model: contactModel
+ delegate: suggestionsDelegate
+ }
+ }
+ }
+
+ Scrollbar {
+ flickableItem: suggestionsFlickable
+ align: Qt.AlignTrailing
}
}
}
-
- Component.onCompleted: searchBox.forceActiveFocus()
}
+
=== modified file 'KeyboardRectangle.qml'
--- KeyboardRectangle.qml 2016-02-03 19:53:46 +0000
+++ KeyboardRectangle.qml 2016-05-12 12:41:23 +0000
@@ -26,16 +26,7 @@
anchors.bottom: parent.bottom
height: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
- states: [
- State {
- name: "hidden"
- when: keyboardRect.height == 0
- },
- State {
- name: "shown"
- when: keyboardRect.height == Qt.inputMethod.keyboardRectangle.height
- }
- ]
+ property bool isVisible: Qt.inputMethod.visible
function recursiveFindFocusedItem(parent) {
if (parent.activeFocus) {
=== modified file 'NewEvent.qml'
--- NewEvent.qml 2016-04-06 18:46:29 +0000
+++ NewEvent.qml 2016-05-12 12:41:23 +0000
@@ -319,46 +319,69 @@
}
Keys.onEscapePressed: root.cancel()
+
header: PageHeader {
id: pageHeader
flickable: null
- title: isEdit ? i18n.tr("Edit Event"):i18n.tr("New Event")
- leadingActionBar.actions: Action {
- id: backAction
-
- name: "cancel"
- text: i18n.tr("Cancel")
- iconName: isEdit ? "back" : "down"
- onTriggered: root.cancel()
- }
-
- trailingActionBar.actions: [
- Action {
- text: i18n.tr("Delete");
- objectName: "delete"
- iconName: "delete"
- visible : isEdit
- onTriggered: {
- var dialog = PopupUtils.open(Qt.resolvedUrl("DeleteConfirmationDialog.qml"),root,{"event": event});
- dialog.deleteEvent.connect( function(eventId){
- model.removeItem(eventId);
- if (pageStack)
- pageStack.pop();
- root.eventDeleted(eventId);
- });
- }
- },
- Action {
- iconName: "ok"
- objectName: "save"
- text: i18n.tr("Save")
- enabled: !!titleEdit.text.trim()
- onTriggered: saveToQtPim();
- }
- ]
+ property Component delegate: Component {
+ AbstractButton {
+ id: button
+ action: modelData
+ width: label.width + units.gu(4)
+ height: parent.height
+ Rectangle {
+ color: parent.pressed ? UbuntuColors.coolGrey : UbuntuColors.slate
+ opacity: 0.1
+ anchors.fill: parent
+ visible: button.pressed
+ }
+ Label {
+ anchors.centerIn: parent
+ id: label
+ text: action.text
+ color: text === i18n.tr("Delete") ? UbuntuColors.red : Theme.palette.selected.fieldText
+ font.weight: text === i18n.tr("Save") ? Font.Normal : Font.Light
+ }
+ }
+ }
+ leadingActionBar {
+ anchors.leftMargin: 0
+ actions: Action {
+ text: i18n.tr("Cancel")
+ iconName: "close"
+ onTriggered: root.cancel()
+ }
+ delegate: pageHeader.delegate
+ }
+ trailingActionBar {
+ anchors.rightMargin: 0
+ actions: [
+ Action {
+ text: i18n.tr("Save")
+ iconName: "tick"
+ onTriggered: saveToQtPim();
+ },
+ Action {
+ text: i18n.tr("Delete")
+ iconName: "delete"
+ visible : isEdit
+ onTriggered: {
+ var dialog = PopupUtils.open(Qt.resolvedUrl("DeleteConfirmationDialog.qml"),root,{"event": event});
+ dialog.deleteEvent.connect( function(eventId){
+ model.removeItem(eventId);
+ if (pageStack)
+ pageStack.pop();
+ root.eventDeleted(eventId);
+ });
+ }
+ }
+ ]
+ delegate: pageHeader.delegate
+ }
}
+
Component{
id: errorDlgComponent
Dialog {
@@ -399,7 +422,7 @@
// if it is not, try to scroll and make it visible
var targetY = position.y + item.height - flickable.height
if (targetY >= 0 && position.y) {
- flickable.contentY = targetY;
+ flickable.contentY = targetY + units.gu(1);
} else if (position.y < flickable.contentY) {
// if it is hidden at the top, also show it
flickable.contentY = position.y;
@@ -407,6 +430,11 @@
flickable.returnToBounds()
}
+ // animation on flickable contentY change
+ Behavior on contentY {
+ UbuntuNumberAnimation {}
+ }
+
flickableDirection: Flickable.VerticalFlick
anchors{
left: parent.left
@@ -425,9 +453,8 @@
NewEventTimePicker{
id: startDateTimeInput
- objectName: "startDateTimeInput"
-
- header: i18n.tr("From")
+ //TRANSLATORS: this referes to date. eg: From: Wendsday, 9 March 2016
+ headerText: i18n.tr("From")
showTimePicker: !allDayEventCheckbox.checked
anchors {
left: parent.left
@@ -435,255 +462,264 @@
}
onDateTimeChanged: {
startDate = dateTime;
- endDateTimeInput.dateTime = new Date(startDate.getTime() + root.eventSize)
}
}
NewEventTimePicker{
id: endDateTimeInput
- objectName: "endDateTimeInput"
-
- header: i18n.tr("To")
+ //TRANSLATORS: this referes to date. eg: To: Wendsday, 9 March 2016
+ headerText: i18n.tr("To")
showTimePicker: !allDayEventCheckbox.checked
anchors {
left: parent.left
right: parent.right
}
onDateTimeChanged: {
- if (dateTime.getTime() < startDate.getTime()) {
- root.eventSize = root.allDay ? 0 : root.millisecsInAnHour
- dateTime = new Date(startDate.getTime() + root.eventSize)
- return
- }
-
endDate = dateTime;
- if (allDay)
- root.eventSize = endDate.midnight().getTime() - startDate.midnight().getTime()
- else
- root.eventSize = endDate.getTime() - startDate.getTime()
- }
- }
-
- ListItems.Standard {
- anchors {
- left: parent.left
- right: parent.right
- }
-
- text: i18n.tr("All day event")
- __foregroundColor: Theme.palette.normal.baseText
- showDivider: false
- control: CheckBox {
- objectName: "allDayEventCheckbox"
- id: allDayEventCheckbox
- checked: false
- onCheckedChanged: {
- if (checked)
- root.eventSize = Math.max(endDate.midnight().getTime() - startDate.midnight().getTime(), 0)
- else
- root.eventSize = Math.max(endDate.getTime() - startDate.getTime(), root.millisecsInAnHour)
- }
- }
- }
-
- ListItems.ThinDivider {}
-
- Column {
- width: parent.width
- spacing: units.gu(1)
-
- ListItems.Header{
- text: i18n.tr("Event Details")
- __foregroundColor: Theme.palette.normal.baseText
- }
-
- TextField {
- id: titleEdit
- objectName: "newEventName"
-
- anchors {
- left: parent.left
- right: parent.right
- margins: units.gu(2)
- }
-
- placeholderText: i18n.tr("Event Name")
- onFocusChanged: {
- if(titleEdit.focus) {
- flickable.makeMeVisible(titleEdit);
- }
- }
- }
-
- TextArea{
- id: messageEdit
- objectName: "eventDescriptionInput"
-
- anchors {
- left: parent.left
- right: parent.right
- margins: units.gu(2)
- }
-
- placeholderText: i18n.tr("Description")
- onFocusChanged: {
- if(messageEdit.focus) {
- flickable.makeMeVisible(messageEdit);
- }
- }
- }
-
- TextField {
- id: locationEdit
- objectName: "eventLocationInput"
-
- anchors {
- left: parent.left
- right: parent.right
- margins: units.gu(2)
- }
-
- inputMethodHints: Qt.ImhNoPredictiveText
- placeholderText: i18n.tr("Location")
-
- onFocusChanged: {
- if(locationEdit.focus) {
- flickable.makeMeVisible(locationEdit);
- }
- }
- }
- }
-
- Column {
- width: parent.width
- spacing: units.gu(1)
-
- ListItems.Header {
- text: i18n.tr("Calendar")
- __foregroundColor: Theme.palette.normal.baseText
- }
-
- OptionSelector{
- id: calendarsOption
- objectName: "calendarsOption"
-
- anchors {
- left: parent.left
- right: parent.right
- margins: units.gu(2)
- }
-
- containerHeight: itemHeight * 4
- model: root.model ? root.model.getWritableAndSelectedCollections() : []
-
- delegate: OptionSelectorDelegate{
- text: modelData.name
-
- UbuntuShape{
- id: calColor
- width: height
- height: parent.height - units.gu(2)
- color: modelData.color
- anchors {
- right: parent.right
- rightMargin: units.gu(4)
- verticalCenter: parent.verticalCenter
- }
- }
- }
- onExpandedChanged: Qt.inputMethod.hide();
- }
- }
-
- Column {
- width: parent.width
- spacing: units.gu(1)
-
- ListItems.Header {
- text: i18n.tr("Guests")
- __foregroundColor: Theme.palette.normal.baseText
- }
-
- Button{
- id: addGuestButton
- objectName: "addGuestButton"
-
- property var contactsPopup: null
-
- text: i18n.tr("Add Guest")
- anchors {
- left: parent.left
- right: parent.right
- margins: units.gu(2)
- }
-
- onClicked: {
- if (contactsPopup)
- return
-
- flickable.makeMeVisible(addGuestButton)
- contactsPopup = PopupUtils.open(Qt.resolvedUrl("ContactChoicePopup.qml"), addGuestButton);
- contactsPopup.contactSelected.connect( function(contact, emailAddress) {
- if(!internal.isContactAlreadyAdded(contact, emailAddress) ) {
- var t = internal.contactToAttendee(contact, emailAddress);
- contactModel.append({"contact": t});
- }
-
- });
- contactsPopup.Component.onDestruction.connect( function() {
- addGuestButton.contactsPopup = null
- })
- }
- }
-
- UbuntuShape {
- anchors {
- left: parent.left
- right: parent.right
- margins: units.gu(2)
- }
-
- height: contactList.height
-
- Column{
- id: contactList
- objectName: "guestList"
-
- spacing: units.gu(1)
- width: parent.width
- clip: true
-
- ListModel{
- id: contactModel
- }
-
- Repeater{
- model: contactModel
- delegate: ListItem {
- objectName: "eventGuest%1".arg(index)
-
- ListItemLayout {
- title.text: contact.name
- subtitle.text: contact.emailAddress
- }
-
- leadingActions: ListItemActions {
- actions: Action {
- iconName: "delete"
- onTriggered: {
- contactModel.remove(index)
- }
+ }
+ }
+
+ // All day event ListItem with Switch
+ ListItem {
+ width: parent.width
+
+ ListItemLayout {
+ title.text: i18n.tr("All day event")
+ Switch {
+ id: allDayEventCheckbox
+ checked: false
+ SlotsLayout.position: SlotsLayout.Trailing;
+ }
+ }
+ onClicked: {
+ allDayEventCheckbox.checked = !allDayEventCheckbox.checked
+ }
+
+ }
+
+ // ListItem which holds "Event details" label + TextField + TextArea + TextField
+ ListItem {
+ height: eventDetailsColumn.height + (eventDetailsColumn.anchors.margins*2)
+
+ Column {
+ id: eventDetailsColumn
+ spacing: units.gu(2)
+ anchors {
+ left: parent.left
+ right: parent.right
+ top: parent.top
+ margins: units.gu(2)
+ }
+
+ Label {
+ width: parent.width
+ text: i18n.tr("Event details")
+ elide: Text.ElideRight
+ }
+
+ TextField {
+ id: titleEdit
+ objectName: "newEventName"
+
+ width: parent.width
+ inputMethodHints: Qt.ImhNoPredictiveText
+ placeholderText: i18n.tr("Event Name")
+
+ onActiveFocusChanged: {
+ if(titleEdit.activeFocus) {
+ flickable.makeMeVisible(titleEdit);
+ }
+ }
+ }
+
+ TextArea{
+ id: messageEdit
+ objectName: "eventDescriptionInput"
+
+ width: parent.width
+ placeholderText: i18n.tr("Description")
+
+ onActiveFocusChanged: {
+ if(messageEdit.activeFocus) {
+ flickable.makeMeVisible(messageEdit);
+ }
+ }
+ }
+
+ TextField {
+ id: locationEdit
+ objectName: "eventLocationInput"
+
+ width: parent.width
+ inputMethodHints: Qt.ImhNoPredictiveText
+ placeholderText: i18n.tr("Location")
+
+ onActiveFocusChanged: {
+ if(locationEdit.activeFocus) {
+ flickable.makeMeVisible(locationEdit);
+ }
+ }
+ }
+ }
+ }
+
+ // ListItem to hold calendars selector
+ ListItem {
+ height: chooseCalendarColumn.height + (eventDetailsColumn.anchors.topMargin*2)
+
+ Column {
+ id: chooseCalendarColumn
+ spacing: units.gu(2)
+ anchors {
+ left: parent.left
+ right: parent.right
+ top: parent.top
+ topMargin: units.gu(2)
+ }
+
+ Label {
+ width: parent.width
+ anchors {
+ left: parent.left
+ leftMargin: units.gu(2)
+ right: parent.right
+ rightMargin: units.gu(2)
+ }
+ text: i18n.tr("Choose calendar")
+ elide: Text.ElideRight
+ }
+
+ ListItems.ItemSelector {
+ id: calendarsOption
+ model: root.model.getWritableCollections();
+ delegate: OptionSelectorDelegate { text: modelData.name }
+ }
+
+ }
+ }
+
+
+ // add guest field
+ ListItem {
+ id: addGuestListItem
+ height: addGusestColumn.height + (addGusestColumn.anchors.margins*2)
+
+ Column {
+ id: addGusestColumn
+ anchors {
+ left: parent.left
+ right: parent.right
+ top: parent.top
+ margins: units.gu(2)
+ }
+
+ Behavior on height {
+ UbuntuNumberAnimation {}
+ }
+
+ Label {
+ width: parent.width
+ text: i18n.tr("Event details")
+ elide: Text.ElideRight
+ }
+
+ Item {
+ width: parent.width
+ height: units.gu(1)
+ }
+
+ ListModel{
+ id: contactModel
+ }
+
+ Component {
+ id: addedGusestDelegate
+ Item {
+ width: delegateRow.width + units.gu(1)
+ height: units.gu(3)
+
+ Rectangle {
+ anchors.fill: parent
+ color: delegateMouseArea.pressed ? UbuntuColors.lightGrey : "transparent"
+ }
+
+ Row {
+ id: delegateRow
+ height: parent.height
+ spacing: units.gu(0.5)
+ anchors.horizontalCenter: parent.horizontalCenter
+
+ UbuntuShape {
+ id: rec
+ height: parent.height - units.gu(0.5)
+ anchors.verticalCenter: parent.verticalCenter
+ width: height
+ color: "green"
+ Text {
+ anchors.centerIn: parent
+ text: contact.name.charAt(0).toUpperCase()
+ font.bold: true
+ color: "white"
}
}
- }
- }
- }
- }
-
- ListItems.ThinDivider {
- visible: (event != undefined) && (event.itemType === Type.Event)
- }
-
+ Label {
+ id: lab
+ anchors.verticalCenter: parent.verticalCenter
+ text: contact.name
+ }
+ }
+
+ MouseArea {
+ id: delegateMouseArea
+ anchors.fill: parent
+ onClicked: contactModel.remove(index)
+
+ }
+ }
+ }
+
+ // Add guest section (this is now in development)
+ Item {
+ width: parent.width
+ height: suggestionsListView.height + units.gu(0.5)
+ Behavior on height {
+ UbuntuNumberAnimation {}
+ }
+
+ Flow {
+ id: suggestionsListView
+ width: parent.width
+ spacing: units.gu(1.5)
+ move: Transition {
+ NumberAnimation {
+ properties: "x,y"
+ }
+ }
+ add: Transition {
+ NumberAnimation {
+ properties: "x,y"
+ }
+ }
+
+ Repeater {
+ model: contactModel
+ delegate: addedGusestDelegate
+ }
+ }
+ }
+
+ ContactChoicePopup {
+ id: lol2
+ width: parent.width
+
+ onContactSelected: {
+ if(!internal.isContactAlreadyAdded(contact, emailAddress) ) {
+ var t = internal.contactToAttendee(contact, emailAddress);
+ contactModel.append({"contact": t});
+ }
+ }
+ }
+ }
}
ListItem {
@@ -768,6 +804,12 @@
}
}
+ // Scrollbar
+ Scrollbar{
+ flickableItem: flickable
+ align: Qt.AlignTrailing
+ }
+
// used to keep the field visible when the keyboard appear or dismiss
KeyboardRectangle {
id: keyboardRectangle
@@ -783,14 +825,7 @@
PauseAnimation { duration: 200 }
ScriptAction {
script: {
- if (addGuestButton.contactsPopup) {
- // WORKAROUND: causes the popover to follow the buttom position when keyboard appears
- flickable.makeMeVisible(addGuestButton)
- addGuestButton.contactsPopup.caller = null
- addGuestButton.contactsPopup.caller = addGuestButton
- } else {
- flickable.makeMeVisible(flickable.activeItem)
- }
+ flickable.makeMeVisible(flickable.activeItem)
}
}
}
@@ -827,8 +862,7 @@
return false;
}
- function attendeeFromData(id, name, emailAddress)
- {
+ function attendeeFromData(id, name, emailAddress) {
var attendee = Qt.createQmlObject("import QtOrganizer 5.0; EventAttendee{}", internal, "NewEvent.qml");
attendee.name = name
attendee.emailAddress = emailAddress
=== modified file 'NewEventTimePicker.qml'
--- NewEventTimePicker.qml 2016-03-22 20:09:08 +0000
+++ NewEventTimePicker.qml 2016-05-12 12:41:23 +0000
@@ -1,76 +1,107 @@
import QtQuick 2.4
-import Ubuntu.Components.ListItems 1.0 as ListItem
+import Ubuntu.Components 1.3
import Ubuntu.Components.Themes.Ambiance 1.0
-import Ubuntu.Components.Pickers 1.0
+import Ubuntu.Components.Pickers 1.3
-Column {
+ListItem {
id: dateTimeInput
- property alias header: listHeader.text
-
- property date dateTime;
- property bool showTimePicker;
+
+ property string headerText //header label ("From" or "To")
+ property date dateTime //keep date from DatePicker
+ property bool showTimePicker //if true then user is able to set time on event
+
+ // when new date set in DatePicker then this will be run.
+ onDateTimeChanged: {
+ layout.summary.text = dateTime.toLocaleDateString() // set date
+ secondLabel.text = Qt.formatTime(dateTime, "hh:mm AP").replace(/\./g, "") // set time
+ }
function clearFocus() {
- dateInput.focus = false;
- timeInput.focus = false;
+ dateBG.focus = false;
+ timeBG.focus = false;
}
+ // function to open date/time picker
function openDatePicker (element, caller, callerProperty, mode) {
element.highlighted = true;
var picker = PickerPanel.openDatePicker(caller, callerProperty, mode);
if (!picker) return;
- picker.closed.connect(function () {
- element.highlighted = false;
- });
- }
-
- onDateTimeChanged: {
- dateInput.text = dateTime.toLocaleDateString();
- timeInput.text = Qt.formatTime(dateTime);
- }
-
- ListItem.Header {
- id: listHeader
- __foregroundColor: Theme.palette.normal.baseText
- }
-
- Item {
- anchors {
- left: parent.left
- right: parent.right
- margins: units.gu(2)
- }
-
- height: dateInput.height
-
- NewEventEntryField{
- id: dateInput
- objectName: "dateInput"
-
- text: ""
- anchors.left: parent.left
- width: !showTimePicker ? parent.width : 4 * parent.width / 5
-
- MouseArea{
- anchors.fill: parent
- onClicked: openDatePicker(dateInput, dateTimeInput, "dateTime", "Years|Months|Days")
- }
- }
-
- NewEventEntryField{
- id: timeInput
- objectName: "timeInput"
-
- text: ""
- anchors.right: parent.right
- width: parent.width / 5
+ picker.closed.connect(function () { element.highlighted = false; });
+ }
+
+ height: layout.height + divider.height
+
+ // backgroud color of full date fabel, to be shown when user click on date and DatePicker is visable
+ Rectangle {
+ id: dateBG
+
+ property bool highlighted: false
+
+ height: layout.summary.height + units.gu(3.5)
+ width: showTimePicker ? layout.title.width + units.gu(3) : layout.width
+ anchors.bottom: parent.bottom
+ color: highlighted || abstractButtonDate.pressed ? UbuntuColors.lightGrey : "transparent"
+ }
+
+ // backgroud color of time label, to be shown when user click on date and DatePicker is visable
+ Rectangle {
+ id: timeBG
+
+ property bool highlighted: false
+
+ height: dateBG.height
+ width: slot.width + units.gu(4)
+ anchors.bottom: parent.bottom
+ anchors.right: parent.right
+ color: (highlighted || abstractButtonTime.pressed) ? UbuntuColors.lightGrey : "transparent"
+ }
+
+ // ListItemLayout to keep full date label and time label
+ ListItemLayout {
+ id: layout
+
+ title.text: headerText
+ title.color: Theme.palette.selected.overlayText
+ title.font.pixelSize: FontUtils.sizeToPixels("small")
+ subtitle.text: " "
+ summary.color: dateBG.highlighted ? "white" : Theme.palette.selected.fieldText
+ summary.font.pixelSize: FontUtils.sizeToPixels("medium")
+
+ // Item to hold Trailing tile label item
+ Item {
+ id: slot
+
+ width: secondLabel.width
+ height: parent.height
visible: showTimePicker
- horizontalAlignment: Text.AlignRight
-
- MouseArea{
- anchors.fill: parent
- onClicked: openDatePicker(timeInput, dateTimeInput, "dateTime", "Hours|Minutes")
+ SlotsLayout.overrideVerticalPositioning: true
+
+ // label to keep time [ 10:20 AM ]
+ Label {
+ id: secondLabel
+
+ fontSize: "medium"
+ color: timeBG.highlighted ? "white" : Theme.palette.selected.fieldText
+ y: layout.mainSlot.y + layout.summary.y + layout.summary.baselineOffset - baselineOffset
}
}
}
+
+ // AbstractButton to be triggered when user click on full date
+ AbstractButton {
+ id: abstractButtonDate
+
+ anchors.fill: dateBG
+ onClicked: { openDatePicker(dateBG, dateTimeInput, "dateTime", "Years|Months|Days")}
+ }
+
+ // AbstractButton to be triggered when user click on time
+ AbstractButton {
+ id: abstractButtonTime
+
+ anchors.fill: timeBG
+ visible: showTimePicker
+ onClicked: { openDatePicker(timeBG, dateTimeInput, "dateTime", "Hours|Minutes")}
+ }
+
}
=== modified file 'po/com.ubuntu.calendar.pot'
--- po/com.ubuntu.calendar.pot 2016-04-29 18:22:02 +0000
+++ po/com.ubuntu.calendar.pot 2016-05-12 12:41:23 +0000
@@ -8,7 +8,11 @@
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
+<<<<<<< TREE
"POT-Creation-Date: 2016-04-29 15:21-0300\n"
+=======
+"POT-Creation-Date: 2016-04-11 15:19+0100\n"
+>>>>>>> MERGE-SOURCE
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@xxxxxx>\n"
@@ -104,16 +108,16 @@
msgstr ""
#: ../ColorPickerDialog.qml:55 ../DeleteConfirmationDialog.qml:60
+<<<<<<< TREE
#: ../EditEventConfirmationDialog.qml:53 ../NewEvent.qml:331
+=======
+#: ../EditEventConfirmationDialog.qml:53 ../NewEvent.qml:351
+>>>>>>> MERGE-SOURCE
msgid "Cancel"
msgstr ""
-#: ../ContactChoicePopup.qml:37
-msgid "No contact"
-msgstr ""
-
-#: ../ContactChoicePopup.qml:96
-msgid "Search contact"
+#: ../ContactChoicePopup.qml:85
+msgid "Guests"
msgstr ""
#: ../DayView.qml:72 ../MonthView.qml:48 ../WeekView.qml:55 ../YearView.qml:57
@@ -154,11 +158,19 @@
msgid "Delete this"
msgstr ""
+<<<<<<< TREE
#: ../DeleteConfirmationDialog.qml:51 ../NewEvent.qml:338
+=======
+#: ../DeleteConfirmationDialog.qml:51 ../NewEvent.qml:343 ../NewEvent.qml:366
+>>>>>>> MERGE-SOURCE
msgid "Delete"
msgstr ""
+<<<<<<< TREE
#: ../EditEventConfirmationDialog.qml:29 ../NewEvent.qml:326
+=======
+#: ../EditEventConfirmationDialog.qml:29
+>>>>>>> MERGE-SOURCE
msgid "Edit Event"
msgstr ""
@@ -187,7 +199,11 @@
msgid "%1 - %2"
msgstr ""
+<<<<<<< TREE
#: ../EventDetails.qml:37 ../NewEvent.qml:496
+=======
+#: ../EventDetails.qml:37
+>>>>>>> MERGE-SOURCE
msgid "Event Details"
msgstr ""
@@ -195,15 +211,40 @@
msgid "Edit"
msgstr ""
+<<<<<<< TREE
#: ../EventDetails.qml:176 ../TimeLineHeader.qml:66
+=======
+#: ../EventDetails.qml:117
+msgid "Attending"
+msgstr ""
+
+#: ../EventDetails.qml:120
+msgid "Not Attending"
+msgstr ""
+
+#: ../EventDetails.qml:123
+msgid "Maybe"
+msgstr ""
+
+#: ../EventDetails.qml:126
+msgid "No Reply"
+msgstr ""
+
+#: ../EventDetails.qml:162 ../TimeLineHeader.qml:66
+>>>>>>> MERGE-SOURCE
msgid "All Day"
msgstr ""
+<<<<<<< TREE
#: ../EventDetails.qml:351 ../NewEvent.qml:562
#: com.ubuntu.calendar_calendar.desktop.in.in.h:1
+=======
+#: ../EventDetails.qml:334 com.ubuntu.calendar_calendar.desktop.in.in.h:1
+>>>>>>> MERGE-SOURCE
msgid "Calendar"
msgstr ""
+<<<<<<< TREE
#: ../EventDetails.qml:395
msgid "Attending"
msgstr ""
@@ -221,10 +262,17 @@
msgstr ""
#: ../EventDetails.qml:440 ../NewEvent.qml:528
+=======
+#: ../EventDetails.qml:391 ../NewEvent.qml:541
+>>>>>>> MERGE-SOURCE
msgid "Description"
msgstr ""
+<<<<<<< TREE
#: ../EventDetails.qml:467 ../NewEvent.qml:721 ../NewEvent.qml:760
+=======
+#: ../EventDetails.qml:409 ../NewEvent.qml:768 ../NewEvent.qml:807
+>>>>>>> MERGE-SOURCE
msgid "Reminder"
msgstr ""
@@ -247,7 +295,11 @@
#. TRANSLATORS: this refers to how often a recurrent event repeats
#. and it is shown as the header of the option selector to choose
#. its repetition
+<<<<<<< TREE
#: ../EventRepetition.qml:242 ../NewEvent.qml:697
+=======
+#: ../EventRepetition.qml:242 ../NewEvent.qml:744
+>>>>>>> MERGE-SOURCE
msgid "Repeats"
msgstr ""
@@ -292,7 +344,11 @@
#. TRANSLATORS: This is shown in the month view as "Wk" as a title
#. to indicate the week numbers. It should be a max of up to 3 characters.
+<<<<<<< TREE
#: ../MonthComponent.qml:281
+=======
+#: ../MonthComponent.qml:316
+>>>>>>> MERGE-SOURCE
msgid "Wk"
msgstr ""
@@ -305,48 +361,96 @@
msgid "End time can't be before start time"
msgstr ""
+<<<<<<< TREE
#: ../NewEvent.qml:326 ../NewEventBottomEdge.qml:53
msgid "New Event"
msgstr ""
#: ../NewEvent.qml:355
+=======
+#: ../NewEvent.qml:344 ../NewEvent.qml:361
+>>>>>>> MERGE-SOURCE
msgid "Save"
msgstr ""
+<<<<<<< TREE
#: ../NewEvent.qml:366
+=======
+#: ../NewEvent.qml:389
+>>>>>>> MERGE-SOURCE
msgid "Error"
msgstr ""
+<<<<<<< TREE
#: ../NewEvent.qml:368
+=======
+#: ../NewEvent.qml:391
+>>>>>>> MERGE-SOURCE
msgid "OK"
msgstr ""
+<<<<<<< TREE
#: ../NewEvent.qml:430
+=======
+#. TRANSLATORS: this referes to date. eg: To: Wendsday, 9 March 2016
+#: ../NewEvent.qml:457
+>>>>>>> MERGE-SOURCE
msgid "From"
msgstr ""
+<<<<<<< TREE
#: ../NewEvent.qml:446
+=======
+#. TRANSLATORS: this referes to date. eg: From: Wendsday, 9 March 2016
+#: ../NewEvent.qml:471
+>>>>>>> MERGE-SOURCE
msgid "To"
msgstr ""
+<<<<<<< TREE
#: ../NewEvent.qml:473
+=======
+#: ../NewEvent.qml:487
+>>>>>>> MERGE-SOURCE
msgid "All day event"
msgstr ""
+<<<<<<< TREE
#: ../NewEvent.qml:510
+=======
+#: ../NewEvent.qml:517 ../NewEvent.qml:624
+msgid "Event details"
+msgstr ""
+
+#: ../NewEvent.qml:527
+>>>>>>> MERGE-SOURCE
msgid "Event Name"
msgstr ""
+<<<<<<< TREE
#: ../NewEvent.qml:547
+=======
+#: ../NewEvent.qml:556
+>>>>>>> MERGE-SOURCE
msgid "Location"
msgstr ""
+<<<<<<< TREE
#: ../NewEvent.qml:603
msgid "Guests"
+=======
+#: ../NewEvent.qml:589
+msgid "Choose calendar"
+>>>>>>> MERGE-SOURCE
msgstr ""
+<<<<<<< TREE
#: ../NewEvent.qml:613
msgid "Add Guest"
+=======
+#: ../NewEventBottomEdge.qml:53
+msgid "New Event"
+>>>>>>> MERGE-SOURCE
msgstr ""
#: ../RecurrenceLabelDefines.qml:23
Follow ups