Keyboard shortcuts

This commit is contained in:
Julien Wadel 2024-07-31 14:49:36 +02:00
parent 4143d15f34
commit ab64d0479a
46 changed files with 2696 additions and 1854 deletions

View file

@ -1,4 +0,0 @@
<svg width="32" height="20" viewBox="0 0 32 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="32" height="20" rx="10" fill="#9AABB5"/>
<circle cx="10" cy="10" r="6" fill="white"/>
</svg>

Before

Width:  |  Height:  |  Size: 202 B

View file

@ -1,4 +0,0 @@
<svg width="32" height="20" viewBox="0 0 32 20" fill="none" xmlns="http://www.w3.org/2000/svg">
<rect width="32" height="20" rx="10" fill="#4FAE80"/>
<circle cx="22" cy="10" r="6" fill="white"/>
</svg>

Before

Width:  |  Height:  |  Size: 202 B

View file

@ -280,9 +280,9 @@ AppWindow {
id: callStatusText id: callStatusText
text: (mainWindow.callState === LinphoneEnums.CallState.End || mainWindow.callState === LinphoneEnums.CallState.Released) text: (mainWindow.callState === LinphoneEnums.CallState.End || mainWindow.callState === LinphoneEnums.CallState.Released)
? qsTr("End of the call") ? qsTr("End of the call")
: mainWindow.call && mainWindow.call.core.paused : mainWindow.call && (mainWindow.call.core.paused
|| (mainWindow.callState === LinphoneEnums.CallState.Paused || (mainWindow.callState === LinphoneEnums.CallState.Paused
|| mainWindow.callState === LinphoneEnums.CallState.PausedByRemote) || mainWindow.callState === LinphoneEnums.CallState.PausedByRemote))
? (mainWindow.conference ? qsTr('Réunion mise ') : qsTr('Appel mis')) + qsTr(" en pause") ? (mainWindow.conference ? qsTr('Réunion mise ') : qsTr('Appel mis')) + qsTr(" en pause")
: mainWindow.conference : mainWindow.conference
? mainWindow.conference.core.subject ? mainWindow.conference.core.subject
@ -348,8 +348,9 @@ AppWindow {
visible: mainWindow.call && mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning visible: mainWindow.call && mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning
imageSource: mainWindow.call imageSource: mainWindow.call
? mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Srtp ? mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Srtp
? AppIcons.lockSimple ? AppIcons.lockSimple
: mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp : mainWindow.call && mainWindow.call.core.encryption === LinphoneEnums.MediaEncryption.Zrtp
? mainWindow.call.core.isMismatch || !mainWindow.call.core.tokenVerified ? mainWindow.call.core.isMismatch || !mainWindow.call.core.tokenVerified
? AppIcons.warningCircle ? AppIcons.warningCircle
: AppIcons.lockKey : AppIcons.lockKey
@ -500,6 +501,12 @@ AppWindow {
id: contactsListPanel id: contactsListPanel
Item { Item {
Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("Transfert d'appel") Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("Transfert d'appel")
Keys.onPressed: (event)=> {
if (event.key == Qt.Key_Escape) {
rightPanel.visible = false
event.accepted = true;
}
}
CallContactsLists { CallContactsLists {
id: callcontactslist id: callcontactslist
anchors.fill: parent anchors.fill: parent
@ -520,6 +527,12 @@ AppWindow {
ColumnLayout { ColumnLayout {
Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("Dialer") Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("Dialer")
spacing: 0 spacing: 0
Keys.onPressed: (event)=> {
if (event.key == Qt.Key_Escape) {
rightPanel.visible = false
event.accepted = true;
}
}
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
@ -559,8 +572,14 @@ AppWindow {
} }
Component { Component {
id: changeLayoutPanel id: changeLayoutPanel
Item { FocusScope {
Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("Modifier la disposition") Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("Modifier la disposition")
Keys.onPressed: (event)=> {
if (event.key == Qt.Key_Escape) {
rightPanel.visible = false
event.accepted = true;
}
}
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
anchors.topMargin: 16 * DefaultStyle.dp anchors.topMargin: 16 * DefaultStyle.dp
@ -631,6 +650,12 @@ AppWindow {
rightPanel.headerTitleText = qsTr("Liste d'appel") rightPanel.headerTitleText = qsTr("Liste d'appel")
rightPanel.customHeaderButtons = mergeCallPopupButton.createObject(rightPanel) rightPanel.customHeaderButtons = mergeCallPopupButton.createObject(rightPanel)
} }
Keys.onPressed: (event)=> {
if (event.key == Qt.Key_Escape) {
rightPanel.visible = false
event.accepted = true;
}
}
spacing: 0 spacing: 0
Component { Component {
id: mergeCallPopupButton id: mergeCallPopupButton
@ -725,6 +750,10 @@ AppWindow {
popup.contentItem: ColumnLayout { popup.contentItem: ColumnLayout {
spacing: 0 spacing: 0
Button { Button {
id: pausingButton
onClicked: modelData.core.lSetPaused(!modelData.core.paused)
KeyNavigation.up: endCallButton
KeyNavigation.down: endCallButton
background: Item {} background: Item {}
contentItem: RowLayout { contentItem: RowLayout {
spacing: 5 * DefaultStyle.dp spacing: 5 * DefaultStyle.dp
@ -743,16 +772,18 @@ AppWindow {
|| modelData.core.state === LinphoneEnums.CallState.PausedByRemote || modelData.core.state === LinphoneEnums.CallState.PausedByRemote
? qsTr("Reprendre l'appel") : qsTr("Mettre en pause") ? qsTr("Reprendre l'appel") : qsTr("Mettre en pause")
color: DefaultStyle.main2_500main color: DefaultStyle.main2_500main
font.bold: pausingButton.shadowEnabled
} }
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
onClicked: {
modelData.core.lSetPaused(!modelData.core.paused)
}
} }
Button { Button {
id: endCallButton
onClicked: mainWindow.endCall(modelData)
KeyNavigation.up: pausingButton
KeyNavigation.down: pausingButton
background: Item {} background: Item {}
contentItem: RowLayout { contentItem: RowLayout {
spacing: 5 * DefaultStyle.dp spacing: 5 * DefaultStyle.dp
@ -765,12 +796,12 @@ AppWindow {
Text { Text {
color: DefaultStyle.danger_500main color: DefaultStyle.danger_500main
text: qsTr("Terminer l'appel") text: qsTr("Terminer l'appel")
font.bold: endCallButton.shadowEnabled
} }
Item { Item {
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
onClicked: mainWindow.endCall(modelData)
} }
} }
} }
@ -789,6 +820,12 @@ AppWindow {
Control.StackView.onActivated: { Control.StackView.onActivated: {
rightPanel.headerTitleText = qsTr("Paramètres") rightPanel.headerTitleText = qsTr("Paramètres")
} }
Keys.onPressed: (event)=> {
if (event.key == Qt.Key_Escape) {
rightPanel.visible = false
event.accepted = true;
}
}
InCallSettingsPanel { InCallSettingsPanel {
id: inSettingsPanel id: inSettingsPanel
call: mainWindow.call call: mainWindow.call
@ -804,6 +841,12 @@ AppWindow {
id: screencastPanel id: screencastPanel
Item { Item {
Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("Partage de votre écran") Control.StackView.onActivated: rightPanel.headerTitleText = qsTr("Partage de votre écran")
Keys.onPressed: (event)=> {
if (event.key == Qt.Key_Escape) {
rightPanel.visible = false
event.accepted = true;
}
}
ScreencastPanel { ScreencastPanel {
anchors.fill: parent anchors.fill: parent
anchors.topMargin: 16 * DefaultStyle.dp anchors.topMargin: 16 * DefaultStyle.dp
@ -817,6 +860,12 @@ AppWindow {
Component { Component {
id: participantListPanel id: participantListPanel
Item { Item {
Keys.onPressed: (event)=> {
if (event.key == Qt.Key_Escape) {
rightPanel.visible = false
event.accepted = true;
}
}
Control.StackView { Control.StackView {
id: participantsStack id: participantsStack
anchors.fill: parent anchors.fill: parent

View file

@ -31,6 +31,7 @@ Rectangle {
Layout.fillWidth: true Layout.fillWidth: true
} }
Button { Button {
id: aboutButton
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
background: Item{} background: Item{}
contentItem: RowLayout { contentItem: RowLayout {
@ -45,6 +46,7 @@ Rectangle {
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
text: qsTr("À propos") text: qsTr("À propos")
font { font {
underline: aboutButton.underline
pixelSize: 14 * DefaultStyle.dp pixelSize: 14 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp weight: 400 * DefaultStyle.dp
} }

View file

@ -119,6 +119,11 @@ Item {
closeContextualMenuComponent() closeContextualMenuComponent()
} }
} }
Keys.onPressed: (event)=>{
if(event.key == Qt.Key_Right){
mainStackView.currentItem.forceActiveFocus()
}
}
} }
ColumnLayout { ColumnLayout {
spacing:0 spacing:0
@ -138,6 +143,9 @@ Item {
if (text.length != 0) listPopup.open() if (text.length != 0) listPopup.open()
else listPopup.close() else listPopup.close()
} }
KeyNavigation.down: contactList.count > 0 ? contactList : contactList.footerItem
KeyNavigation.up: contactList.footerItem
component MagicSearchButton: Button { component MagicSearchButton: Button {
id: button id: button
width: 45 * DefaultStyle.dp width: 45 * DefaultStyle.dp
@ -159,7 +167,9 @@ Item {
Popup { Popup {
id: listPopup id: listPopup
width: magicSearchBar.width width: magicSearchBar.width
height: Math.min(magicSearchContent.contentHeight + topPadding + bottomPadding, 400 * DefaultStyle.dp) property int maxHeight: 400 * DefaultStyle.dp
property bool displayScrollbar: contactList.contentHeight + topPadding + bottomPadding> maxHeight
height: Math.min(contactList.contentHeight + topPadding + bottomPadding, maxHeight)
y: magicSearchBar.height y: magicSearchBar.height
// closePolicy: Popup.NoAutoClose // closePolicy: Popup.NoAutoClose
topPadding: 20 * DefaultStyle.dp topPadding: 20 * DefaultStyle.dp
@ -174,6 +184,9 @@ Item {
radius: 16 * DefaultStyle.dp radius: 16 * DefaultStyle.dp
color: DefaultStyle.grey_0 color: DefaultStyle.grey_0
anchors.fill: parent anchors.fill: parent
border.color: DefaultStyle.main1_500_main
border.width: contactList.activeFocus ? 2 : 0
} }
MultiEffect { MultiEffect {
source: popupBg source: popupBg
@ -183,94 +196,139 @@ Item {
shadowColor: DefaultStyle.grey_1000 shadowColor: DefaultStyle.grey_1000
shadowOpacity: 0.1 shadowOpacity: 0.1
} }
} ScrollBar {
contentItem: Control.ScrollView {
id: magicSearchContent
contentWidth: width
contentHeight: content.height
Control.ScrollBar.vertical: ScrollBar {
id: scrollbar id: scrollbar
policy: Control.ScrollBar.AsNeeded Component.onCompleted: x = -10 * DefaultStyle.dp
policy: Control.ScrollBar.AsNeeded// Don't work as expected
visible: listPopup.displayScrollbar
interactive: true interactive: true
height: magicSearchContent.availableHeight anchors.top: parent.top
anchors.top: listPopup.top anchors.bottom: parent.bottom
anchors.bottom: listPopup.bottom
anchors.right: parent.right anchors.right: parent.right
anchors.margins: 10 * DefaultStyle.dp
} }
ColumnLayout { }
id: content contentItem: ContactsList {
spacing: 10 * DefaultStyle.dp id: contactList
width: magicSearchContent.width - scrollbar.width - 5 * DefaultStyle.dp visible: magicSearchBar.text.length != 0
Text { Layout.preferredHeight: contentHeight
visible: contactList.count > 0 Layout.fillWidth: true
text: qsTr("Contact") Layout.rightMargin: 5 * DefaultStyle.dp
color: DefaultStyle.main2_500main initialHeadersVisible: false
font { contactMenuVisible: false
pixelSize: 13 * DefaultStyle.dp actionLayoutVisible: true
weight: 700 * DefaultStyle.dp selectionEnabled: false
Control.ScrollBar.vertical: scrollbar
model: MagicSearchProxy {
searchText: magicSearchBar.text.length === 0 ? "*" : magicSearchBar.text
aggregationFlag: LinphoneEnums.MagicSearchAggregation.Friend
}
Keys.onPressed: (event) => {
if(event.key == Qt.Key_Down){
if(contactList.currentIndex == contactList.count -1) {
contactList.currentIndex = -1
contactList.footerItem.forceActiveFocus()
event.accepted = true
}
} else if(event.key == Qt.Key_Up){
if(contactList.currentIndex <= 0) {
contactList.currentIndex = -1
contactList.footerItem.forceActiveFocus()
event.accepted = true
} }
} }
ContactsList { }
id: contactList header: Text {
visible: magicSearchBar.text.length != 0 visible: contactList.count > 0
Layout.preferredHeight: contentHeight text: qsTr("Contact")
Layout.fillWidth: true color: DefaultStyle.main2_500main
Layout.rightMargin: 5 * DefaultStyle.dp font {
initialHeadersVisible: false pixelSize: 13 * DefaultStyle.dp
contactMenuVisible: false weight: 700 * DefaultStyle.dp
actionLayoutVisible: true
selectionEnabled: false
Control.ScrollBar.vertical.visible: false
model: MagicSearchProxy {
searchText: magicSearchBar.text.length === 0 ? "*" : magicSearchBar.text
aggregationFlag: LinphoneEnums.MagicSearchAggregation.Friend
}
} }
Text { }
text: qsTr("Suggestion") footer: FocusScope{
color: DefaultStyle.main2_500main id: suggestionFocusScope
font { width: contactList.width
pixelSize: 13 * DefaultStyle.dp height: content.implicitHeight
weight: 700 * DefaultStyle.dp onActiveFocusChanged: if(activeFocus) contactList.positionViewAtEnd()
} Rectangle{
anchors.left: parent.left
anchors.right: parent.right
anchors.bottom: parent.bottom
height: suggestionRow.implicitHeight
color: suggestionFocusScope.activeFocus ? DefaultStyle.numericPadPressedButtonColor : 'transparent'
} }
RowLayout { ColumnLayout {
Layout.fillWidth: true id: content
Layout.rightMargin: 5 * DefaultStyle.dp anchors.fill: parent
spacing: 10 * DefaultStyle.dp anchors.rightMargin: 5 * DefaultStyle.dp
Avatar {
Layout.preferredWidth: 45 * DefaultStyle.dp spacing: 10 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp Text {
address: magicSearchBar.text text: qsTr("Suggestion")
color: DefaultStyle.main2_500main
font {
pixelSize: 13 * DefaultStyle.dp
weight: 700 * DefaultStyle.dp
}
} }
ColumnLayout {
Text { Keys.onPressed: (event) => {
text: magicSearchBar.text if(contactList.count <= 0) return;
font { if(event.key == Qt.Key_Down){
pixelSize: 12 * DefaultStyle.dp contactList.currentIndex = 0
weight: 300 * DefaultStyle.dp event.accepted = true
} else if(event.key == Qt.Key_Up){
contactList.currentIndex = contactList.count - 1
event.accepted = true
}
}
RowLayout {
id: suggestionRow
spacing: 10 * DefaultStyle.dp
Avatar {
Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp
address: magicSearchBar.text
}
ColumnLayout {
Text {
text: magicSearchBar.text
font {
pixelSize: 12 * DefaultStyle.dp
weight: 300 * DefaultStyle.dp
}
} }
} }
} Item {
Item { Layout.fillWidth: true
Layout.fillWidth: true }
} MagicSearchButton {
MagicSearchButton { id: callButton
Layout.preferredWidth: 45 * DefaultStyle.dp Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp Layout.preferredHeight: 45 * DefaultStyle.dp
icon.source: AppIcons.phone icon.source: AppIcons.phone
onClicked: { focus: true
UtilsCpp.createCall(magicSearchBar.text) onClicked: {
magicSearchBar.clearText() UtilsCpp.createCall(magicSearchBar.text)
magicSearchBar.clearText()
}
KeyNavigation.right: chatButton
KeyNavigation.left: chatButton
}
MagicSearchButton {
id: chatButton
// TODO : visible true when chat available
// visible: false
Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp
icon.source: AppIcons.chatTeardropText
KeyNavigation.right: callButton
KeyNavigation.left: callButton
} }
}
MagicSearchButton {
// TODO : visible true when chat available
// visible: false
Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp
icon.source: AppIcons.chatTeardropText
} }
} }
} }
@ -281,7 +339,6 @@ Item {
spacing: 10 * DefaultStyle.dp spacing: 10 * DefaultStyle.dp
PopupButton { PopupButton {
id: avatarButton id: avatarButton
background.visible: false
Layout.preferredWidth: 54 * DefaultStyle.dp Layout.preferredWidth: 54 * DefaultStyle.dp
Layout.preferredHeight: width Layout.preferredHeight: width
popup.padding: 14 * DefaultStyle.dp popup.padding: 14 * DefaultStyle.dp
@ -300,57 +357,111 @@ Item {
} }
} }
PopupButton { PopupButton {
id: settingsButton id: settingsMenuButton
Layout.preferredWidth: 24 * DefaultStyle.dp Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp Layout.preferredHeight: 24 * DefaultStyle.dp
popup.width: 271 * DefaultStyle.dp popup.width: 271 * DefaultStyle.dp
popup.padding: 14 * DefaultStyle.dp popup.padding: 14 * DefaultStyle.dp
popup.contentItem: ColumnLayout { popup.contentItem: FocusScope {
spacing: 20 * DefaultStyle.dp id: popupFocus
IconLabelButton { implicitHeight: settingsButtons.implicitHeight
Layout.preferredHeight: 32 * DefaultStyle.dp Keys.onPressed: (event)=> {
visible: !SettingsCpp.hideAccountSettings if (event.key == Qt.Key_Left || event.key == Qt.Key_Escape) {
iconSize: 32 * DefaultStyle.dp settingsMenuButton.popup.close()
text: qsTr("Mon compte") event.accepted = true;
iconSource: AppIcons.manageProfile }
onClicked: openContextualMenuComponent(myAccountSettingsPageComponent)
} }
IconLabelButton { ColumnLayout {
Layout.preferredHeight: 32 * DefaultStyle.dp id: settingsButtons
visible: !SettingsCpp.hideSettings anchors.fill: parent
iconSize: 32 * DefaultStyle.dp spacing: 20 * DefaultStyle.dp
text: qsTr("Paramètres")
iconSource: AppIcons.settings function getPreviousItem(index){
onClicked: openContextualMenuComponent(settingsPageComponent) if(visibleChildren.length == 0) return null
} --index
IconLabelButton { while(index >= 0){
Layout.preferredHeight: 32 * DefaultStyle.dp if( index!= 4 && children[index].visible) return children[index]
visible: !SettingsCpp.disableCallRecordingsFeature --index
iconSize: 32 * DefaultStyle.dp }
text: qsTr("Enregistrements") return getPreviousItem(children.length)
iconSource: AppIcons.micro }
} function getNextItem(index){
IconLabelButton { ++index
Layout.preferredHeight: 32 * DefaultStyle.dp while(index < children.length){
iconSize: 32 * DefaultStyle.dp if( index!= 4 && children[index].visible) return children[index]
text: qsTr("Aide") ++index
iconSource: AppIcons.question }
onClicked: openContextualMenuComponent(helpPageComponent) return getNextItem(-1)
} }
Rectangle {
Layout.fillWidth: true IconLabelButton {
Layout.preferredHeight: 1 * DefaultStyle.dp id: accountButton
visible: addAccountButton.visible Layout.preferredHeight: 32 * DefaultStyle.dp
color: DefaultStyle.main2_400 Layout.fillWidth: true
} visible: !SettingsCpp.hideAccountSettings
IconLabelButton { focus: visible
id: addAccountButton iconSize: 32 * DefaultStyle.dp
Layout.preferredHeight: 32 * DefaultStyle.dp text: qsTr("Mon compte")
visible: SettingsCpp.maxAccount == 0 || SettingsCpp.maxAccount > accountProxy.count iconSource: AppIcons.manageProfile
iconSize: 32 * DefaultStyle.dp onClicked: openContextualMenuComponent(myAccountSettingsPageComponent)
text: qsTr("Ajouter un compte") KeyNavigation.up: visibleChildren.length != 0 ? settingsButtons.getPreviousItem(0) : null
iconSource: AppIcons.plusCircle KeyNavigation.down: visibleChildren.length != 0 ? settingsButtons.getNextItem(0) : null
onClicked: mainItem.addAccountRequest() }
IconLabelButton {
id: settingsButton
Layout.preferredHeight: 32 * DefaultStyle.dp
Layout.fillWidth: true
visible: !SettingsCpp.hideSettings
focus: !accountButton.visible && visible
iconSize: 32 * DefaultStyle.dp
text: qsTr("Paramètres")
iconSource: AppIcons.settings
onClicked: openContextualMenuComponent(settingsPageComponent)
KeyNavigation.up: visibleChildren.length != 0 ? settingsButtons.getPreviousItem(1) : null
KeyNavigation.down: visibleChildren.length != 0 ? settingsButtons.getNextItem(1) : null
}
IconLabelButton {
id: recordsButton
Layout.preferredHeight: 32 * DefaultStyle.dp
Layout.fillWidth: true
visible: !SettingsCpp.disableCallRecordingsFeature
focus: !accountButton.visible && !settingsButton.visible && visible
iconSize: 32 * DefaultStyle.dp
text: qsTr("Enregistrements")
iconSource: AppIcons.micro
KeyNavigation.up: visibleChildren.length != 0 ? settingsButtons.getPreviousItem(2) : null
KeyNavigation.down: visibleChildren.length != 0 ? settingsButtons.getNextItem(2) : null
}
IconLabelButton {
id: helpButton
Layout.preferredHeight: 32 * DefaultStyle.dp
Layout.fillWidth: true
iconSize: 32 * DefaultStyle.dp
focus: !accountButton.visible && !settingsButton.visible && !recordsButton.visible
text: qsTr("Aide")
iconSource: AppIcons.question
onClicked: openContextualMenuComponent(helpPageComponent)
KeyNavigation.up: visibleChildren.length != 0 ? settingsButtons.getPreviousItem(3) : null
KeyNavigation.down: visibleChildren.length != 0 ? settingsButtons.getNextItem(3) : null
}
Rectangle {
Layout.fillWidth: true
Layout.preferredHeight: 1 * DefaultStyle.dp
visible: addAccountButton.visible
color: DefaultStyle.main2_400
}
IconLabelButton {
id: addAccountButton
Layout.preferredHeight: 32 * DefaultStyle.dp
Layout.fillWidth: true
visible: SettingsCpp.maxAccount == 0 || SettingsCpp.maxAccount > accountProxy.count
iconSize: 32 * DefaultStyle.dp
text: qsTr("Ajouter un compte")
iconSource: AppIcons.plusCircle
onClicked: mainItem.addAccountRequest()
KeyNavigation.up: visibleChildren.length != 0 ? settingsButtons.getPreviousItem(5) : null
KeyNavigation.down: visibleChildren.length != 0 ? settingsButtons.getNextItem(5) : null
}
} }
} }
} }
@ -361,6 +472,7 @@ Item {
StackLayout { StackLayout {
id: mainStackLayout id: mainStackLayout
currentIndex: tabbar.currentIndex currentIndex: tabbar.currentIndex
onActiveFocusChanged: if(activeFocus) children[currentIndex].forceActiveFocus()
CallPage { CallPage {
id: callPage id: callPage
Connections { Connections {

View file

@ -62,7 +62,6 @@ list(APPEND _LINPHONEAPP_QML_FILES
view/Item/Carousel.qml view/Item/Carousel.qml
view/Item/CheckableButton.qml view/Item/CheckableButton.qml
view/Item/CheckBox.qml view/Item/CheckBox.qml
view/Item/SwitchButton.qml
view/Item/ComboBox.qml view/Item/ComboBox.qml
view/Item/DesktopPopup.qml view/Item/DesktopPopup.qml
view/Item/Dialog.qml view/Item/Dialog.qml

View file

@ -1,5 +1,5 @@
import QtQuick 2.7 import QtQuick
import QtQuick.Controls.Basic 2.2 as Control import QtQuick.Controls.Basic as Control
import QtQuick.Effects import QtQuick.Effects
import QtQuick.Layouts import QtQuick.Layouts
import Linphone import Linphone
@ -16,17 +16,19 @@ Control.Button {
property int textWeight: 600 * DefaultStyle.dp property int textWeight: 600 * DefaultStyle.dp
property int radius: 48 * DefaultStyle.dp property int radius: 48 * DefaultStyle.dp
property color textColor: DefaultStyle.grey_0 property color textColor: DefaultStyle.grey_0
property bool underline: false property bool underline: mainItem.activeFocus || containsMouse
property bool shadowEnabled: false property bool shadowEnabled: mainItem.activeFocus || containsMouse
property var contentImageColor property var contentImageColor
property alias containsMouse: mouseArea.containsMouse
hoverEnabled: true hoverEnabled: true
activeFocusOnTab: true
// leftPadding: 20 * DefaultStyle.dp // leftPadding: 20 * DefaultStyle.dp
// rightPadding: 20 * DefaultStyle.dp // rightPadding: 20 * DefaultStyle.dp
// topPadding: 11 * DefaultStyle.dp // topPadding: 11 * DefaultStyle.dp
// bottomPadding: 11 * DefaultStyle.dp // bottomPadding: 11 * DefaultStyle.dp
MouseArea { MouseArea {
id: mouseArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
@ -39,10 +41,10 @@ Control.Button {
id: buttonBackground id: buttonBackground
color: mainItem.enabled color: mainItem.enabled
? inversedColors ? inversedColors
? mainItem.pressed ? mainItem.pressed || mainItem.shadowEnabled
? DefaultStyle.grey_100 ? DefaultStyle.grey_100
: mainItem.borderColor : mainItem.borderColor
: mainItem.pressed : mainItem.pressed || mainItem.shadowEnabled
? mainItem.pressedColor ? mainItem.pressedColor
: mainItem.color : mainItem.color
: mainItem.disabledColor : mainItem.disabledColor
@ -59,10 +61,12 @@ Control.Button {
enabled: mainItem.shadowEnabled enabled: mainItem.shadowEnabled
anchors.fill: buttonBackground anchors.fill: buttonBackground
source: buttonBackground source: buttonBackground
shadowEnabled: mainItem.shadowEnabled visible: mainItem.shadowEnabled
// Crash : https://bugreports.qt.io/browse/QTBUG-124730
shadowEnabled: true //mainItem.shadowEnabled
shadowColor: DefaultStyle.grey_1000 shadowColor: DefaultStyle.grey_1000
shadowBlur: 1 shadowBlur: 1
shadowOpacity: 0.1 shadowOpacity: mainItem.shadowEnabled ? 0.5 : 0.0
} }
} }
@ -83,6 +87,7 @@ Control.Button {
family: DefaultStyle.defaultFont family: DefaultStyle.defaultFont
capitalization: mainItem.capitalization capitalization: mainItem.capitalization
underline: mainItem.underline underline: mainItem.underline
bold: mainItem.font.bold
} }
} }
@ -93,6 +98,7 @@ Control.Button {
imageWidth: mainItem.icon.width imageWidth: mainItem.icon.width
imageHeight: mainItem.icon.height imageHeight: mainItem.icon.height
colorizationColor: mainItem.contentImageColor colorizationColor: mainItem.contentImageColor
shadowEnabled: mainItem.shadowEnabled
} }
contentItem: StackLayout { contentItem: StackLayout {

View file

@ -1,5 +1,5 @@
import QtQuick 2.7 import QtQuick
import QtQuick.Layouts 1.3 import QtQuick.Layouts
import QtQuick.Controls as Control import QtQuick.Controls as Control
import QtQuick.Effects import QtQuick.Effects
@ -23,6 +23,8 @@ ListView {
property int currentYear: calendarModel.yearAt(currentIndex) property int currentYear: calendarModel.yearAt(currentIndex)
onCurrentYearChanged: console.log("currentyear", currentYear) onCurrentYearChanged: console.log("currentyear", currentYear)
onCurrentMonthChanged: console.log("current month", currentMonth) onCurrentMonthChanged: console.log("current month", currentMonth)
currentIndex: 0
keyNavigationEnabled: false
model: Control.CalendarModel { model: Control.CalendarModel {
id: calendarModel id: calendarModel
@ -30,104 +32,156 @@ ListView {
to: UtilsCpp.addYears(new Date(), 5) to: UtilsCpp.addYears(new Date(), 5)
} }
delegate: ColumnLayout { delegate: FocusScope{
width: mainItem.width width: mainItem.width
height: mainItem.height height: mainItem.height
property int currentMonth: model.month property bool isCurrentIndex: index == mainItem.currentIndex
spacing: 18 * DefaultStyle.dp onIsCurrentIndexChanged: if( isCurrentIndex) monthGrid.forceActiveFocus()
RowLayout {
Layout.fillWidth: true
spacing: 38 * DefaultStyle.dp
Text {
text: UtilsCpp.toDateMonthAndYearString(new Date(model.year, model.month, 15))// 15 because of timezones that can change the date for localeString
font {
pixelSize: 14 * DefaultStyle.dp
weight: 700 * DefaultStyle.dp
capitalization: Font.Capitalize
}
}
Item {
Layout.fillWidth: true
}
Button {
Layout.preferredWidth: 20 * DefaultStyle.dp
Layout.preferredHeight: 20 * DefaultStyle.dp
icon.width: width
icon.height: height
background: Item{}
icon.source: AppIcons.leftArrow
onClicked: if (mainItem.currentIndex > 0) mainItem.currentIndex = mainItem.currentIndex - 1
}
Button {
Layout.preferredWidth: 20 * DefaultStyle.dp
Layout.preferredHeight: 20 * DefaultStyle.dp
icon.width: width
icon.height: height
background: Item{}
icon.source: AppIcons.rightArrow
onClicked: if (mainItem.currentIndex < mainItem.count) mainItem.currentIndex = mainItem.currentIndex + 1
}
}
ColumnLayout { ColumnLayout {
spacing: 12 * DefaultStyle.dp anchors.fill: parent
Control.DayOfWeekRow { property int currentMonth: model.month
locale: monthGrid.locale spacing: 18 * DefaultStyle.dp
Layout.column: 1 RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
delegate: Text { spacing: 38 * DefaultStyle.dp
text: model.shortName Text {
color: DefaultStyle.main2_400 text: UtilsCpp.toDateMonthAndYearString(new Date(model.year, model.month, 15))// 15 because of timezones that can change the date for localeString
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
font { font {
pixelSize: 12 * DefaultStyle.dp pixelSize: 14 * DefaultStyle.dp
weight: 300 * DefaultStyle.dp weight: 700 * DefaultStyle.dp
capitalization: Font.Capitalize
} }
} }
Item {
Layout.fillWidth: true
}
Button {
id: previousButton
Layout.preferredWidth: 20 * DefaultStyle.dp
Layout.preferredHeight: 20 * DefaultStyle.dp
icon.width: width
icon.height: height
background: Item{}
icon.source: AppIcons.leftArrow
onClicked: if (mainItem.currentIndex > 0) mainItem.currentIndex = mainItem.currentIndex - 1
}
Button {
id: nextButton
Layout.preferredWidth: 20 * DefaultStyle.dp
Layout.preferredHeight: 20 * DefaultStyle.dp
icon.width: width
icon.height: height
background: Item{}
icon.source: AppIcons.rightArrow
onClicked: if (mainItem.currentIndex < mainItem.count) mainItem.currentIndex = mainItem.currentIndex + 1
}
} }
Control.MonthGrid { ColumnLayout {
id: monthGrid spacing: 12 * DefaultStyle.dp
Layout.fillWidth: true Control.DayOfWeekRow {
Layout.fillHeight: true locale: monthGrid.locale
year: model.year Layout.column: 1
month: model.month Layout.fillWidth: true
property var curDate: model.date delegate: Text {
onMonthChanged: console.log("cur date changed", month) text: model.shortName
locale: Qt.locale(ConstantsCpp.DefaultLocale) color: DefaultStyle.main2_400
delegate: Item { horizontalAlignment: Text.AlignHCenter
property bool isSelectedDay: mainItem.selectedDate ? UtilsCpp.datesAreEqual(mainItem.selectedDate, model.date) : false verticalAlignment: Text.AlignVCenter
// width: 30 * DefaultStyle.dp
// height: 30 * DefaultStyle.dp
Rectangle {
anchors.centerIn: parent
width: 30 * DefaultStyle.dp
height: 30 * DefaultStyle.dp
radius: 50 * DefaultStyle.dp
color: isSelectedDay ? DefaultStyle.main1_500_main : "transparent"
}
Text {
anchors.centerIn: parent
text: UtilsCpp.toDateDayString(model.date)
color: isSelectedDay
? DefaultStyle.grey_0
: UtilsCpp.isCurrentDay(model.date)
? DefaultStyle.main1_500_main
: UtilsCpp.dateisInMonth(model.date, mainItem.currentMonth, mainItem.currentYear)
? DefaultStyle.main2_700
: DefaultStyle.main2_400
font { font {
pixelSize: 12 * DefaultStyle.dp pixelSize: 12 * DefaultStyle.dp
weight: 300 * DefaultStyle.dp weight: 300 * DefaultStyle.dp
} }
} }
} }
onClicked: (date) => {
if (UtilsCpp.isBeforeToday(date)) return; Control.MonthGrid {
mainItem.selectedDate = date id: monthGrid
Layout.fillWidth: true
Layout.fillHeight: true
year: model.year
month: model.month
property var curDate: model.date
onMonthChanged: {
console.log("cur date changed", month)
}
locale: Qt.locale(ConstantsCpp.DefaultLocale)
delegate: FocusScope {
id: focusDay
property bool isSelectedDay: mainItem.selectedDate ? UtilsCpp.datesAreEqual(mainItem.selectedDate, model.date) : false
property var d: model.date
objectName: 'focusDay'
// width: 30 * DefaultStyle.dp
// height: 30 * DefaultStyle.dp
activeFocusOnTab: true
focus: index == 0
Keys.onPressed: (event)=> {
if (event.key == Qt.Key_Space || event.key == Qt.Key_Enter || event.key == Qt.Key_Return) {
monthGrid.clicked(model.date)
event.accepted = true;
}else if(event.key == Qt.Key_Left){
var previous = nextItemInFocusChain(false)
if( previous.objectName != 'focusDay'){
previousButton.clicked(undefined)
}else{
previous.forceActiveFocus()
}
}else if(event.key == Qt.Key_Right){
var next = nextItemInFocusChain()
console.log(next.objectName)
if( next.objectName != 'focusDay'){
nextButton.clicked(undefined)
} else {
next.forceActiveFocus()
}
}
}
MouseArea{
id: hoveringArea
anchors.fill: parent
hoverEnabled: true
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
acceptedButtons: Qt.LeftButton
onPressed: (event) =>{
focusDay.forceActiveFocus()
event.accepted = false
}
}
Rectangle {
anchors.centerIn: parent
width: 30 * DefaultStyle.dp
height: 30 * DefaultStyle.dp
radius: 50 * DefaultStyle.dp
color: isSelectedDay ? DefaultStyle.main1_500_main : "transparent"
border.color: DefaultStyle.main1_500_main_darker
border.width: focusDay.activeFocus || hoveringArea.containsMouse ? 1 : 0
}
Text {
anchors.centerIn: parent
text: UtilsCpp.toDateDayString(model.date)
color: isSelectedDay
? DefaultStyle.grey_0
: UtilsCpp.isCurrentDay(model.date)
? DefaultStyle.main1_500_main
: UtilsCpp.dateisInMonth(model.date, mainItem.currentMonth, mainItem.currentYear)
? DefaultStyle.main2_700
: DefaultStyle.main2_400
font {
pixelSize: 12 * DefaultStyle.dp
weight: 300 * DefaultStyle.dp
}
}
}
onClicked: (date) => {
if (UtilsCpp.isBeforeToday(date)) return;
mainItem.selectedDate = date
}
} }
} }
} }
} }
} }

View file

@ -22,6 +22,7 @@ ComboBox {
} }
} }
popup: Control.Popup { popup: Control.Popup {
id: popupItem
y: mainItem.height y: mainItem.height
width: 321 * DefaultStyle.dp width: 321 * DefaultStyle.dp
height: 270 * DefaultStyle.dp height: 270 * DefaultStyle.dp
@ -30,6 +31,7 @@ ComboBox {
bottomPadding: 24 * DefaultStyle.dp bottomPadding: 24 * DefaultStyle.dp
leftPadding: 21 * DefaultStyle.dp leftPadding: 21 * DefaultStyle.dp
rightPadding: 19 * DefaultStyle.dp rightPadding: 19 * DefaultStyle.dp
onOpened: calendar.forceActiveFocus()
background: Item { background: Item {
anchors.fill: parent anchors.fill: parent
Rectangle { Rectangle {
@ -37,6 +39,8 @@ ComboBox {
anchors.fill: parent anchors.fill: parent
color: DefaultStyle.grey_0 color: DefaultStyle.grey_0
radius: 16 * DefaultStyle.dp radius: 16 * DefaultStyle.dp
border.color: DefaultStyle.main1_500_main
border.width: calendar.activeFocus? 1 : 0
} }
MultiEffect { MultiEffect {
anchors.fill: calendarBg anchors.fill: calendarBg
@ -50,4 +54,4 @@ ComboBox {
id: calendar id: calendar
} }
} }
} }

View file

@ -7,16 +7,18 @@ import Linphone
import UtilsCpp import UtilsCpp
import SettingsCpp import SettingsCpp
Item { FocusScope {
id: mainItem id: mainItem
property bool groupCallVisible property bool groupCallVisible
property color searchBarColor: DefaultStyle.grey_100 property color searchBarColor: DefaultStyle.grey_100
property color searchBarBorderColor: "transparent" property color searchBarBorderColor: "transparent"
property alias searchBar: searchBar property alias searchBar: searchBar
signal callButtonPressed(string address)
signal groupCallCreationRequested()
property FriendGui selectedContact property FriendGui selectedContact
property NumericPad numPad property NumericPad numPad
signal callButtonPressed(string address)
signal callSelectedContact()
signal groupCallCreationRequested()
clip: true clip: true
Control.Control { Control.Control {
@ -33,10 +35,12 @@ Item {
Layout.alignment: Qt.AlignTop Layout.alignment: Qt.AlignTop
Layout.fillWidth: true Layout.fillWidth: true
Layout.maximumWidth: mainItem.width Layout.maximumWidth: mainItem.width
focus: true
color: mainItem.searchBarColor color: mainItem.searchBarColor
borderColor: mainItem.searchBarBorderColor borderColor: mainItem.searchBarBorderColor
placeholderText: qsTr("Rechercher un contact") placeholderText: qsTr("Rechercher un contact")
numericPad: mainItem.numPad numericPad: mainItem.numPad
KeyNavigation.down: grouCallButton
} }
Control.ScrollView { Control.ScrollView {
Layout.fillWidth: true Layout.fillWidth: true
@ -60,9 +64,13 @@ Item {
width: parent.width width: parent.width
spacing: 32 * DefaultStyle.dp spacing: 32 * DefaultStyle.dp
Button { Button {
id: grouCallButton
visible: mainItem.groupCallVisible && !SettingsCpp.disableMeetingsFeature visible: mainItem.groupCallVisible && !SettingsCpp.disableMeetingsFeature
Layout.preferredWidth: 320 * DefaultStyle.dp Layout.preferredWidth: 320 * DefaultStyle.dp
padding: 0 padding: 0
KeyNavigation.up: searchBar
KeyNavigation.down: contactList.count >0 ? contactList : searchList
onClicked: mainItem.groupCallCreationRequested()
background: Rectangle { background: Rectangle {
gradient: Gradient { gradient: Gradient {
orientation: Gradient.Horizontal orientation: Gradient.Horizontal
@ -87,6 +95,7 @@ Item {
font { font {
pixelSize: 16 * DefaultStyle.dp pixelSize: 16 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp weight: 800 * DefaultStyle.dp
underline: grouCallButton.shadowEnabled
} }
} }
Item { Item {
@ -98,7 +107,6 @@ Item {
Layout.preferredHeight: 24 * DefaultStyle.dp Layout.preferredHeight: 24 * DefaultStyle.dp
} }
} }
onClicked: mainItem.groupCallCreationRequested()
} }
ColumnLayout { ColumnLayout {
spacing: 18 * DefaultStyle.dp spacing: 18 * DefaultStyle.dp
@ -120,6 +128,7 @@ Item {
searchText: searchBar.text.length === 0 ? "*" : searchBar.text searchText: searchBar.text.length === 0 ? "*" : searchBar.text
} }
onSelectedContactChanged: mainItem.selectedContact = selectedContact onSelectedContactChanged: mainItem.selectedContact = selectedContact
onClicked: mainItem.callSelectedContact()
} }
} }
ColumnLayout { ColumnLayout {
@ -132,6 +141,7 @@ Item {
} }
} }
ContactsList{ ContactsList{
id: searchList
contactMenuVisible: false contactMenuVisible: false
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
@ -145,6 +155,7 @@ Item {
aggregationFlag: LinphoneEnums.MagicSearchAggregation.Friend aggregationFlag: LinphoneEnums.MagicSearchAggregation.Friend
} }
onSelectedContactChanged: mainItem.selectedContact = selectedContact onSelectedContactChanged: mainItem.selectedContact = selectedContact
onClicked: mainItem.callSelectedContact()
} }
} }
Item { Item {

View file

@ -1,24 +1,40 @@
import QtQuick 2.7 import QtQuick
import QtQuick.Controls 2.2 as Control import QtQuick.Controls as Control
import Linphone import Linphone
import QtQuick.Effects
Control.CheckBox { Control.CheckBox {
id: mainItem id: mainItem
property bool shadowEnabled: mainItem.activeFocus || mainItem.hovered
indicator: Rectangle { indicator: Item{
implicitWidth: 20 * DefaultStyle.dp implicitWidth: 20 * DefaultStyle.dp
implicitHeight: 20 * DefaultStyle.dp implicitHeight: 20 * DefaultStyle.dp
x: (parent.width - width) / 2 x: (parent.width - width) / 2
y: (parent.height - height) / 2 y: (parent.height - height) / 2
radius: 3 * DefaultStyle.dp Rectangle {
border.color: DefaultStyle.main1_500_main id: backgroundArea
border.width: 2.2 * DefaultStyle.dp anchors.fill: parent
// color: mainItem.checked ? DefaultStyle.main1_500_main : "transparent" radius: 3 * DefaultStyle.dp
EffectImage { border.color: DefaultStyle.main1_500_main
visible: mainItem.checked border.width: 2.2 * DefaultStyle.dp
imageSource: AppIcons.check // color: mainItem.checked ? DefaultStyle.main1_500_main : "transparent"
colorizationColor: DefaultStyle.main1_500_main EffectImage {
anchors.fill: parent visible: mainItem.checked
imageSource: AppIcons.check
colorizationColor: DefaultStyle.main1_500_main
anchors.fill: parent
}
}
MultiEffect {
enabled: mainItem.shadowEnabled
anchors.fill: backgroundArea
source: backgroundArea
visible: mainItem.shadowEnabled
// Crash : https://bugreports.qt.io/browse/QTBUG-124730
shadowEnabled: true //mainItem.shadowEnabled
shadowColor: DefaultStyle.grey_1000
shadowBlur: 1
shadowOpacity: mainItem.shadowEnabled ? 0.5 : 0.0
} }
} }
} }

View file

@ -17,6 +17,7 @@ Control.ComboBox {
property int weight: 400 * DefaultStyle.dp property int weight: 400 * DefaultStyle.dp
property int leftMargin: 10 * DefaultStyle.dp property int leftMargin: 10 * DefaultStyle.dp
property bool oneLine: false property bool oneLine: false
property bool shadowEnabled: mainItem.activeFocus || mainItem.hovered
onConstantImageSourceChanged: if (constantImageSource) selectedItemImg.source = constantImageSource onConstantImageSourceChanged: if (constantImageSource) selectedItemImg.source = constantImageSource
onCurrentIndexChanged: { onCurrentIndexChanged: {
@ -33,12 +34,37 @@ Control.ComboBox {
? item.img ? item.img
: "" : ""
} }
Keys.onPressed: (event)=>{
if(!mainItem.contentItem.activeFocus && (event.key == Qt.Key_Space || event.key == Qt.Key_Enter || event.key == Qt.Key_Return)){
mainItem.popup.open()
event.accepted = true
}
}
background: Rectangle { background: Item{
anchors.fill: mainItem Rectangle {
radius: 63 * DefaultStyle.dp id: buttonBackground
color: mainItem.enabled ? DefaultStyle.grey_100 : DefaultStyle.grey_200 anchors.fill: parent
border.color: mainItem.enabled ? DefaultStyle.grey_200 : DefaultStyle.grey_400 radius: 63 * DefaultStyle.dp
color: mainItem.enabled ? DefaultStyle.grey_100 : DefaultStyle.grey_200
border.color: mainItem.enabled
? mainItem.activeFocus
? DefaultStyle.main1_500_main
: DefaultStyle.grey_200
: DefaultStyle.grey_400
}
MultiEffect {
enabled: mainItem.shadowEnabled
anchors.fill: buttonBackground
source: buttonBackground
visible: mainItem.shadowEnabled
// Crash : https://bugreports.qt.io/browse/QTBUG-124730
shadowEnabled: true //mainItem.shadowEnabled
shadowColor: DefaultStyle.grey_1000
shadowBlur: 0.5
shadowOpacity: mainItem.shadowEnabled ? 0.1 : 0.0
}
} }
contentItem: Item { contentItem: Item {
anchors.fill: parent anchors.fill: parent
@ -105,8 +131,12 @@ Control.ComboBox {
width: mainItem.width width: mainItem.width
implicitHeight: contentItem.implicitHeight implicitHeight: contentItem.implicitHeight
padding: 1 * DefaultStyle.dp padding: 1 * DefaultStyle.dp
height: Math.min(listView.contentHeight, 300) //height: Math.min(implicitHeight, 300)
onOpened: {
listView.positionViewAtIndex(listView.currentIndex, ListView.Center)
listView.forceActiveFocus()
}
contentItem: ListView { contentItem: ListView {
id: listView id: listView
clip: true clip: true
@ -123,6 +153,14 @@ Control.ComboBox {
radius: 15 * DefaultStyle.dp radius: 15 * DefaultStyle.dp
y: listView.currentItem? listView.currentItem.y : 0 y: listView.currentItem? listView.currentItem.y : 0
} }
Keys.onPressed: (event)=>{
if(event.key == Qt.Key_Space || event.key == Qt.Key_Enter || event.key == Qt.Key_Return){
event.accepted = true
mainItem.currentIndex = listView.currentIndex
popup.close()
}
}
delegate: Item { delegate: Item {
width:mainItem.width width:mainItem.width
@ -163,6 +201,7 @@ Control.ComboBox {
} }
MouseArea { MouseArea {
id: mouseArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
Rectangle { Rectangle {
@ -182,9 +221,7 @@ Control.ComboBox {
Control.ScrollIndicator.vertical: Control.ScrollIndicator { } Control.ScrollIndicator.vertical: Control.ScrollIndicator { }
} }
onOpened: {
listView.positionViewAtIndex(listView.currentIndex, ListView.Center)
}
background: Item { background: Item {
implicitWidth: mainItem.width implicitWidth: mainItem.width

View file

@ -66,7 +66,7 @@ RightPanelLayout {
content: ColumnLayout { content: ColumnLayout {
anchors.fill: parent anchors.fill: parent
spacing: 63 * DefaultStyle.dp spacing : 0
ColumnLayout { ColumnLayout {
spacing: 8 * DefaultStyle.dp spacing: 8 * DefaultStyle.dp
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
@ -78,23 +78,27 @@ RightPanelLayout {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
} }
IconLabelButton { IconLabelButton {
id: addPictureButton
visible: !mainItem.contact || mainItem.contact.core.pictureUri.length === 0 visible: !mainItem.contact || mainItem.contact.core.pictureUri.length === 0
Layout.preferredWidth: width Layout.preferredWidth: width
Layout.preferredHeight: 17 * DefaultStyle.dp Layout.preferredHeight: 17 * DefaultStyle.dp
iconSource: AppIcons.camera iconSource: AppIcons.camera
iconSize: 17 * DefaultStyle.dp iconSize: 17 * DefaultStyle.dp
text: qsTr("Ajouter une image") text: qsTr("Ajouter une image")
KeyNavigation.down: editButton.visible ? editButton : givenNameEdit
onClicked: fileDialog.open() onClicked: fileDialog.open()
} }
RowLayout { RowLayout {
visible: mainItem.contact && mainItem.contact.core.pictureUri.length != 0 visible: mainItem.contact && mainItem.contact.core.pictureUri.length != 0
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
IconLabelButton { IconLabelButton {
id: editButton
Layout.preferredWidth: width Layout.preferredWidth: width
Layout.preferredHeight: 17 * DefaultStyle.dp Layout.preferredHeight: 17 * DefaultStyle.dp
iconSource: AppIcons.pencil iconSource: AppIcons.pencil
iconSize: 17 * DefaultStyle.dp iconSize: 17 * DefaultStyle.dp
text: qsTr("Modifier") text: qsTr("Modifier")
KeyNavigation.down: givenNameEdit
onClicked: fileDialog.open() onClicked: fileDialog.open()
} }
FileDialog { FileDialog {
@ -109,11 +113,13 @@ RightPanelLayout {
} }
} }
IconLabelButton { IconLabelButton {
id: removeButton
Layout.preferredHeight: 17 * DefaultStyle.dp Layout.preferredHeight: 17 * DefaultStyle.dp
Layout.preferredWidth: width Layout.preferredWidth: width
iconSize: 17 * DefaultStyle.dp iconSize: 17 * DefaultStyle.dp
iconSource: AppIcons.trashCan iconSource: AppIcons.trashCan
text: qsTr("Supprimer") text: qsTr("Supprimer")
KeyNavigation.down: givenNameEdit
onClicked: mainItem.contact.core.pictureUri = "" onClicked: mainItem.contact.core.pictureUri = ""
} }
} }
@ -122,8 +128,8 @@ RightPanelLayout {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
Layout.topMargin: 50 * DefaultStyle.dp Layout.topMargin: 63 * DefaultStyle.dp
Layout.bottomMargin: 50 * DefaultStyle.dp Layout.bottomMargin: 78 * DefaultStyle.dp
spacing: 100 * DefaultStyle.dp spacing: 100 * DefaultStyle.dp
Flickable { Flickable {
Layout.preferredWidth: contentWidth Layout.preferredWidth: contentWidth
@ -146,30 +152,49 @@ RightPanelLayout {
onTextEdited: contact.core.givenName = text onTextEdited: contact.core.givenName = text
backgroundColor: DefaultStyle.grey_0 backgroundColor: DefaultStyle.grey_0
backgroundBorderColor: givenName.errorTextItem.opacity != 0 ? DefaultStyle.danger_500main : DefaultStyle.grey_200 backgroundBorderColor: givenName.errorTextItem.opacity != 0 ? DefaultStyle.danger_500main : DefaultStyle.grey_200
KeyNavigation.up: editButton.visible ? editButton : addPictureButton
KeyNavigation.down: nameTextField
} }
} }
FormItemLayout { FormItemLayout {
label: qsTr("Nom") label: qsTr("Nom")
contentItem: TextField { contentItem: TextField {
id: nameTextField
initialText: contact.core.familyName initialText: contact.core.familyName
onTextEdited: contact.core.familyName = text onTextEdited: contact.core.familyName = text
backgroundColor: DefaultStyle.grey_0 backgroundColor: DefaultStyle.grey_0
KeyNavigation.up: givenNameEdit
KeyNavigation.down: companyTextField
} }
} }
FormItemLayout { FormItemLayout {
label: qsTr("Entreprise") label: qsTr("Entreprise")
contentItem: TextField { contentItem: TextField {
id: companyTextField
initialText: contact.core.organization initialText: contact.core.organization
onTextEdited: contact.core.organization = text onTextEdited: contact.core.organization = text
backgroundColor: DefaultStyle.grey_0 backgroundColor: DefaultStyle.grey_0
KeyNavigation.up: nameTextField
KeyNavigation.down: jobTextField
} }
} }
FormItemLayout { FormItemLayout {
label: qsTr("Fonction") label: qsTr("Fonction")
contentItem: TextField { contentItem: TextField {
id: jobTextField
initialText: contact.core.job initialText: contact.core.job
onTextEdited: contact.core.job = text onTextEdited: contact.core.job = text
backgroundColor: DefaultStyle.grey_0 backgroundColor: DefaultStyle.grey_0
KeyNavigation.up: companyTextField
Keys.onPressed: (event) => {
if(event.key == Qt.Key_Down){
if(addressesList.count > 0)
addressesList.itemAt(0).forceActiveFocus()
else
newAddressTextField.forceActiveFocus()
event.accepted = true
}
}
} }
} }
Item{Layout.fillHeight: true} Item{Layout.fillHeight: true}
@ -218,8 +243,25 @@ RightPanelLayout {
delegate: FormItemLayout { delegate: FormItemLayout {
label: modelData.label label: modelData.label
contentItem: RowLayout { contentItem: RowLayout {
id: addressLayout
spacing: 10 * DefaultStyle.dp spacing: 10 * DefaultStyle.dp
function updateFocus(event){
if(event.key == Qt.Key_Up){
if(index - 1 >=0 )
addressesList.itemAt(index - 1).forceActiveFocus()
else
jobTextField.forceActiveFocus()
event.accepted = true
}else if(event.key == Qt.Key_Down){
if(index + 1 < addressesList.count)
addressesList.itemAt(index+1).forceActiveFocus()
else
newAddressTextField.forceActiveFocus()
event.accepted = true
}
}
TextField { TextField {
id: addressTextField
onTextEdited: { onTextEdited: {
if (text.length != 0) mainItem.contact.core.setAddressAt(index, qsTr("Adresse SIP"), text) if (text.length != 0) mainItem.contact.core.setAddressAt(index, qsTr("Adresse SIP"), text)
} }
@ -228,8 +270,12 @@ RightPanelLayout {
backgroundColor: DefaultStyle.grey_0 backgroundColor: DefaultStyle.grey_0
Layout.preferredWidth: width Layout.preferredWidth: width
Layout.preferredHeight: height Layout.preferredHeight: height
focus: true
KeyNavigation.right: removeAddressButton
Keys.onPressed: (event) => addressLayout.updateFocus(event)
} }
Button { Button {
id: removeAddressButton
Layout.preferredWidth: 24 * DefaultStyle.dp Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp Layout.preferredHeight: 24 * DefaultStyle.dp
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
@ -239,6 +285,8 @@ RightPanelLayout {
height: 24 * DefaultStyle.dp height: 24 * DefaultStyle.dp
icon.width: 24 * DefaultStyle.dp icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp icon.height: 24 * DefaultStyle.dp
KeyNavigation.left: addressTextField
Keys.onPressed: (event) => addressLayout.updateFocus(event)
onClicked: mainItem.contact.core.removeAddress(index) onClicked: mainItem.contact.core.removeAddress(index)
} }
} }
@ -250,12 +298,28 @@ RightPanelLayout {
FormItemLayout { FormItemLayout {
label: qsTr("Adresse SIP") label: qsTr("Adresse SIP")
contentItem: TextField { contentItem: TextField {
id: newAddressTextField
backgroundColor: DefaultStyle.grey_0 backgroundColor: DefaultStyle.grey_0
Component.onCompleted: text = "sip:" Keys.onPressed: (event) => {
if(event.key == Qt.Key_Up){
if(addressesList.count > 0 )
addressesList.itemAt(addressesList.count - 1).forceActiveFocus()
else
jobTextField.forceActiveFocus()
event.accepted = true
}else if(event.key == Qt.Key_Down){
if(phoneNumberList.count > 0)
phoneNumberList.itemAt(0).forceActiveFocus()
else
phoneNumberInputTextField.forceActiveFocus()
event.accepted = true
}
}
onEditingFinished: { onEditingFinished: {
if (text.length != 0) mainItem.contact.core.appendAddress(text) if (text.length != 0) mainItem.contact.core.appendAddress(text)
text = "sip:" text = "sip:"
} }
Component.onCompleted: text = "sip:"
} }
} }
Item { Item {
@ -272,8 +336,25 @@ RightPanelLayout {
delegate: FormItemLayout { delegate: FormItemLayout {
label: modelData.label label: modelData.label
contentItem: RowLayout { contentItem: RowLayout {
id: phoneNumberLayout
spacing: 10 * DefaultStyle.dp spacing: 10 * DefaultStyle.dp
function updateFocus(event){
if(event.key == Qt.Key_Up){
if(index - 1 >=0 )
phoneNumberList.itemAt(index - 1).forceActiveFocus()
else
newAddressTextField.forceActiveFocus()
event.accepted = true
}else if(event.key == Qt.Key_Down){
if(index + 1 < phoneNumberList.count)
addressesList.phoneNumberList(index+1).forceActiveFocus()
else
phoneNumberInputTextField.forceActiveFocus()
event.accepted = true
}
}
TextField { TextField {
id: phoneTextField
initialText: modelData.address initialText: modelData.address
onTextEdited: { onTextEdited: {
if (text.length != 0) mainItem.contact.core.setPhoneNumberAt(index, qsTr("Téléphone"), text) if (text.length != 0) mainItem.contact.core.setPhoneNumberAt(index, qsTr("Téléphone"), text)
@ -281,8 +362,12 @@ RightPanelLayout {
backgroundColor: DefaultStyle.grey_0 backgroundColor: DefaultStyle.grey_0
Layout.preferredWidth: width Layout.preferredWidth: width
Layout.preferredHeight: height Layout.preferredHeight: height
focus: true
KeyNavigation.right: removePhoneButton
Keys.onPressed: (event) => phoneNumberLayout.updateFocus(event)
} }
Button { Button {
id: removePhoneButton
Layout.preferredWidth: 24 * DefaultStyle.dp Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp Layout.preferredHeight: 24 * DefaultStyle.dp
Layout.alignment: Qt.AlignVCenter Layout.alignment: Qt.AlignVCenter
@ -292,6 +377,8 @@ RightPanelLayout {
height: 24 * DefaultStyle.dp height: 24 * DefaultStyle.dp
icon.width: 24 * DefaultStyle.dp icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp icon.height: 24 * DefaultStyle.dp
KeyNavigation.left: phoneTextField
Keys.onPressed: (event) => phoneNumberLayout.updateFocus(event)
onClicked: mainItem.contact.core.removePhoneNumber(index) onClicked: mainItem.contact.core.removePhoneNumber(index)
} }
} }
@ -304,7 +391,23 @@ RightPanelLayout {
id: phoneNumberInput id: phoneNumberInput
label: qsTr("Phone") label: qsTr("Phone")
contentItem: TextField { contentItem: TextField {
id: phoneNumberInputTextField
backgroundColor: DefaultStyle.grey_0 backgroundColor: DefaultStyle.grey_0
Keys.onPressed: (event) => {
if(event.key == Qt.Key_Up){
if(phoneNumberList.count > 0 )
phoneNumberList.itemAt(phoneNumberList.count - 1).forceActiveFocus()
else
newAddressTextField.forceActiveFocus()
event.accepted = true
}else if(event.key == Qt.Key_Down){
if(saveButton.enabled)
saveButton.forceActiveFocus()
else
givenNameEdit.forceActiveFocus()
event.accepted = true
}
}
onEditingFinished: { onEditingFinished: {
if (text.length != 0) mainItem.contact.core.appendPhoneNumber(phoneNumberInput.label, text) if (text.length != 0) mainItem.contact.core.appendPhoneNumber(phoneNumberInput.label, text)
text = "" text = ""
@ -328,6 +431,7 @@ RightPanelLayout {
} }
Button { Button {
id: saveButton
Layout.bottomMargin: 100 * DefaultStyle.dp Layout.bottomMargin: 100 * DefaultStyle.dp
Layout.preferredWidth: 165 * DefaultStyle.dp Layout.preferredWidth: 165 * DefaultStyle.dp
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
@ -337,6 +441,8 @@ RightPanelLayout {
rightPadding: 20 * DefaultStyle.dp rightPadding: 20 * DefaultStyle.dp
topPadding: 11 * DefaultStyle.dp topPadding: 11 * DefaultStyle.dp
bottomPadding: 11 * DefaultStyle.dp bottomPadding: 11 * DefaultStyle.dp
KeyNavigation.up: phoneNumberInputTextField
KeyNavigation.down: givenNameEdit
onClicked: { onClicked: {
if (givenNameEdit.text.length === 0 || (addressesList.count === 0 && phoneNumberList.count === 0)) { if (givenNameEdit.text.length === 0 || (addressesList.count === 0 && phoneNumberList.count === 0)) {
if (givenNameEdit.text.length === 0) givenName.errorMessage = qsTr("Veuillez saisir un prénom") if (givenNameEdit.text.length === 0) givenName.errorMessage = qsTr("Veuillez saisir un prénom")

View file

@ -11,6 +11,7 @@ ListView {
height: contentHeight height: contentHeight
visible: contentHeight > 0 visible: contentHeight > 0
clip: true clip: true
//keyNavigationWraps: true
// rightMargin: 5 * DefaultStyle.dp // rightMargin: 5 * DefaultStyle.dp
property string searchBarText property string searchBarText
@ -47,6 +48,7 @@ ListView {
signal contactStarredChanged() signal contactStarredChanged()
signal contactDeletionRequested(FriendGui contact) signal contactDeletionRequested(FriendGui contact)
signal contactAddedToSelection() signal contactAddedToSelection()
signal clicked()
function selectContact(address) { function selectContact(address) {
var index = magicSearchProxy.findFriendIndexByAddress(address) var index = magicSearchProxy.findFriendIndexByAddress(address)
@ -69,9 +71,11 @@ ListView {
selectedContacts.splice(indexInSelection, 1) selectedContacts.splice(indexInSelection, 1)
} }
} }
onActiveFocusChanged: if(activeFocus && (!footerItem || !footerItem.activeFocus)) {
currentIndex = 0
}else {
currentIndex = -1
}
model: MagicSearchProxy { model: MagicSearchProxy {
id: magicSearchProxy id: magicSearchProxy
searchText: searchBarText.length === 0 ? "*" : searchBarText searchText: searchBarText.length === 0 ? "*" : searchBarText
@ -88,8 +92,12 @@ ListView {
// anchors.bottom: parent.bottom // anchors.bottom: parent.bottom
// anchors.right: parent.right // anchors.right: parent.right
} }
Keys.onPressed: (event)=>{
delegate: Item { if(event.key == Qt.Key_Tab && !mainItem.itemAtIndex(mainItem.currentIndex).activeFocus){
mainItem.itemAtIndex(mainItem.currentIndex).forceActiveFocus()
}
}
delegate: FocusScope {
id: itemDelegate id: itemDelegate
height: display ? 56 * DefaultStyle.dp : 0 height: display ? 56 * DefaultStyle.dp : 0
width: mainItem.width width: mainItem.width
@ -163,14 +171,17 @@ ListView {
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
spacing: 10 * DefaultStyle.dp // TODO : change when mockup ready spacing: 10 * DefaultStyle.dp // TODO : change when mockup ready
RowLayout{ RowLayout{
id: actionButtons
visible: mainItem.actionLayoutVisible visible: mainItem.actionLayoutVisible
spacing: 10 * DefaultStyle.dp spacing: 10 * DefaultStyle.dp
Button { Button {
id: callButton
Layout.preferredWidth: 45 * DefaultStyle.dp Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp Layout.preferredHeight: 45 * DefaultStyle.dp
icon.width: 24 * DefaultStyle.dp icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp icon.height: 24 * DefaultStyle.dp
icon.source: AppIcons.phone icon.source: AppIcons.phone
focus: visible
contentImageColor: DefaultStyle.main2_500main contentImageColor: DefaultStyle.main2_500main
background: Rectangle { background: Rectangle {
anchors.fill: parent anchors.fill: parent
@ -178,19 +189,25 @@ ListView {
color: DefaultStyle.main2_200 color: DefaultStyle.main2_200
} }
onClicked: UtilsCpp.createCall(modelData.core.defaultAddress) onClicked: UtilsCpp.createCall(modelData.core.defaultAddress)
KeyNavigation.right: chatButton
KeyNavigation.left: chatButton
} }
Button { Button {
id: chatButton
Layout.preferredWidth: 45 * DefaultStyle.dp Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp Layout.preferredHeight: 45 * DefaultStyle.dp
icon.width: 24 * DefaultStyle.dp icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp icon.height: 24 * DefaultStyle.dp
icon.source: AppIcons.chatTeardropText icon.source: AppIcons.chatTeardropText
focus: visible && !callButton.visible
contentImageColor: DefaultStyle.main2_500main contentImageColor: DefaultStyle.main2_500main
background: Rectangle { background: Rectangle {
anchors.fill: parent anchors.fill: parent
radius: 40 * DefaultStyle.dp radius: 40 * DefaultStyle.dp
color: DefaultStyle.main2_200 color: DefaultStyle.main2_200
} }
KeyNavigation.right: callButton
KeyNavigation.left: callButton
} }
} }
PopupButton { PopupButton {
@ -268,14 +285,21 @@ ListView {
height: mainItem.height height: mainItem.height
acceptedButtons: Qt.AllButtons acceptedButtons: Qt.AllButtons
z: -1 z: -1
focus: !actionButtons.visible
Rectangle { Rectangle {
anchors.fill: contactArea anchors.fill: contactArea
opacity: 0.7 opacity: 0.7
color: DefaultStyle.main2_100 color: DefaultStyle.main2_100
visible: contactArea.containsMouse || friendPopup.hovered || (!mainItem.multiSelectionEnabled && mainItem.currentIndex === index) visible: contactArea.containsMouse || friendPopup.hovered || mainItem.currentIndex === index
}
Keys.onPressed: (event)=> {
if (event.key == Qt.Key_Space || event.key == Qt.Key_Enter || event.key == Qt.Key_Return) {
contactArea.clicked(undefined)
event.accepted = true;
}
} }
onClicked: (mouse) => { onClicked: (mouse) => {
if (mouse.button == Qt.RightButton) { if (mouse && mouse.button == Qt.RightButton) {
friendPopup.open() friendPopup.open()
} else { } else {
mainItem.currentIndex = -1 mainItem.currentIndex = -1
@ -289,6 +313,7 @@ ListView {
mainItem.removeContactFromSelection(indexInSelection, 1) mainItem.removeContactFromSelection(indexInSelection, 1)
} }
} }
mainItem.clicked()
} }
} }
} }

View file

@ -27,7 +27,7 @@ Popup {
signal accepted() signal accepted()
signal rejected() signal rejected()
background: Item { background: Item {
anchors.fill: parent anchors.fill: parent
Rectangle { Rectangle {
@ -58,101 +58,121 @@ Popup {
} }
} }
contentItem: ColumnLayout { contentItem: FocusScope{
spacing: 20 * DefaultStyle.dp height: contentLayout.implicitHeight
Text{ width: contentLayout.implicitWidth
id: titleText onVisibleChanged: {
Layout.fillWidth: true if(visible) forceActiveFocus()
visible: text.length != 0 }
text: mainItem.title Keys.onPressed: (event) => {
font { if(visible && event.key == Qt.Key_Escape){
pixelSize: 16 * DefaultStyle.dp mainItem.close()
weight: 800 * DefaultStyle.dp event.accepted = true
} }
wrapMode: Text.Wrap
horizontalAlignment: Text.AlignLeft
} }
Rectangle{
Layout.fillWidth: true
Layout.preferredHeight: 1
color: DefaultStyle.main2_400
visible: titleText.visible
}
Text {
id: defaultText
visible: text.length != 0
Layout.fillWidth: true
//Layout.preferredWidth: 278 * DefaultStyle.dp
Layout.alignment: Qt.AlignCenter
text: mainItem.text
font {
pixelSize: 14 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp
}
wrapMode: Text.Wrap
horizontalAlignment: titleText.visible ? Text.AlignLeft : Text.AlignHCenter
}
Text {
id: detailsText
visible: text.length != 0
Layout.fillWidth: true
//Layout.preferredWidth: 278 * DefaultStyle.dp
Layout.alignment: Qt.AlignCenter
text: mainItem.details
font {
pixelSize: 13 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp
italic: true
}
wrapMode: Text.Wrap
horizontalAlignment: Text.AlignHCenter
}
ColumnLayout { ColumnLayout {
id: contentLayout anchors.fill: parent
Layout.fillWidth: true spacing: 20 * DefaultStyle.dp
Layout.fillHeight: true Text{
Layout.alignment: Qt.AlignHCenter id: titleText
} Layout.fillWidth: true
visible: text.length != 0
RowLayout { text: mainItem.title
id: buttonsLayout font {
Layout.alignment: Qt.AlignBottom | ( titleText.visible ? Qt.AlignRight : Qt.AlignHCenter) pixelSize: 16 * DefaultStyle.dp
spacing: 10 * DefaultStyle.dp weight: 800 * DefaultStyle.dp
// Default buttons only visible if no other children
// have been set
Button {
id:firstButtonId
visible: mainItem.buttons.length === 2
text: qsTr("Oui")
leftPadding: 20 * DefaultStyle.dp
rightPadding: 20 * DefaultStyle.dp
topPadding: 11 * DefaultStyle.dp
bottomPadding: 11 * DefaultStyle.dp
onClicked: {
if(firstButtonAccept)
mainItem.accepted()
else
mainItem.rejected()
mainItem.close()
} }
wrapMode: Text.Wrap
horizontalAlignment: Text.AlignLeft
} }
Button { Rectangle{
id: secondButtonId Layout.fillWidth: true
visible: mainItem.buttons.length === 2 Layout.preferredHeight: 1
text: qsTr("Non") color: DefaultStyle.main2_400
leftPadding: 20 * DefaultStyle.dp visible: titleText.visible
rightPadding: 20 * DefaultStyle.dp }
topPadding: 11 * DefaultStyle.dp
bottomPadding: 11 * DefaultStyle.dp Text {
onClicked: { id: defaultText
if(secondButtonAccept) visible: text.length != 0
mainItem.accepted() Layout.fillWidth: true
else //Layout.preferredWidth: 278 * DefaultStyle.dp
mainItem.rejected() Layout.alignment: Qt.AlignCenter
mainItem.close() text: mainItem.text
font {
pixelSize: 14 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp
}
wrapMode: Text.Wrap
horizontalAlignment: titleText.visible ? Text.AlignLeft : Text.AlignHCenter
}
Text {
id: detailsText
visible: text.length != 0
Layout.fillWidth: true
//Layout.preferredWidth: 278 * DefaultStyle.dp
Layout.alignment: Qt.AlignCenter
text: mainItem.details
font {
pixelSize: 13 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp
italic: true
}
wrapMode: Text.Wrap
horizontalAlignment: Text.AlignHCenter
}
ColumnLayout {
id: contentLayout
Layout.fillWidth: true
Layout.fillHeight: true
Layout.alignment: Qt.AlignHCenter
}
RowLayout {
id: buttonsLayout
Layout.alignment: Qt.AlignBottom | ( titleText.visible ? Qt.AlignRight : Qt.AlignHCenter)
spacing: 10 * DefaultStyle.dp
// Default buttons only visible if no other children
// have been set
Button {
id:firstButtonId
visible: mainItem.buttons.length === 2
text: qsTr("Oui")
leftPadding: 20 * DefaultStyle.dp
rightPadding: 20 * DefaultStyle.dp
topPadding: 11 * DefaultStyle.dp
bottomPadding: 11 * DefaultStyle.dp
focus: !firstButtonAccept
onClicked: {
if(firstButtonAccept)
mainItem.accepted()
else
mainItem.rejected()
mainItem.close()
}
KeyNavigation.left: secondButtonId
KeyNavigation.right: secondButtonId
}
Button {
id: secondButtonId
visible: mainItem.buttons.length === 2
text: qsTr("Non")
leftPadding: 20 * DefaultStyle.dp
rightPadding: 20 * DefaultStyle.dp
topPadding: 11 * DefaultStyle.dp
bottomPadding: 11 * DefaultStyle.dp
focus: !secondButtonAccept
onClicked: {
if(secondButtonAccept)
mainItem.accepted()
else
mainItem.rejected()
mainItem.close()
}
KeyNavigation.left: firstButtonId
KeyNavigation.right: firstButtonId
} }
} }
} }

View file

@ -16,6 +16,7 @@ Loader {
property int imageWidth: width property int imageWidth: width
property int imageHeight: height property int imageHeight: height
property bool useColor: colorizationColor != undefined property bool useColor: colorizationColor != undefined
property bool shadowEnabled: false
sourceComponent: Item { sourceComponent: Item {
Image { Image {
id: image id: image
@ -49,5 +50,34 @@ Loader {
colorizationColor: effectEnabled && mainItem.colorizationColor ? mainItem.colorizationColor : 'black' colorizationColor: effectEnabled && mainItem.colorizationColor ? mainItem.colorizationColor : 'black'
colorization: effectEnabled ? 1.0: 0.0 colorization: effectEnabled ? 1.0: 0.0
} }
/* Alernative to shadow for no blackcolors
MultiEffect {
visible: mainItem.shadowEnabled
source: image
width: image.width
height: image.height
x: image.x
y: image.y + 6
z: -1
blurEnabled: true
blurMax: 12
blur: 1.0
contrast: -1.0
brightness: 1.0
colorizationColor: DefaultStyle.grey_400
colorization: 1.0
}*/
MultiEffect {
id: shadow
enabled: mainItem.shadowEnabled
anchors.fill: image
source: image
visible: mainItem.shadowEnabled
// Crash : https://bugreports.qt.io/browse/QTBUG-124730?
shadowEnabled: true //mainItem.shadowEnabled
shadowColor: DefaultStyle.grey_1000
shadowBlur: 0
shadowOpacity: mainItem.shadowEnabled ? 0.7 : 0.0
}
} }
} }

View file

@ -139,11 +139,13 @@ ColumnLayout {
Shortcut { Shortcut {
sequences: ["Return", "Enter"] sequences: ["Return", "Enter"]
onActivated: connectionButton.trigger() onActivated: if(passwordEdit.activeFocus) connectionButton.trigger()
else if( usernameEdit.activeFocus) passwordEdit.forceActiveFocus()
} }
onPressed: connectionButton.trigger() onPressed: connectionButton.trigger()
} }
Button { Button {
id: forgottenButton
background: Item { background: Item {
visible: false visible: false
} }
@ -151,7 +153,7 @@ ColumnLayout {
color: DefaultStyle.main2_500main color: DefaultStyle.main2_500main
text: qsTr("Mot de passe oublié ?") text: qsTr("Mot de passe oublié ?")
font{ font{
underline: true underline: forgottenButton.underline
pixelSize: 13 * DefaultStyle.dp pixelSize: 13 * DefaultStyle.dp
weight: 600 * DefaultStyle.dp weight: 600 * DefaultStyle.dp
} }
@ -160,4 +162,4 @@ ColumnLayout {
} }
} }
} }

View file

@ -9,10 +9,18 @@ MouseArea {
property string title property string title
property string subTitle property string subTitle
property int iconSize: 32 * DefaultStyle.dp property int iconSize: 32 * DefaultStyle.dp
property bool shadowEnabled: containsMouse || activeFocus
hoverEnabled: true hoverEnabled: true
width: content.implicitWidth width: content.implicitWidth
height: content.implicitHeight height: content.implicitHeight
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
activeFocusOnTab: true
Keys.onPressed: (event) => {
if(event.key == Qt.Key_Space || event.key == Qt.Key_Enter || event.key == Qt.Key_Return){
mainItem.clicked(undefined)
event.accepted = true
}
}
RowLayout { RowLayout {
id: content id: content
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
@ -48,4 +56,15 @@ MouseArea {
} }
} }
} }
MultiEffect {
enabled: mainItem.shadowEnabled
anchors.fill: content
source: content
visible: mainItem.shadowEnabled
// Crash : https://bugreports.qt.io/browse/QTBUG-124730
shadowEnabled: true //mainItem.shadowEnabled
shadowColor: DefaultStyle.grey_1000
shadowBlur: 1
shadowOpacity: mainItem.shadowEnabled ? 0.5 : 0.0
}
} }

View file

@ -1,9 +1,9 @@
import QtQuick 2.15 import QtQuick
import QtQuick.Effects import QtQuick.Effects
import QtQuick.Layouts import QtQuick.Layouts
import Linphone import Linphone
MouseArea { Item{
id: mainItem id: mainItem
property string iconSource property string iconSource
property string text property string text
@ -11,28 +11,70 @@ MouseArea {
property int iconSize: 17 * DefaultStyle.dp property int iconSize: 17 * DefaultStyle.dp
property int textSize: 14 * DefaultStyle.dp property int textSize: 14 * DefaultStyle.dp
property int textWeight: 400 * DefaultStyle.dp property int textWeight: 400 * DefaultStyle.dp
hoverEnabled: true property color backgroundColor: DefaultStyle.grey_0
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor property color backgroundPressedColor: DefaultStyle.main2_100
width: content.implicitWidth property int radius: 5 * DefaultStyle.dp
RowLayout { property bool shadowEnabled: mainItem.activeFocus// || containsMouse
id: content property alias containsMouse: mouseArea.containsMouse
anchors.verticalCenter: parent.verticalCenter
EffectImage { signal clicked(var mouse)
Layout.preferredWidth: mainItem.iconSize
Layout.preferredHeight: mainItem.iconSize implicitWidth: content.implicitWidth
width: mainItem.iconSize activeFocusOnTab: true
height: mainItem.iconSize
imageSource: mainItem.iconSource Keys.onPressed: (event)=> {
colorizationColor: mainItem.color if (event.key == Qt.Key_Space || event.key == Qt.Key_Enter || event.key == Qt.Key_Return) {
mainItem.clicked(undefined)
event.accepted = true;
} }
Text { }
width: implicitWidth Rectangle{
Layout.fillWidth: true anchors.fill: parent
text: mainItem.text id: buttonBackground
color: mainItem.color color: mainItem.shadowEnabled ? mainItem.backgroundPressedColor : mainItem.backgroundColor
font { radius: mainItem.radius
pixelSize: mainItem.textSize }/*
weight: mainItem.textWeight MultiEffect {
enabled: mainItem.shadowEnabled
anchors.fill: buttonBackground
source: buttonBackground
visible: mainItem.shadowEnabled
// Crash : https://bugreports.qt.io/browse/QTBUG-124730
shadowEnabled: true //mainItem.shadowEnabled
shadowColor: DefaultStyle.grey_1000
shadowBlur: 1
shadowOpacity: mainItem.shadowEnabled ? 0.5 : 0.0
}*/
MouseArea {
id: mouseArea
anchors.verticalCenter: parent.verticalCenter
width: content.implicitWidth
height: mainItem.height
hoverEnabled: true
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
onClicked: function(mouse){mainItem.clicked(mouse)}
RowLayout {
id: content
anchors.verticalCenter: parent.verticalCenter
EffectImage {
Layout.preferredWidth: mainItem.iconSize
Layout.preferredHeight: mainItem.iconSize
width: mainItem.iconSize
height: mainItem.iconSize
imageSource: mainItem.iconSource
colorizationColor: mainItem.color
}
Text {
width: implicitWidth
Layout.fillWidth: true
text: mainItem.text
color: mainItem.color
font {
pixelSize: mainItem.textSize
weight: mainItem.textWeight
}
} }
} }
} }

View file

@ -1,10 +1,10 @@
import QtQuick import QtQuick
import QtQuick.Controls as Control import QtQuick.Controls as Control
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Effects
import Linphone import Linphone
Rectangle { Item {
id: mainItem id: mainItem
height: visible ? 50 * DefaultStyle.dp : 0 height: visible ? 50 * DefaultStyle.dp : 0
@ -13,10 +13,17 @@ Rectangle {
property string titleText property string titleText
property bool isSelected: false property bool isSelected: false
property bool shadowEnabled: mainItem.activeFocus || mouseArea.containsMouse
signal selected() signal selected()
Keys.onPressed: (event)=>{
if(event.key == Qt.Key_Space || event.key == Qt.Key_Return || event.key == Qt.Key_Enter){
mainItem.selected()
}
}
MouseArea { MouseArea {
id: mouseArea
hoverEnabled: true hoverEnabled: true
anchors.fill: parent anchors.fill: parent
Rectangle { Rectangle {
@ -24,7 +31,7 @@ Rectangle {
anchors.fill: parent anchors.fill: parent
color: DefaultStyle.main2_200 color: DefaultStyle.main2_200
radius: 35 * DefaultStyle.dp radius: 35 * DefaultStyle.dp
visible: parent.containsMouse || isSelected visible: parent.containsMouse || isSelected || mainItem.shadowEnabled
} }
Rectangle { Rectangle {
id: backgroundRightFiller id: backgroundRightFiller
@ -34,6 +41,17 @@ Rectangle {
height: 50 * DefaultStyle.dp height: 50 * DefaultStyle.dp
visible: parent.containsMouse || isSelected visible: parent.containsMouse || isSelected
} }
MultiEffect {
enabled: mainItem.shadowEnabled
anchors.fill: background
source: background
visible: mainItem.shadowEnabled
// Crash : https://bugreports.qt.io/browse/QTBUG-124730
shadowEnabled: true //mainItem.shadowEnabled
shadowColor: DefaultStyle.grey_1000
shadowBlur: 1
shadowOpacity: mainItem.shadowEnabled ? 0.5 : 0.0
}
onClicked: { onClicked: {
mainItem.selected() mainItem.selected()
} }

View file

@ -15,7 +15,7 @@ ListView {
property bool hoverEnabled: true property bool hoverEnabled: true
property var delegateButtons property var delegateButtons
property ConferenceInfoGui selectedConference: model && currentIndex != -1 ? model.getAt(currentIndex) : null property ConferenceInfoGui selectedConference: model && currentIndex != -1 ? model.getAt(currentIndex) : null
spacing: 8 * DefaultStyle.dp spacing: 8 * DefaultStyle.dp
currentIndex: confInfoProxy.currentDateIndex currentIndex: confInfoProxy.currentDateIndex
@ -60,7 +60,7 @@ ListView {
property: '$sectionMonth' property: '$sectionMonth'
} }
delegate: Item { delegate: FocusScope {
id: itemDelegate id: itemDelegate
height: 63 * DefaultStyle.dp + topOffset height: 63 * DefaultStyle.dp + topOffset
width: mainItem.width width: mainItem.width
@ -75,6 +75,7 @@ ListView {
property var haveModel: $modelData && $modelData.core.haveModel || false property var haveModel: $modelData && $modelData.core.haveModel || false
RowLayout{ RowLayout{
anchors.fill: parent anchors.fill: parent
anchors.topMargin:parent.topOffset anchors.topMargin:parent.topOffset
@ -138,13 +139,14 @@ ListView {
anchors.fill: parent anchors.fill: parent
anchors.rightMargin: 5 // margin to avoid clipping shadows at right anchors.rightMargin: 5 // margin to avoid clipping shadows at right
radius: 10 * DefaultStyle.dp radius: 10 * DefaultStyle.dp
visible: itemDelegate.haveModel visible: itemDelegate.haveModel || itemDelegate.activeFocus
color: mainItem.currentIndex === index ? DefaultStyle.main2_200 : DefaultStyle.grey_0 color: mainItem.currentIndex === index ? DefaultStyle.main2_200 : DefaultStyle.grey_0
ColumnLayout { ColumnLayout {
anchors.fill: parent anchors.fill: parent
anchors.left: parent.left anchors.left: parent.left
anchors.leftMargin: 15 * DefaultStyle.dp anchors.leftMargin: 15 * DefaultStyle.dp
spacing: 2 * DefaultStyle.dp spacing: 2 * DefaultStyle.dp
visible: itemDelegate.haveModel
RowLayout { RowLayout {
spacing: 8 * DefaultStyle.dp spacing: 8 * DefaultStyle.dp
Image { Image {
@ -200,6 +202,7 @@ ListView {
onClicked: { onClicked: {
mainItem.currentIndex = index mainItem.currentIndex = index
mainItem.conferenceSelected($modelData) mainItem.conferenceSelected($modelData)
itemDelegate.forceActiveFocus()
} }
} }
} }

View file

@ -6,9 +6,8 @@ import Linphone
import UtilsCpp import UtilsCpp
import SettingsCpp import SettingsCpp
ColumnLayout { FocusScope{
id: mainItem id: mainItem
spacing: 8 * DefaultStyle.dp
property bool isCreation property bool isCreation
property ConferenceInfoGui conferenceInfoGui property ConferenceInfoGui conferenceInfoGui
signal addParticipantsRequested() signal addParticipantsRequested()
@ -59,6 +58,7 @@ ColumnLayout {
} }
} }
} }
RowLayout { RowLayout {
visible: mainItem.isCreation && !SettingsCpp.disableBroadcastFeature visible: mainItem.isCreation && !SettingsCpp.disableBroadcastFeature
Layout.topMargin: 20 * DefaultStyle.dp Layout.topMargin: 20 * DefaultStyle.dp
@ -100,8 +100,10 @@ ColumnLayout {
pixelSize: 20 * DefaultStyle.dp pixelSize: 20 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp weight: 800 * DefaultStyle.dp
} }
onActiveFocusChanged: if(activeFocus==true) selectAll() focus: true
onActiveFocusChanged: if(activeFocus) selectAll()
onEditingFinished: mainItem.conferenceInfoGui.core.subject = text onEditingFinished: mainItem.conferenceInfoGui.core.subject = text
KeyNavigation.down: allDaySwitch
} }
} }
} }
@ -127,11 +129,13 @@ ColumnLayout {
Switch { Switch {
id: allDaySwitch id: allDaySwitch
readonly property bool isAllDay: position === 1 readonly property bool isAllDay: position === 1
Component.onCompleted: if (mainItem.conferenceInfoGui.core.isAllDayConf()) toggle KeyNavigation.up: confTitle
KeyNavigation.down: startDate
onPositionChanged: if (position === 1) { onPositionChanged: if (position === 1) {
mainItem.conferenceInfoGui.core.dateTime = UtilsCpp.createDateTime(startDate.selectedDate, 0, 0) mainItem.conferenceInfoGui.core.dateTime = UtilsCpp.createDateTime(startDate.selectedDate, 0, 0)
mainItem.conferenceInfoGui.core.endDateTime = UtilsCpp.createDateTime(endDate.selectedDate, 23, 59) mainItem.conferenceInfoGui.core.endDateTime = UtilsCpp.createDateTime(endDate.selectedDate, 23, 59)
} }
Component.onCompleted: if (mainItem.conferenceInfoGui.core.isAllDayConf()) toggle
} }
}, },
RowLayout { RowLayout {
@ -143,6 +147,10 @@ ColumnLayout {
contentText.font.weight: (isCreation ? 700 : 400) * DefaultStyle.dp contentText.font.weight: (isCreation ? 700 : 400) * DefaultStyle.dp
Layout.preferredWidth: 200 * DefaultStyle.dp Layout.preferredWidth: 200 * DefaultStyle.dp
Layout.preferredHeight: 30 * DefaultStyle.dp Layout.preferredHeight: 30 * DefaultStyle.dp
KeyNavigation.up: allDaySwitch
KeyNavigation.down: endDate
KeyNavigation.left: startHour
KeyNavigation.right: startHour
onSelectedDateChanged: { onSelectedDateChanged: {
if (!selectedDate || selectedDate == mainItem.conferenceInfoGui.core.dateTime) return if (!selectedDate || selectedDate == mainItem.conferenceInfoGui.core.dateTime) return
mainItem.conferenceInfoGui.core.dateTime = UtilsCpp.createDateTime(selectedDate, allDaySwitch.isAllDay ? 0 : startHour.selectedHour, allDaySwitch.isAllDay ? 0 : startHour.selectedMin) mainItem.conferenceInfoGui.core.dateTime = UtilsCpp.createDateTime(selectedDate, allDaySwitch.isAllDay ? 0 : startHour.selectedHour, allDaySwitch.isAllDay ? 0 : startHour.selectedMin)
@ -163,6 +171,10 @@ ColumnLayout {
Layout.preferredHeight: 30 * DefaultStyle.dp Layout.preferredHeight: 30 * DefaultStyle.dp
background.visible: mainItem.isCreation background.visible: mainItem.isCreation
contentText.font.weight: (isCreation ? 700 : 400) * DefaultStyle.dp contentText.font.weight: (isCreation ? 700 : 400) * DefaultStyle.dp
KeyNavigation.up: allDaySwitch
KeyNavigation.down: endDate
KeyNavigation.left: startDate
KeyNavigation.right: startDate
onSelectedHourChanged: { onSelectedHourChanged: {
mainItem.conferenceInfoGui.core.dateTime = selectedDateTime//UtilsCpp.createDateTime(startDate.selectedDate, selectedHour, selectedMin) mainItem.conferenceInfoGui.core.dateTime = selectedDateTime//UtilsCpp.createDateTime(startDate.selectedDate, selectedHour, selectedMin)
endDate.calendar.selectedDate = UtilsCpp.addSecs(selectedDateTime, 3600) endDate.calendar.selectedDate = UtilsCpp.addSecs(selectedDateTime, 3600)
@ -200,99 +212,6 @@ ColumnLayout {
onSelectedMinChanged: mainItem.conferenceInfoGui.core.endDateTime = selectedDateTime//UtilsCpp.createDateTime(startDate.selectedDate, selectedHour, selectedMin) onSelectedMinChanged: mainItem.conferenceInfoGui.core.endDateTime = selectedDateTime//UtilsCpp.createDateTime(startDate.selectedDate, selectedHour, selectedMin)
} }
}, },
// RowLayout {
// EffectImage {
// imageSource: AppIcons.clock
// colorizationColor: DefaultStyle.main2_600
// Layout.preferredWidth: 24 * DefaultStyle.dp
// Layout.preferredHeight: 24 * DefaultStyle.dp
// }
// CalendarComboBox {
// id: startDate
// Layout.fillWidth: true
// Layout.preferredHeight: 30 * DefaultStyle.dp
// background.visible: mainItem.isCreation
// contentText.font.weight: (mainItem.isCreation ? 700 : 400) * DefaultStyle.dp
// onSelectedDateChanged: {
// mainItem.conferenceInfoGui.core.dateTime = UtilsCpp.createDateTime(selectedDate, allDaySwitch.position === 1 ? 0 : startHour.selectedHour, allDaySwitch.position === 1 ? 0 : startHour.selectedMin)
// if (allDaySwitch.position === 0) endDate.calendar.selectedDate = UtilsCpp.addSecs(selectedDate, 3600)
// }
// }
// },
// RowLayout {
// Item {
// Layout.preferredWidth: 24 * DefaultStyle.dp
// Layout.preferredHeight: 24 * DefaultStyle.dp
// }
// RowLayout {
// visible: allDaySwitch.position === 0
// TimeComboBox {
// id: startHour
// onSelectedHourChanged: {
// mainItem.conferenceInfoGui.core.dateTime = UtilsCpp.createDateTime(startDate.selectedDate, selectedHour, selectedMin)
// endHour.selectedTimeString = Qt.formatDateTime(UtilsCpp.createDateTime(new Date(), selectedHour == 23 ? 23 : selectedHour + 1, selectedHour == 23 ? 59 : selectedMin), "hh:mm")
// }
// onSelectedMinChanged: {
// mainItem.conferenceInfoGui.core.dateTime = UtilsCpp.createDateTime(startDate.selectedDate, selectedHour, selectedMin)
// endHour.selectedTimeString = Qt.formatDateTime(UtilsCpp.createDateTime(new Date(), selectedHour == 23 ? 23 : selectedHour + 1, selectedHour == 23 ? 59 : selectedMin), "hh:mm")
// }
// Layout.preferredWidth: 94 * DefaultStyle.dp
// Layout.preferredHeight: 30 * DefaultStyle.dp
// }
// TimeComboBox {
// id: endHour
// // property date startTime: new Date()
// onSelectedHourChanged: mainItem.conferenceInfoGui.core.endDateTime = UtilsCpp.createDateTime(endDate.selectedDate, selectedHour, selectedMin)
// onSelectedMinChanged: mainItem.conferenceInfoGui.core.endDateTime = UtilsCpp.createDateTime(endDate.selectedDate, selectedHour, selectedMin)
// Layout.preferredWidth: 94 * DefaultStyle.dp
// Layout.preferredHeight: 30 * DefaultStyle.dp
// }
// Item {
// Layout.fillWidth: true
// }
// Text {
// property int durationSec: UtilsCpp.secsTo(startHour.selectedTime, endHour.selectedTime)
// property int hour: durationSec/3600
// property int min: (durationSec - hour*3600)/60
// text: (hour > 0 ? hour + "h" : "") + (min > 0 ? min + "mn" : "")
// font {
// pixelSize: 14 * DefaultStyle.dp
// weight: 700 * DefaultStyle.dp
// }
// }
// }
// CalendarComboBox {
// id: endDate
// visible: allDaySwitch.position === 1
// Layout.fillWidth: true
// // Layout.fillHeight: false
// contentText.font.weight: (mainItem.isCreation ? 700 : 400) * DefaultStyle.dp
// Layout.preferredHeight: 30 * DefaultStyle.dp
// onSelectedDateChanged: mainItem.conferenceInfoGui.core.endDateTime = UtilsCpp.createDateTime(selectedDate, allDaySwitch.position === 1 ? 23 : endHour.selectedHour, allDaySwitch.position === 1 ? 59 : endHour.selectedMin)
// }
// },
// RowLayout {
// Item {
// Layout.preferredWidth: 24 * DefaultStyle.dp
// Layout.preferredHeight: 24 * DefaultStyle.dp
// }
// RowLayout {
// Switch {
// id: allDaySwitch
// text: qsTr("Toute la journée")
// onPositionChanged: {
// if (position == 1) {
// mainItem.conferenceInfoGui.core.dateTime = UtilsCpp.createDateTime(startDate.selectedDate, 0, 0)
// mainItem.conferenceInfoGui.core.endDateTime = UtilsCpp.createDateTime(endDate.selectedDate, 23, 59)
// } else {
// mainItem.conferenceInfoGui.core.dateTime = UtilsCpp.createDateTime(startDate.selectedDate, startHour.selectedHour, startHour.selectedMin)
// mainItem.conferenceInfoGui.core.endDateTime = UtilsCpp.createDateTime(endDate.selectedDate, endHour.selectedHour, endHour.selectedMin)
// }
// }
// }
// }
// },
ComboBox { ComboBox {
id: timeZoneCbox id: timeZoneCbox
@ -316,33 +235,6 @@ ColumnLayout {
mainItem.conferenceInfoGui.core.timeZoneModel = timeZoneCbox.model.data(modelIndex, Qt.DisplayRole + 1) mainItem.conferenceInfoGui.core.timeZoneModel = timeZoneCbox.model.data(modelIndex, Qt.DisplayRole + 1)
} }
} }
// ComboBox {
// id: repeaterCbox
// enabled: false
// Component.onCompleted: console.log("TODO : handle conf repetition")
// constantImageSource: AppIcons.reloadArrow
// Layout.fillWidth: true
// Layout.preferredHeight: height
// height: 30 * DefaultStyle.dp
// width: 307 * DefaultStyle.dp
// weight: 700 * DefaultStyle.dp
// leftMargin: 0
// currentIndex: 0
// background: Rectangle {
// visible: parent.hovered || parent.down
// anchors.fill: parent
// color: DefaultStyle.grey_100
// }
// model: [
// {text: qsTr("Une fois")},
// {text: qsTr("Tous les jours")},
// {text: qsTr("Tous les jours de la semaine (Lun-Ven)")},
// {text: qsTr("Toutes les semaines")},
// {text: qsTr("Tous les mois")}
// ]
// }
] ]
} }
@ -370,12 +262,19 @@ ColumnLayout {
pixelSize: 14 * DefaultStyle.dp pixelSize: 14 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp weight: 400 * DefaultStyle.dp
} }
onEditingFinished: mainItem.conferenceInfoGui.core.description = text
Keys.onPressed: (event)=> {
if (event.key == Qt.Key_Escape) {
text = mainItem.conferenceInfoGui.core.description
nextItemInFocusChain().forceActiveFocus()
event.accepted = true;
}
}
background: Rectangle { background: Rectangle {
anchors.fill: parent anchors.fill: parent
color: descriptionEdit.hovered || descriptionEdit.activeFocus ? DefaultStyle.grey_100 : "transparent" color: descriptionEdit.hovered || descriptionEdit.activeFocus ? DefaultStyle.grey_100 : "transparent"
radius: 4 * DefaultStyle.dp radius: 4 * DefaultStyle.dp
} }
onEditingFinished: mainItem.conferenceInfoGui.core.description = text
} }
} }
} }
@ -387,7 +286,7 @@ ColumnLayout {
Layout.preferredHeight: 30 * DefaultStyle.dp Layout.preferredHeight: 30 * DefaultStyle.dp
background: Rectangle { background: Rectangle {
anchors.fill: parent anchors.fill: parent
color: addParticipantsButton.hovered ? DefaultStyle.grey_100 : "transparent" color: addParticipantsButton.hovered || addParticipantsButton.activeFocus ? DefaultStyle.grey_100 : "transparent"
radius: 4 * DefaultStyle.dp radius: 4 * DefaultStyle.dp
} }
contentItem: RowLayout { contentItem: RowLayout {

View file

@ -1,5 +1,5 @@
import QtQuick 2.7 import QtQuick
import QtQuick.Controls 2.2 as Control import QtQuick.Controls as Control
import QtQuick.Layouts as Layout import QtQuick.Layouts as Layout
import QtQuick.Effects import QtQuick.Effects
import Linphone import Linphone
@ -16,6 +16,7 @@ Control.Popup {
rightPadding: 72 * DefaultStyle.dp rightPadding: 72 * DefaultStyle.dp
topPadding: 41 * DefaultStyle.dp topPadding: 41 * DefaultStyle.dp
bottomPadding: 18 * DefaultStyle.dp bottomPadding: 18 * DefaultStyle.dp
onOpened: numPad.forceActiveFocus()
background: Item { background: Item {
anchors.fill: parent anchors.fill: parent
Rectangle { Rectangle {
@ -61,117 +62,169 @@ Control.Popup {
onClicked: mainItem.close() onClicked: mainItem.close()
} }
} }
contentItem: Layout.GridLayout { contentItem: FocusScope{
columns: 3 id: numPad
columnSpacing: 40 * DefaultStyle.dp anchors.fill: parent
rowSpacing: 10 * DefaultStyle.dp anchors.topMargin: 41 * DefaultStyle.dp
Repeater { anchors.bottomMargin: 18 * DefaultStyle.dp
model: 9 anchors.rightMargin: 72 * DefaultStyle.dp
anchors.leftMargin: 72 * DefaultStyle.dp
Layout.GridLayout {
id: numPadGrid
anchors.fill: parent
columns: 3
columnSpacing: 40 * DefaultStyle.dp
rowSpacing: 10 * DefaultStyle.dp
function getButtonAt(index){
index = (index+15) % 15
if(index >= 0){
if( index < 9){
return numPadRepeater.itemAt(index)
}else if( index < 12){
return digitRepeater.itemAt(index-9)
}else if (index < 14){
return launchCallButton
}else if( index < 15){
return eraseButton
}
}
}
Repeater {
id: numPadRepeater
model: 9
Button {
id: numPadButton
Layout.Layout.alignment: Qt.AlignHCenter
required property int index
implicitWidth: 60 * DefaultStyle.dp
implicitHeight: 60 * DefaultStyle.dp
focus: index == 4
onClicked: {
mainItem.buttonPressed(innerText.text)
}
KeyNavigation.left: numPadGrid.getButtonAt(index - 1)
KeyNavigation.right: numPadGrid.getButtonAt(index + 1)
KeyNavigation.up: numPadGrid.getButtonAt(index - 3)
KeyNavigation.down: numPadGrid.getButtonAt(index + 3)
background: Rectangle {
anchors.fill: parent
color: numPadButton.down || numPadButton.shadowEnabled? DefaultStyle.numericPadPressedButtonColor : DefaultStyle.grey_0
radius: 71 * DefaultStyle.dp
}
contentItem: Text {
id: innerText
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
anchors.centerIn: parent
text: index + 1
font {
pixelSize: 32 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp
}
}
}
}
Repeater {
id: digitRepeater
model: [
{pressText: "*"},
{pressText: "0", longPressText: "+"},
{pressText: "#"}
]
Button {
id: digitButton
Layout.Layout.alignment: Qt.AlignHCenter
implicitWidth: 60 * DefaultStyle.dp
implicitHeight: 60 * DefaultStyle.dp
onClicked: mainItem.buttonPressed(pressText.text)
onPressAndHold: mainItem.buttonPressed(longPressText.text)
KeyNavigation.left: numPadGrid.getButtonAt((index - 1)+9)
KeyNavigation.right: numPadGrid.getButtonAt((index + 1)+9)
KeyNavigation.up: numPadGrid.getButtonAt((index - 3)+9)
KeyNavigation.down: numPadGrid.getButtonAt((index + 3)+9)
background: Rectangle {
anchors.fill: parent
color: digitButton.down || digitButton.shadowEnabled? DefaultStyle.numericPadPressedButtonColor : DefaultStyle.grey_0
radius: 71 * DefaultStyle.dp
}
contentItem: Item {
anchors.fill: parent
Text {
id: pressText
height: contentHeight
anchors.left: parent.left
anchors.right: parent.right
horizontalAlignment: Text.AlignHCenter
Component.onCompleted: {if (modelData.longPressText === undefined) anchors.centerIn= parent}
text: modelData.pressText
font.pixelSize: 32 * DefaultStyle.dp
}
Text {
id: longPressText
height: contentHeight
anchors.left: parent.left
anchors.right: parent.right
y: digitButton.height/2
horizontalAlignment: Text.AlignHCenter
visible: modelData.longPressText ? modelData.longPressText.length > 0 : false
text: modelData.longPressText ? modelData.longPressText : ""
font.pixelSize: 22 * DefaultStyle.dp
}
}
}
}
Item {
// Invisible item to move the last two buttons to the right
}
Button { Button {
id: numPadButton id: launchCallButton
implicitWidth: 75 * DefaultStyle.dp
implicitHeight: 55 * DefaultStyle.dp
Layout.Layout.alignment: Qt.AlignHCenter Layout.Layout.alignment: Qt.AlignHCenter
required property int index icon.source: AppIcons.phone
implicitWidth: 60 * DefaultStyle.dp icon.width: 32 * DefaultStyle.dp
implicitHeight: 60 * DefaultStyle.dp icon.height: 32 * DefaultStyle.dp
contentImageColor: DefaultStyle.grey_0
onClicked: mainItem.launchCall()
KeyNavigation.left: eraseButton
KeyNavigation.right: eraseButton
KeyNavigation.up: numPadGrid.getButtonAt(10)
KeyNavigation.down: numPadGrid.getButtonAt(1)
background: Rectangle { background: Rectangle {
anchors.fill: parent anchors.fill: parent
color: numPadButton.down ? DefaultStyle.numericPadPressedButtonColor : DefaultStyle.grey_0 color: DefaultStyle.success_500main
radius: 71 * DefaultStyle.dp radius: 71 * DefaultStyle.dp
} }
contentItem: Text {
id: innerText
horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter
anchors.centerIn: parent
text: index + 1
font {
pixelSize: 32 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp
}
}
onClicked: {
mainItem.buttonPressed(innerText.text)
}
} }
}
Repeater {
model: [
{pressText: "*"},
{pressText: "0", longPressText: "+"},
{pressText: "#"}
]
Button { Button {
id: digitButton id: eraseButton
leftPadding: 5 * DefaultStyle.dp
rightPadding: 5 * DefaultStyle.dp
topPadding: 5 * DefaultStyle.dp
bottomPadding: 5 * DefaultStyle.dp
Layout.Layout.alignment: Qt.AlignHCenter Layout.Layout.alignment: Qt.AlignHCenter
shadowEnabled: true icon.source: AppIcons.backspaceFill
implicitWidth: 60 * DefaultStyle.dp icon.width: 38 * DefaultStyle.dp
implicitHeight: 60 * DefaultStyle.dp icon.height: 38 * DefaultStyle.dp
background: Rectangle { onClicked: mainItem.wipe()
anchors.fill: parent
color: digitButton.down ? DefaultStyle.numericPadPressedButtonColor : DefaultStyle.grey_0 KeyNavigation.left: launchCallButton
radius: 71 * DefaultStyle.dp KeyNavigation.right: launchCallButton
KeyNavigation.up: numPadGrid.getButtonAt(11)
KeyNavigation.down: numPadGrid.getButtonAt(1)
background: Item {
visible: false
} }
contentItem: Item {
anchors.fill: parent
Text {
id: pressText
height: contentHeight
anchors.left: parent.left
anchors.right: parent.right
horizontalAlignment: Text.AlignHCenter
Component.onCompleted: {if (modelData.longPressText === undefined) anchors.centerIn= parent}
text: modelData.pressText
font.pixelSize: 32 * DefaultStyle.dp
}
Text {
id: longPressText
height: contentHeight
anchors.left: parent.left
anchors.right: parent.right
y: digitButton.height/2
horizontalAlignment: Text.AlignHCenter
visible: modelData.longPressText ? modelData.longPressText.length > 0 : false
text: modelData.longPressText ? modelData.longPressText : ""
font.pixelSize: 22 * DefaultStyle.dp
}
}
onClicked: mainItem.buttonPressed(pressText.text)
onPressAndHold: mainItem.buttonPressed(longPressText.text)
} }
} }
Item {
// Invisible item to move the last two buttons to the right
}
Button {
id: launchCallButton
implicitWidth: 75 * DefaultStyle.dp
implicitHeight: 55 * DefaultStyle.dp
Layout.Layout.alignment: Qt.AlignHCenter
background: Rectangle {
anchors.fill: parent
color: DefaultStyle.success_500main
radius: 71 * DefaultStyle.dp
}
icon.source: AppIcons.phone
icon.width: 32 * DefaultStyle.dp
icon.height: 32 * DefaultStyle.dp
contentImageColor: DefaultStyle.grey_0
onClicked: mainItem.launchCall()
}
Button {
leftPadding: 5 * DefaultStyle.dp
rightPadding: 5 * DefaultStyle.dp
topPadding: 5 * DefaultStyle.dp
bottomPadding: 5 * DefaultStyle.dp
Layout.Layout.alignment: Qt.AlignHCenter
background: Item {
visible: false
}
icon.source: AppIcons.backspaceFill
icon.width: 38 * DefaultStyle.dp
icon.height: 38 * DefaultStyle.dp
onClicked: mainItem.wipe()
}
} }
} }

View file

@ -9,6 +9,7 @@ Control.Popup{
property color underlineColor : DefaultStyle.main1_500_main property color underlineColor : DefaultStyle.main1_500_main
property int radius: 16 * DefaultStyle.dp property int radius: 16 * DefaultStyle.dp
property bool hovered: mouseArea.containsMouse property bool hovered: mouseArea.containsMouse
background: Item{ background: Item{
Rectangle { Rectangle {
visible: mainItem.underlineColor != undefined visible: mainItem.underlineColor != undefined

View file

@ -7,6 +7,8 @@ Button {
id: mainItem id: mainItem
property alias popup: popup property alias popup: popup
property var contentImageColor property var contentImageColor
property bool shadowEnabled: mainItem.activeFocus || hovered
property alias popupBackgroundColor: popupBackground.color
checked: popup.visible checked: popup.visible
implicitWidth: 24 * DefaultStyle.dp implicitWidth: 24 * DefaultStyle.dp
implicitHeight: 24 * DefaultStyle.dp implicitHeight: 24 * DefaultStyle.dp
@ -26,11 +28,32 @@ Button {
popup.open() popup.open()
} }
background: Rectangle { Keys.onPressed: (event) => {
if(popup.checked && event.key == Qt.Key_Escape){
mainItem.close()
event.accepted = true
}
}
background: Item {
anchors.fill: mainItem anchors.fill: mainItem
visible: mainItem.checked Rectangle {
color: DefaultStyle.main2_300 id: buttonBackground
radius: 40 * DefaultStyle.dp anchors.fill: parent
visible: mainItem.checked || mainItem.shadowEnabled
color: mainItem.checked ? DefaultStyle.main2_300 : DefaultStyle.grey_100
radius: 40 * DefaultStyle.dp
}
MultiEffect {
enabled: mainItem.shadowEnabled
anchors.fill: buttonBackground
source: buttonBackground
visible: mainItem.shadowEnabled
// Crash : https://bugreports.qt.io/browse/QTBUG-124730
shadowEnabled: true //mainItem.shadowEnabled
shadowColor: DefaultStyle.grey_1000
shadowBlur: 1
shadowOpacity: mainItem.shadowEnabled ? 0.5 : 0.0
}
} }
contentItem: EffectImage { contentItem: EffectImage {
imageSource: mainItem.icon.source imageSource: mainItem.icon.source
@ -46,7 +69,7 @@ Button {
id: popup id: popup
x: 0 x: 0
y: mainItem.height y: mainItem.height
closePolicy: Popup.CloseOnPressOutsideParent | Popup.CloseOnPressOutside closePolicy: Popup.CloseOnPressOutsideParent | Popup.CloseOnPressOutside | Popup.CloseOnEscape
padding: 10 * DefaultStyle.dp padding: 10 * DefaultStyle.dp
parent: mainItem // Explicit define for coordinates references. parent: mainItem // Explicit define for coordinates references.
@ -64,19 +87,20 @@ Button {
} else { } else {
x = 0 x = 0
} }
popup.contentItem.forceActiveFocus()
} }
background: Item { background: Item {
anchors.fill: parent anchors.fill: parent
Rectangle { Rectangle {
id: callOptionsMenuPopup id: popupBackground
anchors.fill: parent anchors.fill: parent
color: DefaultStyle.grey_0 color: DefaultStyle.grey_0
radius: 16 * DefaultStyle.dp radius: 16 * DefaultStyle.dp
} }
MultiEffect { MultiEffect {
source: callOptionsMenuPopup source: popupBackground
anchors.fill: callOptionsMenuPopup anchors.fill: popupBackground
shadowEnabled: true shadowEnabled: true
shadowBlur: 1 shadowBlur: 1
shadowColor: DefaultStyle.grey_900 shadowColor: DefaultStyle.grey_900

View file

@ -1,6 +1,7 @@
import QtQuick 2.7 import QtQuick
import QtQuick.Controls 2.2 as Control import QtQuick.Controls as Control
import QtQuick.Layouts import QtQuick.Layouts
import QtQuick.Effects
import Linphone import Linphone
Control.RadioButton { Control.RadioButton {
@ -11,32 +12,48 @@ Control.RadioButton {
property bool checkOnClick: true property bool checkOnClick: true
property color color property color color
property int indicatorSize: 16 * DefaultStyle.dp property int indicatorSize: 16 * DefaultStyle.dp
property bool shadowEnabled: mainItem.activeFocus || mainItem.hovered
//onClicked: if (checkOnClick && !mainItem.checked) mainItem.toggle() //onClicked: if (checkOnClick && !mainItem.checked) mainItem.toggle()
MouseArea{ MouseArea{
id: mouseArea
anchors.fill:parent anchors.fill:parent
hoverEnabled: true hoverEnabled: true
acceptedButtons: Qt.NoButton acceptedButtons: Qt.NoButton
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
} }
indicator: Rectangle { indicator: Item{
implicitWidth: mainItem.indicatorSize implicitWidth: mainItem.indicatorSize
implicitHeight: mainItem.indicatorSize implicitHeight: mainItem.indicatorSize
radius: implicitWidth/2
color: "transparent"
border.color: mainItem.color
border.width: 2 * DefaultStyle.dp
anchors.verticalCenter: mainItem.verticalCenter anchors.verticalCenter: mainItem.verticalCenter
Rectangle { Rectangle {
width: parent.width/2 id: backgroundArea
height: parent.height/2 anchors.fill: parent
x: parent.width/4 radius: mainItem.indicatorSize/2
y: parent.width/4 color: "transparent"
radius: width/2 border.color: mainItem.color
color: mainItem.color border.width: 2 * DefaultStyle.dp
visible: mainItem.checked Rectangle {
width: parent.width/2
height: parent.height/2
x: parent.width/4
y: parent.width/4
radius: width/2
color: mainItem.color
visible: mainItem.checked
}
}
MultiEffect {
enabled: mainItem.shadowEnabled
anchors.fill: backgroundArea
source: backgroundArea
visible: mainItem.shadowEnabled
// Crash : https://bugreports.qt.io/browse/QTBUG-124730
shadowEnabled: true //mainItem.shadowEnabled
shadowColor: DefaultStyle.grey_1000
shadowBlur: 1
shadowOpacity: mainItem.shadowEnabled ? 0.5 : 0.0
} }
} }
} }

View file

@ -4,7 +4,7 @@ import QtQuick.Layouts 1.0
import Linphone import Linphone
Rectangle { FocusScope {
id: mainItem id: mainItem
property string placeholderText: "" property string placeholderText: ""
property color placeholderTextColor: DefaultStyle.main2_400 property color placeholderTextColor: DefaultStyle.main2_400
@ -17,6 +17,7 @@ Rectangle {
property Control.Popup numericPad property Control.Popup numericPad
property alias numericPadButton: dialerButton property alias numericPadButton: dialerButton
readonly property bool hasActiveFocus: textField.activeFocus readonly property bool hasActiveFocus: textField.activeFocus
property alias color: backgroundItem.color
onVisibleChanged: if (!visible && numericPad) numericPad.close() onVisibleChanged: if (!visible && numericPad) numericPad.close()
@ -38,9 +39,14 @@ Rectangle {
implicitWidth: mainItem.textInputWidth implicitWidth: mainItem.textInputWidth
implicitHeight: 50 * DefaultStyle.dp implicitHeight: 50 * DefaultStyle.dp
radius: 28 * DefaultStyle.dp
color: DefaultStyle.grey_100 Rectangle{
border.color: textField.activeFocus ? mainItem.focusedBorderColor : mainItem.borderColor id: backgroundItem
anchors.fill: parent
radius: 28 * DefaultStyle.dp
color: DefaultStyle.grey_100
border.color: textField.activeFocus ? mainItem.focusedBorderColor : mainItem.borderColor
}
Image { Image {
id: magnifier id: magnifier
visible: mainItem.magnifierVisible visible: mainItem.magnifierVisible
@ -57,6 +63,7 @@ Rectangle {
anchors.leftMargin: magnifier.visible ? 0 : 10 * DefaultStyle.dp anchors.leftMargin: magnifier.visible ? 0 : 10 * DefaultStyle.dp
anchors.right: clearTextButton.left anchors.right: clearTextButton.left
anchors.verticalCenter: parent.verticalCenter anchors.verticalCenter: parent.verticalCenter
focus: true
placeholderText: mainItem.placeholderText placeholderText: mainItem.placeholderText
placeholderTextColor: mainItem.placeholderTextColor placeholderTextColor: mainItem.placeholderTextColor
width: mainItem.width - dialerButton.width width: mainItem.width - dialerButton.width

View file

@ -29,7 +29,7 @@ RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
} }
} }
SwitchButton { Switch {
id: switchButton id: switchButton
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
checked: propertyOwner[mainItem.propertyName] checked: propertyOwner[mainItem.propertyName]

View file

@ -6,28 +6,44 @@ import Linphone
Control.Slider { Control.Slider {
id: mainItem id: mainItem
property bool shadowEnabled: mainItem.hovered || mainItem.activeFocus
background: Rectangle { hoverEnabled: true
x: mainItem.leftPadding background: Item{
y: mainItem.topPadding + mainItem.availableHeight / 2 - height / 2 x: mainItem.leftPadding
implicitWidth: 200 * DefaultStyle.dp y: mainItem.topPadding + mainItem.availableHeight / 2 - height / 2
implicitHeight: 4 * DefaultStyle.dp implicitWidth: 200 * DefaultStyle.dp
width: mainItem.availableWidth implicitHeight: 4 * DefaultStyle.dp
height: implicitHeight width: mainItem.availableWidth
radius: 30 * DefaultStyle.dp height: implicitHeight
// TODO : change the colors when mockup indicates their names Rectangle {
color: DefaultStyle.grey_850 id: sliderBackground
anchors.fill: parent
Rectangle { radius: 30 * DefaultStyle.dp
width: mainItem.visualPosition * parent.width // TODO : change the colors when mockup indicates their names
height: parent.height color: DefaultStyle.grey_850
gradient: Gradient {
orientation: Gradient.Horizontal Rectangle {
GradientStop { position: 0.0; color: "#FF9E79" } width: mainItem.visualPosition * parent.width
GradientStop { position: 1.0; color: "#FE5E00" } height: parent.height
gradient: Gradient {
orientation: Gradient.Horizontal
GradientStop { position: 0.0; color: "#FF9E79" }
GradientStop { position: 1.0; color: "#FE5E00" }
}
radius: 40 * DefaultStyle.dp
} }
radius: 40 * DefaultStyle.dp }
} MultiEffect {
enabled: mainItem.shadowEnabled
anchors.fill: sliderBackground
source: sliderBackground
visible: mainItem.shadowEnabled
// Crash : https://bugreports.qt.io/browse/QTBUG-124730
shadowEnabled: true //mainItem.shadowEnabled
shadowColor: DefaultStyle.grey_1000
shadowBlur: 1
shadowOpacity: mainItem.shadowEnabled ? 0.5 : 0.0
}
} }
handle: Item { handle: Item {

View file

@ -1,34 +1,52 @@
import QtQuick 2.12 import QtQuick
import QtQuick.Controls as Control import QtQuick.Controls as Control
import QtQuick.Effects
import Linphone import Linphone
Control.Switch { Control.Switch {
id: mainItem id: mainItem
property bool shadowEnabled: mainItem.hovered || mainItem.activeFocus
hoverEnabled: true
font { font {
pixelSize: 14 * DefaultStyle.dp pixelSize: 14 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp weight: 400 * DefaultStyle.dp
} }
indicator: Rectangle { indicator: Item{
implicitWidth: 32 * DefaultStyle.dp implicitWidth: 32 * DefaultStyle.dp
implicitHeight: 20 * DefaultStyle.dp implicitHeight: 20 * DefaultStyle.dp
x: mainItem.leftPadding x: mainItem.leftPadding
y: parent.height / 2 - height / 2 y: parent.height / 2 - height / 2
radius: 10 * DefaultStyle.dp Rectangle {
color: mainItem.checked ? DefaultStyle.success_500main : DefaultStyle.main2_400 id: indicatorBackground
anchors.fill: parent
Rectangle { radius: 10 * DefaultStyle.dp
anchors.verticalCenter: parent.verticalCenter color: mainItem.checked? DefaultStyle.success_500main : DefaultStyle.main2_400
property int margin: 4 * DefaultStyle.dp
x: mainItem.checked ? parent.width - width - margin : margin Rectangle {
width: 12 * DefaultStyle.dp anchors.verticalCenter: parent.verticalCenter
height: 12 * DefaultStyle.dp property int margin: 4 * DefaultStyle.dp
radius: 10 * DefaultStyle.dp x: mainItem.checked ? parent.width - width - margin : margin
color: DefaultStyle.grey_0 width: 12 * DefaultStyle.dp
Behavior on x { height: 12 * DefaultStyle.dp
NumberAnimation{duration: 100} radius: 10 * DefaultStyle.dp
color: DefaultStyle.grey_0
Behavior on x {
NumberAnimation{duration: 100}
}
} }
} }
MultiEffect {
enabled: mainItem.shadowEnabled
anchors.fill: indicatorBackground
source: indicatorBackground
visible: mainItem.shadowEnabled
// Crash : https://bugreports.qt.io/browse/QTBUG-124730
shadowEnabled: true //mainItem.shadowEnabled
shadowColor: DefaultStyle.grey_1000
shadowBlur: 1
shadowOpacity: mainItem.shadowEnabled ? 0.5 : 0.0
}
} }
contentItem: Text { contentItem: Text {
@ -38,4 +56,4 @@ Control.Switch {
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
leftPadding: mainItem.indicator.width + mainItem.spacing leftPadding: mainItem.indicator.width + mainItem.spacing
} }
} }

View file

@ -1,22 +0,0 @@
import QtQuick 2.7
import QtQuick.Controls 2.2 as Control
import Linphone
Control.AbstractButton {
id: mainItem
checkable: true
width: 32 * DefaultStyle.dp
height: 20 * DefaultStyle.dp
EffectImage {
visible: mainItem.checked
imageSource: AppIcons.switchOn
//colorizationColor: DefaultStyle.success_500main - not working on this icon.
anchors.fill: parent
}
EffectImage {
visible: !mainItem.checked
imageSource: AppIcons.switchOff
//colorizationColor: DefaultStyle.main2_400 - not working on this icon.
anchors.fill: parent
}
}

View file

@ -1,6 +1,7 @@
import QtQuick 2.7 import QtQuick
import QtQuick.Layouts 1.3 import QtQuick.Layouts
import QtQuick.Controls 2.2 as Control import QtQuick.Controls as Control
import QtQuick.Effects
import Linphone import Linphone
Control.TabBar { Control.TabBar {
@ -44,9 +45,12 @@ Control.TabBar {
Repeater { Repeater {
model: mainItem.model model: mainItem.model
Control.TabButton { Control.TabButton {
id: tabButton
required property string modelData required property string modelData
required property int index required property int index
property bool shadowEnabled: activeFocus || hovered
width: implicitWidth width: implicitWidth
activeFocusOnTab: true
hoverEnabled: true hoverEnabled: true
ToolTip { ToolTip {
visible: tabText.truncated && hovered visible: tabText.truncated && hovered
@ -58,6 +62,7 @@ Control.TabBar {
anchors.fill: parent anchors.fill: parent
Rectangle { Rectangle {
id: tabBackground
visible: mainItem.currentIndex === index visible: mainItem.currentIndex === index
height: 5 * DefaultStyle.dp height: 5 * DefaultStyle.dp
color: DefaultStyle.main1_500_main color: DefaultStyle.main1_500_main
@ -65,6 +70,17 @@ Control.TabBar {
anchors.left: parent.left anchors.left: parent.left
anchors.right: parent.right anchors.right: parent.right
} }
MultiEffect {
enabled: tabButton.shadowEnabled
anchors.fill: tabBackground
source: tabBackground
visible: tabButton.shadowEnabled
// Crash : https://bugreports.qt.io/browse/QTBUG-124730
shadowEnabled: true //mainItem.shadowEnabled
shadowColor: DefaultStyle.grey_1000
shadowBlur: 1
shadowOpacity: tabButton.shadowEnabled ? 0.5 : 0.0
}
} }
contentItem: Text { contentItem: Text {

View file

@ -1,4 +1,4 @@
import QtQuick 2.7 as Quick import QtQuick as Quick
import QtQuick.Layouts import QtQuick.Layouts
import Linphone import Linphone
@ -24,4 +24,4 @@ Quick.Text {
text: mainItem.text text: mainItem.text
font: mainItem.font font: mainItem.font
} }
} }

View file

@ -15,6 +15,7 @@ TextEdit {
property bool hovered: mouseArea.hoverEnabled && mouseArea.containsMouse property bool hovered: mouseArea.hoverEnabled && mouseArea.containsMouse
topPadding: 5 * DefaultStyle.dp topPadding: 5 * DefaultStyle.dp
bottomPadding: 5 * DefaultStyle.dp bottomPadding: 5 * DefaultStyle.dp
activeFocusOnTab: true
MouseArea { MouseArea {
id: mouseArea id: mouseArea

View file

@ -20,6 +20,7 @@ Control.TextField {
weight: 400 * DefaultStyle.dp weight: 400 * DefaultStyle.dp
} }
selectByMouse: true selectByMouse: true
activeFocusOnTab: true
property bool controlIsDown: false property bool controlIsDown: false
property bool hidden: false property bool hidden: false
@ -111,10 +112,9 @@ Control.TextField {
icon.source: eyeButton.checked ? AppIcons.eyeShow : AppIcons.eyeHide icon.source: eyeButton.checked ? AppIcons.eyeShow : AppIcons.eyeHide
width: 20 * DefaultStyle.dp width: 20 * DefaultStyle.dp
height: 20 * DefaultStyle.dp height: 20 * DefaultStyle.dp
icon.width: 20 * DefaultStyle.dp icon.width: width
icon.height: 20 * DefaultStyle.dp icon.height: height
anchors.top: parent.top anchors.verticalCenter: parent.verticalCenter
anchors.bottom: parent.bottom
anchors.right: parent.right anchors.right: parent.right
anchors.rightMargin: rightMargin anchors.rightMargin: rightMargin
} }

View file

@ -107,7 +107,7 @@ Control.TabBar {
Layout.preferredHeight: buttonSize Layout.preferredHeight: buttonSize
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
fillMode: Image.PreserveAspectFit fillMode: Image.PreserveAspectFit
colorizationColor: DefaultStyle.grey_0 colorizationColor: DefaultStyle.grey_0
} }
Text { Text {
id: buttonText id: buttonText
@ -115,6 +115,7 @@ Control.TabBar {
font { font {
weight: mainItem.currentIndex === index ? 800 * DefaultStyle.dp : 400 * DefaultStyle.dp weight: mainItem.currentIndex === index ? 800 * DefaultStyle.dp : 400 * DefaultStyle.dp
pixelSize: 9 * DefaultStyle.dp pixelSize: 9 * DefaultStyle.dp
underline: tabButton.activeFocus || tabButton.hovered
} }
color: DefaultStyle.grey_0 color: DefaultStyle.grey_0
Layout.fillWidth: true Layout.fillWidth: true

View file

@ -1,10 +1,10 @@
import QtQuick import QtQuick
import QtQuick.Controls as Control import QtQuick.Controls as Control
import QtQuick.Layouts 1.0 import QtQuick.Layouts
import QtQuick.Effects import QtQuick.Effects
import Linphone import Linphone
ColumnLayout { FocusScope{
id: mainItem id: mainItem
property alias contentItem: contentItem.data property alias contentItem: contentItem.data
property string label: "" property string label: ""
@ -14,38 +14,43 @@ ColumnLayout {
property alias errorMessage: errorText.text property alias errorMessage: errorText.text
property bool enableErrorText: false property bool enableErrorText: false
property bool errorTextVisible: errorText.opacity > 0 property bool errorTextVisible: errorText.opacity > 0
spacing: 5 * DefaultStyle.dp implicitHeight: layout.implicitHeight
implicitWidth: layout.implicitWidth
Text { ColumnLayout {
visible: label.length > 0 id: layout
verticalAlignment: Text.AlignVCenter spacing: 5 * DefaultStyle.dp
text: mainItem.label + (mainItem.mandatory ? "*" : "")
color: contentItem.activeFocus ? DefaultStyle.main1_500_main : DefaultStyle.main2_600 Text {
elide: Text.ElideRight visible: label.length > 0
wrapMode: Text.Wrap verticalAlignment: Text.AlignVCenter
maximumLineCount: 1 text: mainItem.label + (mainItem.mandatory ? "*" : "")
textFormat: Text.RichText color: contentItem.activeFocus ? DefaultStyle.main1_500_main : DefaultStyle.main2_600
elide: Text.ElideRight
font { wrapMode: Text.Wrap
pixelSize: 13 * DefaultStyle.dp maximumLineCount: 1
weight: 700 * DefaultStyle.dp textFormat: Text.RichText
font {
pixelSize: 13 * DefaultStyle.dp
weight: 700 * DefaultStyle.dp
}
} }
}
Item {
Layout.preferredHeight: contentItem.height
Layout.preferredWidth: contentItem.width
Item { Item {
id: contentItem Layout.preferredHeight: contentItem.height
height: childrenRect.height Layout.preferredWidth: contentItem.width
width: childrenRect.width Item {
} id: contentItem
ErrorText { height: childrenRect.height
id: errorText width: childrenRect.width
anchors.top: contentItem.bottom }
color: DefaultStyle.danger_500main ErrorText {
Layout.preferredWidth: implicitWidth id: errorText
anchors.top: contentItem.bottom
color: DefaultStyle.danger_500main
Layout.preferredWidth: implicitWidth
}
} }
} }
} }

View file

@ -6,9 +6,9 @@ import Linphone
import UtilsCpp import UtilsCpp
import SettingsCpp import SettingsCpp
ColumnLayout { FocusScope{
id: mainItem id: mainItem
spacing: 15 * DefaultStyle.dp
property string placeHolderText: qsTr("Rechercher des contacts") property string placeHolderText: qsTr("Rechercher des contacts")
property list<string> selectedParticipants: contactList.selectedContacts property list<string> selectedParticipants: contactList.selectedContacts
property int selectedParticipantsCount: selectedParticipants.length property int selectedParticipantsCount: selectedParticipants.length
@ -24,141 +24,166 @@ ColumnLayout {
} }
ColumnLayout { ColumnLayout {
visible: mainItem.nameGroupCall anchors.fill: parent
spacing: 5 * DefaultStyle.dp spacing: 15 * DefaultStyle.dp
Layout.rightMargin: 38 * DefaultStyle.dp ColumnLayout {
RowLayout { visible: mainItem.nameGroupCall
spacing: 0 spacing: 5 * DefaultStyle.dp
Text { Layout.rightMargin: 38 * DefaultStyle.dp
font.pixelSize: 13 * DefaultStyle.dp
font.weight: 700 * DefaultStyle.dp
text: qsTr("Nom du groupe")
}
Item{Layout.fillWidth: true}
Text {
font.pixelSize: 12 * DefaultStyle.dp
font.weight: 300 * DefaultStyle.dp
text: qsTr("Requis")
}
}
TextField {
id: groupCallName
Layout.fillWidth: true
Layout.preferredHeight: 49 * DefaultStyle.dp
}
}
ListView {
id: participantList
Layout.fillWidth: true
Layout.preferredHeight: contentHeight
Layout.maximumHeight: mainItem.height / 3
width: mainItem.width
model: contactList.selectedContacts
clip: true
delegate: Item {
height: 56 * DefaultStyle.dp
width: participantList.width - scrollbar.implicitWidth - 12 * DefaultStyle.dp
RowLayout { RowLayout {
anchors.fill: parent spacing: 0
spacing: 10 * DefaultStyle.dp
Avatar {
Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp
address: modelData
}
Text { Text {
property var nameObj: UtilsCpp.getDisplayName(modelData) font.pixelSize: 13 * DefaultStyle.dp
text: nameObj ? nameObj.value : "" font.weight: 700 * DefaultStyle.dp
font.pixelSize: 14 * DefaultStyle.dp text: qsTr("Nom du groupe")
font.capitalization: Font.Capitalize
} }
Item { Item{Layout.fillWidth: true}
Layout.fillWidth: true Text {
} font.pixelSize: 12 * DefaultStyle.dp
Button { font.weight: 300 * DefaultStyle.dp
Layout.preferredWidth: 24 * DefaultStyle.dp text: qsTr("Requis")
Layout.preferredHeight: 24 * DefaultStyle.dp
background: Item{}
icon.source: AppIcons.closeX
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
contentImageColor: DefaultStyle.main1_500_main
onClicked: contactList.selectedContacts.splice(index, 1)
} }
} }
} TextField {
Control.ScrollBar.vertical: ScrollBar { id: groupCallName
id: scrollbar
active: true
interactive: true
policy: Control.ScrollBar.AsNeeded
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.rightMargin: 8 * DefaultStyle.dp
}
}
SearchBar {
id: searchbar
Layout.fillWidth: true
Layout.topMargin: 6 * DefaultStyle.dp
Layout.rightMargin: 28 * DefaultStyle.dp
placeholderText: mainItem.placeHolderText
color: mainItem.searchBarColor
borderColor: mainItem.searchBarColor
}
Text {
Layout.topMargin: 6 * DefaultStyle.dp
text: qsTr("Contacts")
font {
pixelSize: 16 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp
}
}
ContactsList {
id: contactList
visible: contentHeight > 0 || searchbar.text.length > 0
Layout.fillWidth: true
Layout.fillHeight: true
Layout.topMargin: 8 * DefaultStyle.dp
Layout.rightMargin: 8 * DefaultStyle.dp
Layout.preferredHeight: contentHeight
multiSelectionEnabled: true
contactMenuVisible: false
confInfoGui: mainItem.conferenceInfoGui
searchBarText: searchbar.text
onContactAddedToSelection: participantList.positionViewAtEnd()
headerPositioning: ListView.InlineHeader
header: MouseArea {
onClicked: contactList.addContactToSelection(sipAddr.text)
visible: searchbar.text.length > 0
height: searchbar.text.length > 0 ? 56 * DefaultStyle.dp : 0
width: contactList.width
RowLayout {
Layout.fillWidth: true Layout.fillWidth: true
spacing: 10 * DefaultStyle.dp Layout.preferredHeight: 49 * DefaultStyle.dp
anchors.verticalCenter: parent.verticalCenter focus: mainItem.nameGroupCall
anchors.leftMargin: 30 * DefaultStyle.dp KeyNavigation.down: participantList.count > 0 ? participantList : searchbar
anchors.left: parent.left Keys.onPressed: (event) => {
Avatar { if(currentIndex <=0 && event.key == Qt.Key_Up){
Layout.preferredWidth: 45 * DefaultStyle.dp nextItemInFocusChain(false).forceActiveFocus()
Layout.preferredHeight: 45 * DefaultStyle.dp
address: sipAddr.text
}
ColumnLayout {
spacing: 0
Text {
id: sipAddr
property string _text: UtilsCpp.interpretUrl(searchbar.text)
text: SettingsCpp.onlyDisplaySipUriUsername ? UtilsCpp.getUsername(_text) : _text
font.pixelSize: 14 * DefaultStyle.dp
} }
} }
} }
} }
ListView {
} id: participantList
Item { Layout.fillWidth: true
Layout.fillHeight: true Layout.preferredHeight: contentHeight
Layout.maximumHeight: mainItem.height / 3
width: mainItem.width
model: contactList.selectedContacts
clip: true
focus: !groupCallName.visible && participantList.count > 0
Keys.onPressed: (event) => {
if(currentIndex <=0 && event.key == Qt.Key_Up){
nextItemInFocusChain(false).forceActiveFocus()
}
}
delegate: FocusScope {
height: 56 * DefaultStyle.dp
width: participantList.width - scrollbar.implicitWidth - 12 * DefaultStyle.dp
RowLayout {
anchors.fill: parent
spacing: 10 * DefaultStyle.dp
Avatar {
Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp
address: modelData
}
Text {
property var nameObj: UtilsCpp.getDisplayName(modelData)
text: nameObj ? nameObj.value : ""
font.pixelSize: 14 * DefaultStyle.dp
font.capitalization: Font.Capitalize
}
Item {
Layout.fillWidth: true
}
Button {
Layout.preferredWidth: 24 * DefaultStyle.dp
Layout.preferredHeight: 24 * DefaultStyle.dp
background: Item{}
icon.source: AppIcons.closeX
icon.width: 24 * DefaultStyle.dp
icon.height: 24 * DefaultStyle.dp
focus: true
contentImageColor: DefaultStyle.main1_500_main
onClicked: contactList.selectedContacts.splice(index, 1)
}
}
}
Control.ScrollBar.vertical: ScrollBar {
id: scrollbar
active: true
interactive: true
policy: Control.ScrollBar.AsNeeded
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.rightMargin: 8 * DefaultStyle.dp
}
}
SearchBar {
id: searchbar
Layout.fillWidth: true
Layout.topMargin: 6 * DefaultStyle.dp
Layout.rightMargin: 28 * DefaultStyle.dp
placeholderText: mainItem.placeHolderText
focus: !groupCallName.visible && participantList.count == 0
color: mainItem.searchBarColor
borderColor: mainItem.searchBarColor
KeyNavigation.up: participantList.count > 0
? participantList
: groupCallName.visible
? groupCallName
: nextItemInFocusChain(false)
KeyNavigation.down: contactList
}
Text {
Layout.topMargin: 6 * DefaultStyle.dp
text: qsTr("Contacts")
font {
pixelSize: 16 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp
}
}
ContactsList {
id: contactList
visible: contentHeight > 0 || searchbar.text.length > 0
Layout.fillWidth: true
Layout.fillHeight: true
Layout.topMargin: 8 * DefaultStyle.dp
Layout.rightMargin: 8 * DefaultStyle.dp
Layout.preferredHeight: contentHeight
multiSelectionEnabled: true
contactMenuVisible: false
confInfoGui: mainItem.conferenceInfoGui
searchBarText: searchbar.text
onContactAddedToSelection: participantList.positionViewAtEnd()
headerPositioning: ListView.InlineHeader
header: MouseArea {
onClicked: contactList.addContactToSelection(sipAddr.text)
visible: searchbar.text.length > 0
height: searchbar.text.length > 0 ? 56 * DefaultStyle.dp : 0
width: contactList.width
RowLayout {
Layout.fillWidth: true
spacing: 10 * DefaultStyle.dp
anchors.verticalCenter: parent.verticalCenter
anchors.leftMargin: 30 * DefaultStyle.dp
anchors.left: parent.left
Avatar {
Layout.preferredWidth: 45 * DefaultStyle.dp
Layout.preferredHeight: 45 * DefaultStyle.dp
address: sipAddr.text
}
ColumnLayout {
spacing: 0
Text {
id: sipAddr
property string _text: UtilsCpp.interpretUrl(searchbar.text)
text: SettingsCpp.onlyDisplaySipUriUsername ? UtilsCpp.getUsername(_text) : _text
font.pixelSize: 14 * DefaultStyle.dp
}
}
}
}
}
Item {
Layout.fillHeight: true
}
} }
} }

View file

@ -23,8 +23,8 @@ LoginLayout {
Layout.preferredWidth: 27 * DefaultStyle.dp Layout.preferredWidth: 27 * DefaultStyle.dp
Layout.leftMargin: 79 * DefaultStyle.dp Layout.leftMargin: 79 * DefaultStyle.dp
icon.source: AppIcons.leftArrow icon.source: AppIcons.leftArrow
icon.width: 27 * DefaultStyle.dp icon.width: width
icon.height: 27 * DefaultStyle.dp icon.height: height
background: Rectangle { background: Rectangle {
color: "transparent" color: "transparent"
} }

View file

@ -214,13 +214,22 @@ LoginLayout {
} }
} }
Text { Text {
activeFocusOnTab: true
font { font {
underline: true underline: true
pixelSize: 14 * DefaultStyle.dp pixelSize: 14 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp weight: 400 * DefaultStyle.dp
bold: activeFocus
} }
text: qsTr("conditions dutilisation") text: qsTr("conditions dutilisation")
Keys.onPressed: (event)=> {
if (event.key == Qt.Key_Space || event.key == Qt.Key_Enter || event.key == Qt.Key_Return) {
cguMouseArea.clicked(undefined)
event.accepted = true;
}
}
MouseArea { MouseArea {
id: cguMouseArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor
@ -235,13 +244,22 @@ LoginLayout {
} }
} }
Text { Text {
activeFocusOnTab: true
font { font {
underline: true underline: true
pixelSize: 14 * DefaultStyle.dp pixelSize: 14 * DefaultStyle.dp
weight: 400 * DefaultStyle.dp weight: 400 * DefaultStyle.dp
bold: activeFocus
} }
text: qsTr("politique de confidentialité.") text: qsTr("politique de confidentialité.")
Keys.onPressed: (event)=> {
if (event.key == Qt.Key_Space || event.key == Qt.Key_Enter || event.key == Qt.Key_Return) {
privateMouseArea.clicked(undefined)
event.accepted = true;
}
}
MouseArea { MouseArea {
id: privateMouseArea
anchors.fill: parent anchors.fill: parent
hoverEnabled: true hoverEnabled: true
cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor cursorShape: containsMouse ? Qt.PointingHandCursor : Qt.ArrowCursor

View file

@ -95,6 +95,7 @@ LoginLayout {
<p>To enable it in a commercial projet, please contact us. </p>" <p>To enable it in a commercial projet, please contact us. </p>"
} }
Button { Button {
Layout.alignment: Qt.AlignCenter
Layout.topMargin: 18 * DefaultStyle.dp Layout.topMargin: 18 * DefaultStyle.dp
text: "linphone.org/contact" text: "linphone.org/contact"
textSize: 13 * DefaultStyle.dp textSize: 13 * DefaultStyle.dp
@ -109,7 +110,7 @@ LoginLayout {
} }
Button { Button {
Layout.topMargin: 85 * DefaultStyle.dp Layout.topMargin: 85 * DefaultStyle.dp
Layout.preferredWidth: 360 * DefaultStyle.dp Layout.fillWidth: true
inversedColors: true inversedColors: true
text: qsTr("I prefer creating an account") text: qsTr("I prefer creating an account")
leftPadding: 20 * DefaultStyle.dp leftPadding: 20 * DefaultStyle.dp
@ -123,7 +124,7 @@ LoginLayout {
} }
Button { Button {
Layout.topMargin: 20 * DefaultStyle.dp Layout.topMargin: 20 * DefaultStyle.dp
Layout.preferredWidth: 360 * DefaultStyle.dp Layout.fillWidth: true
text: qsTr("I understand") text: qsTr("I understand")
leftPadding: 20 * DefaultStyle.dp leftPadding: 20 * DefaultStyle.dp
rightPadding: 20 * DefaultStyle.dp rightPadding: 20 * DefaultStyle.dp
@ -229,7 +230,6 @@ LoginLayout {
anchors.topMargin: 70 * DefaultStyle.dp anchors.topMargin: 70 * DefaultStyle.dp
anchors.leftMargin: 127 * DefaultStyle.dp anchors.leftMargin: 127 * DefaultStyle.dp
width: 361 * DefaultStyle.dp width: 361 * DefaultStyle.dp
clip: true
}, },
Image { Image {
z: -1 z: -1

View file

@ -9,7 +9,7 @@ import QtQuick.Controls as Control
import Linphone import Linphone
import UtilsCpp import UtilsCpp
Item { FocusScope {
id: mainItem id: mainItem
property string noItemButtonText property string noItemButtonText
property string newItemIconSource property string newItemIconSource
@ -209,6 +209,8 @@ Item {
} }
Control.StackView { Control.StackView {
id: rightPanelStackView id: rightPanelStackView
Layout.fillWidth: true
Layout.fillHeight: true
} }
} }
} }

View file

@ -33,17 +33,19 @@ AbstractMainPage {
Layout.rightMargin: leftPanel.sideMargin Layout.rightMargin: leftPanel.sideMargin
spacing: 5 * DefaultStyle.dp spacing: 5 * DefaultStyle.dp
Button { Button {
id: backButton
Layout.preferredHeight: 24 * DefaultStyle.dp Layout.preferredHeight: 24 * DefaultStyle.dp
Layout.preferredWidth: 24 * DefaultStyle.dp Layout.preferredWidth: 24 * DefaultStyle.dp
icon.source: AppIcons.leftArrow icon.source: AppIcons.leftArrow
width: 24 * DefaultStyle.dp width: 24 * DefaultStyle.dp
height: 24 * DefaultStyle.dp height: 24 * DefaultStyle.dp
background: Item { focus: true
anchors.fill: parent
}
onClicked: { onClicked: {
mainItem.goBack() mainItem.goBack()
} }
background: Item {
anchors.fill: parent
}
} }
Text { Text {
text: titleText text: titleText
@ -63,11 +65,13 @@ AbstractMainPage {
Layout.topMargin: 41 * DefaultStyle.dp Layout.topMargin: 41 * DefaultStyle.dp
Layout.leftMargin: leftPanel.sideMargin Layout.leftMargin: leftPanel.sideMargin
property int selectedIndex: 0 property int selectedIndex: 0
activeFocusOnTab: true
delegate: MasterDetailFamily { delegate: MasterDetailFamily {
titleText: modelData.title titleText: modelData.title
visible: modelData.visible != undefined ? modelData.visible : true visible: modelData.visible != undefined ? modelData.visible : true
isSelected: familiesList.selectedIndex == index isSelected: familiesList.selectedIndex == index
focus: index == 0
onSelected: { onSelected: {
familiesList.selectedIndex = index familiesList.selectedIndex = index
rightPanelStackView.clear() rightPanelStackView.clear()
@ -78,6 +82,8 @@ AbstractMainPage {
Component.onCompleted: { Component.onCompleted: {
let initialEntry = mainItem.families[familiesList.selectedIndex] let initialEntry = mainItem.families[familiesList.selectedIndex]
rightPanelStackView.push(layoutUrl(initialEntry.layout), { titleText: initialEntry.title, model: initialEntry.model, container: rightPanelStackView}) rightPanelStackView.push(layoutUrl(initialEntry.layout), { titleText: initialEntry.title, model: initialEntry.model, container: rightPanelStackView})
familiesList.currentIndex = familiesList.selectedIndex
backButton.forceActiveFocus()
} }
} }
} }

File diff suppressed because it is too large Load diff

View file

@ -363,6 +363,8 @@ AbstractMainPage {
Component { Component {
id: contactDetail id: contactDetail
Item { Item {
width: parent?.width
height: parent?.height
property string objectName: "contactDetail" property string objectName: "contactDetail"
Control.StackView.onActivated: mainItem.leftPanelEnabled = true Control.StackView.onActivated: mainItem.leftPanelEnabled = true
Control.StackView.onDeactivated: mainItem.leftPanelEnabled = false Control.StackView.onDeactivated: mainItem.leftPanelEnabled = false
@ -791,6 +793,8 @@ AbstractMainPage {
Component { Component {
id: contactEdition id: contactEdition
ContactEdition { ContactEdition {
width: rightPanelStackView.width
height: rightPanelStackView.height
property string objectName: "contactEdition" property string objectName: "contactEdition"
onCloseEdition: { onCloseEdition: {
if (rightPanelStackView.depth <= 1) rightPanelStackView.clear() if (rightPanelStackView.depth <= 1) rightPanelStackView.clear()
@ -798,4 +802,4 @@ AbstractMainPage {
} }
} }
} }
} }

File diff suppressed because it is too large Load diff