Commit add3cffb authored by Ronan's avatar Ronan
Browse files

feat(views/App/MainWindow/ContactEdit): view in progress

parent 370d07c1
......@@ -132,11 +132,11 @@
</message>
<message>
<source>webSites</source>
<translation type="obsolete">WEB SITE(S)</translation>
<translation type="unfinished">WEB SITE(S)</translation>
</message>
<message>
<source>webSitesInput</source>
<translation type="obsolete">URL</translation>
<translation type="unfinished">URL</translation>
</message>
<message>
<source>avatarChooserTitle</source>
......
......@@ -124,11 +124,11 @@
</message>
<message>
<source>webSites</source>
<translation type="obsolete">SITE(S) WEB</translation>
<translation type="unfinished">SITE(S) WEB</translation>
</message>
<message>
<source>webSitesInput</source>
<translation type="obsolete">URL</translation>
<translation type="unfinished">URL</translation>
</message>
<message>
<source>avatarChooserTitle</source>
......
......@@ -140,6 +140,7 @@
<file>ui/modules/Common/Form/SmallButton.qml</file>
<file>ui/modules/Common/Form/TextButtonA.qml</file>
<file>ui/modules/Common/Form/TextButtonB.qml</file>
<file>ui/modules/Common/Form/TextEdit.qml</file>
<file>ui/modules/Common/Form/TextField.qml</file>
<file>ui/modules/Common/Form/TransparentComboBox.qml</file>
<file>ui/modules/Common/Image/Icon.qml</file>
......@@ -169,6 +170,7 @@
<file>ui/modules/Common/Styles/Form/SmallButtonStyle.qml</file>
<file>ui/modules/Common/Styles/Form/TextButtonAStyle.qml</file>
<file>ui/modules/Common/Styles/Form/TextButtonBStyle.qml</file>
<file>ui/modules/Common/Styles/Form/TextEditStyle.qml</file>
<file>ui/modules/Common/Styles/Form/TextFieldStyle.qml</file>
<file>ui/modules/Common/Styles/Form/TransparentComboBoxStyle.qml</file>
<file>ui/modules/Common/Styles/Menu/ActionMenuStyle.qml</file>
......
......@@ -4,6 +4,7 @@ import QtQuick.Layouts 1.3
import Common 1.0
import Common.Styles 1.0
import Utils 1.0
// ===================================================================
RowLayout {
......@@ -88,6 +89,11 @@ RowLayout {
padding: ListFormStyle.value.text.padding
visible: values.model.count === 0
verticalAlignment: Text.AlignVCenter
MouseArea {
anchors.fill: parent
onClicked: _addValue('')
}
}
// -----------------------------------------------------------------
......@@ -106,39 +112,13 @@ RowLayout {
implicitHeight: textEdit.height
width: parent.width
Rectangle {
color: textEdit.activeFocus
? ListFormStyle.value.backgroundColor.focused
: ListFormStyle.value.backgroundColor.normal
anchors.fill: textEdit
}
TextEdit {
id: textEdit
color: activeFocus
? ListFormStyle.value.text.color.focused
: ListFormStyle.value.text.color.normal
padding: ListFormStyle.value.text.padding
selectByMouse: true
text: $value
verticalAlignment: TextEdit.AlignVCenter
height: ListFormStyle.lineHeight
width: !activeFocus
? parent.width
: contentWidth + padding * 2
Keys.onEscapePressed: focus = false
Keys.onReturnPressed: focus = false
onEditingFinished: _handleEditionFinished(index, text)
InvertedMouseArea {
anchors.fill: parent
enabled: textEdit.activeFocus
onPressed: textEdit.focus = false
}
}
Component.onCompleted: {
......
import QtQuick 2.7
import Common 1.0
import Common.Styles 1.0
// ===================================================================
TextEdit {
id: textEdit
color: activeFocus
? TextEditStyle.textColor.focused
: TextEditStyle.textColor.normal
padding: ListFormStyle.value.text.padding
selectByMouse: true
verticalAlignment: TextEdit.AlignVCenter
width: !activeFocus
? parent.width
: contentWidth + padding * 2
Keys.onEscapePressed: focus = false
Keys.onReturnPressed: focus = false
InvertedMouseArea {
anchors.fill: parent
enabled: textEdit.activeFocus
onPressed: textEdit.focus = false
}
Rectangle {
color: parent.activeFocus
? TextEditStyle.backgroundColor.focused
: TextEditStyle.backgroundColor.normal
anchors.fill: parent
}
}
......@@ -9,11 +9,6 @@ QtObject {
property int lineHeight: 30
property QtObject value: QtObject {
property QtObject backgroundColor: QtObject {
property color focused: Colors.q
property color normal: 'transparent'
}
property QtObject placeholder: QtObject {
property color color: Colors.w
property int fontSize: 10
......@@ -21,11 +16,6 @@ QtObject {
property QtObject text: QtObject {
property int padding: 10
property QtObject color: QtObject {
property color focused: Colors.l
property color normal: Colors.r
}
}
}
......
pragma Singleton
import QtQuick 2.7
import Common 1.0
// ===================================================================
QtObject {
property QtObject backgroundColor: QtObject {
property color focused: Colors.q
property color normal: Colors.a
}
property QtObject textColor: QtObject {
property color focused: Colors.l
property color normal: Colors.r
}
}
......@@ -22,6 +22,7 @@ singleton ListFormStyle 1.0 Form/ListFormStyle.qml
singleton SmallButtonStyle 1.0 Form/SmallButtonStyle.qml
singleton TextButtonAStyle 1.0 Form/TextButtonAStyle.qml
singleton TextButtonBStyle 1.0 Form/TextButtonBStyle.qml
singleton TextEditStyle 1.0 Form/TextEditStyle.qml
singleton TextFieldStyle 1.0 Form/TextFieldStyle.qml
singleton TransparentComboBoxStyle 1.0 Form/TransparentComboBoxStyle.qml
......
......@@ -40,6 +40,7 @@ LightButton 1.0 Form/LightButton.qml
ListForm 1.0 Form/ListForm.qml
TextButtonA 1.0 Form/TextButtonA.qml
TextButtonB 1.0 Form/TextButtonB.qml
TextEdit 1.0 Form/TextEdit.qml
TextField 1.0 Form/TextField.qml
TransparentComboBox 1.0 Form/TransparentComboBox.qml
......
......@@ -96,10 +96,9 @@ ColumnLayout {
}
}
Text {
TextEdit {
Layout.fillWidth: true
color: ContactEditStyle.infoBar.username.color
elide: Text.ElideRight
font {
bold: true
......@@ -138,6 +137,7 @@ ColumnLayout {
Layout.fillHeight: true
Layout.fillWidth: true
ScrollBar.vertical: ForceScrollBar {}
boundsBehavior: Flickable.StopAtBounds
clip: true
contentHeight: infoList.height
......@@ -154,33 +154,27 @@ ColumnLayout {
anchors.right: parent.right
ListForm {
defaultData: _contact.sipAddresses
placeholder: qsTr('sipAccountsInput')
title: qsTr('sipAccounts')
defaultData: _contact.sipAddresses
}
ListForm {
title: qsTr('emails')
defaultData: _contact.emails
placeholder: qsTr('emailsInput')
title: qsTr('emails')
}
defaultData: _contact.emails
ListForm {
defaultData: _contact.urls
placeholder: qsTr('webSitesInput')
title: qsTr('webSites')
}
}
}
}
/************************************************/
/* ListForm { */
/* title: qsTr('address') */
/* placeholder: qsTr('addressInput') */
/* } */
/* */
/* */
/* ListForm { */
/* title: qsTr('webSites') */
/* placeholder: qsTr('webSitesInput') */
/* } */
/************************************************/
/* ListForm { */
/* title: qsTr('address') */
/* placeholder: qsTr('addressInput') */
/* } */
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment