diff --git a/linphone-app/assets/images/textfield_close.svg b/linphone-app/assets/images/textfield_close.svg new file mode 100644 index 000000000..c2366eeb3 --- /dev/null +++ b/linphone-app/assets/images/textfield_close.svg @@ -0,0 +1,65 @@ + + + + + + + + + + diff --git a/linphone-app/ui/modules/Common/Form/Fields/TextField.qml b/linphone-app/ui/modules/Common/Form/Fields/TextField.qml index 09d548fcf..40a098593 100644 --- a/linphone-app/ui/modules/Common/Form/Fields/TextField.qml +++ b/linphone-app/ui/modules/Common/Form/Fields/TextField.qml @@ -17,6 +17,7 @@ Controls.TextField { property string error: '' property var tools property QtObject textFieldStyle : TextFieldStyle.normal + property bool persistentIcon: false onTextFieldStyleChanged: if( !textFieldStyle) textFieldStyle = TextFieldStyle.normal signal iconClicked() @@ -84,7 +85,7 @@ Controls.TextField { } iconSize: parent.contentHeight - visible: !parent.text + visible: persistentIcon || !parent.text MouseArea{ anchors.fill: parent onClicked: textField.iconClicked() diff --git a/linphone-app/ui/modules/Linphone/Private/ThemeEditor.qml b/linphone-app/ui/modules/Linphone/Private/ThemeEditor.qml new file mode 100644 index 000000000..22e71188a --- /dev/null +++ b/linphone-app/ui/modules/Linphone/Private/ThemeEditor.qml @@ -0,0 +1,159 @@ +import QtGraphicalEffects 1.0 +import QtQuick 2.7 +import QtQuick.Layouts 1.3 +import QtQuick.Controls 2.5 +import QtQuick.Dialogs 1.0 + +import Common 1.0 +import Linphone 1.0 + +import App.Styles 1.0 + + +// ============================================================================= +// ThemeEditor{} + +Window { + id: window + + + Component.onCompleted: window.show() + function setHeight (height) { + window.height = (Window.screen && height > Window.screen.desktopAvailableHeight) + ? Window.screen.desktopAvailableHeight + : height + } + + // --------------------------------------------------------------------------- + height:500 + width:500 + minimumHeight: 300 + minimumWidth: 200 + title: 'Theme Editor' + + + // --------------------------------------------------------------------------- + onVisibleChanged: visible=true + //onClosing: Logic.handleClosing(close) + //onDetachedVirtualWindow: Logic.tryToCloseWindow() + + // --------------------------------------------------------------------------- + ColumnLayout{ + anchors.fill:parent + TabBar{ + id: bar + Layout.fillWidth: true + TabButton{ + text: 'Colors' + } + TabButton{ + text: 'Icons' + } + } + StackLayout { + Layout.fillWidth: true + currentIndex: bar.currentIndex + // COLORS + ScrollableListView{ + //anchors.fill:parent + model:ColorProxyModel{ + id:colorProxy + } + delegate: RowLayout{ + TextField{ + id:colorField + Layout.fillHeight: true + Layout.fillWidth: true + text: colorPreview.color + onEditingFinished: modelData.color = text + } + Rectangle{ + id:colorPreview + width:30 + Layout.fillHeight: true + color:modelData.color + } + Slider{ + id:redSlider + from:0 + to:255 + value: colorPreview.color.r*255 + onValueChanged: modelData.color.r = value/255 + } + Slider{ + id:greenSlider + from:0 + to:255 + value: colorPreview.color.g*255 + onValueChanged: modelData.color.g = value/255 + } + Slider{ + id:blueSlider + from:0 + to:255 + value: colorPreview.color.b*255 + onValueChanged: modelData.color.b = value/255 + } + Slider{ + id:alphaSlider + from:0 + to:255 + value: colorPreview.color.a*255 + onValueChanged: modelData.color.a = value/255 + } + + Text{ + text : modelData.description + } + Text{ + text: modelData.name + visible:modelData.description == '' + } + } + } + ScrollableListView{ + //anchors.fill:parent + model:ImageProxyModel{ + id:imageProxy + } + delegate: RowLayout{ + Text{ + text: modelData.id + } + Icon{ + id:iconPreview + width:30 + Layout.fillHeight: true + icon:modelData.id + iconSize:30 + } + Text{ + text: modelData.path + } + Button{ + text:'...' + onClicked: fileDialog.open() + FileDialog { + id: fileDialog + title: "Please choose a file" + folder: shortcuts.home + selectExisting: true + selectFolder: false + selectMultiple: false + defaultSuffix: 'svg' + onAccepted: { + console.log("You chose: " + fileDialog.fileUrls) + modelData.setUrl(fileDialog.fileUrl) + } + onRejected: { + console.log("Canceled") + } + //Component.onCompleted: visible = true + + } + } + } + } + } + } +} \ No newline at end of file diff --git a/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml b/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml index f12178ae0..e4ba7f1e7 100644 --- a/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml +++ b/linphone-app/ui/modules/Linphone/Timeline/Timeline.qml @@ -96,18 +96,21 @@ Rectangle { } } } - - Icon { - id:searchButton + MouseArea{ Layout.alignment: Qt.AlignRight Layout.rightMargin: TimelineStyle.legend.rightMargin - icon: (searchView.visible? 'timeline_close': 'timeline_search') - iconSize: TimelineStyle.legend.iconSize - MouseArea{ - anchors.fill:parent - onClicked:{ - searchView.visible = !searchView.visible - } + Layout.fillHeight: true + Layout.preferredWidth: TimelineStyle.legend.iconSize + onClicked:{ + searchView.visible = !searchView.visible + } + + Icon { + id:searchButton + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + icon: (searchView.visible? 'timeline_close': 'timeline_search') + iconSize: TimelineStyle.legend.iconSize } } } diff --git a/linphone-app/ui/views/App/Main/Conversation.qml b/linphone-app/ui/views/App/Main/Conversation.qml index 8c0af2695..2d1133e3c 100644 --- a/linphone-app/ui/views/App/Main/Conversation.qml +++ b/linphone-app/ui/views/App/Main/Conversation.qml @@ -110,9 +110,14 @@ ColumnLayout { spacing:0 ColumnLayout{ + + property int maximumContentWidth: contactBar.width + -(avatar.visible?avatar.width:0)-(groupChat.visible?groupChat.width:0) + -actionBar.width - (secureIcon.visible?secureIcon.width :0) + -3*ConversationStyle.bar.spacing Layout.fillHeight: true Layout.minimumWidth: 20 - Layout.maximumWidth: contactBar.width-avatar.width-actionBar.width-3*ConversationStyle.bar.spacing + Layout.maximumWidth: maximumContentWidth Layout.preferredWidth: contactDescription.contentWidth spacing: 5 Row{ @@ -139,7 +144,7 @@ ColumnLayout { ContactDescription { id:contactDescription Layout.minimumWidth: 20 - Layout.maximumWidth: contactBar.width-avatar.width-actionBar.width-3*ConversationStyle.bar.spacing + Layout.maximumWidth: parent.maximumContentWidth Layout.preferredWidth: contentWidth Layout.preferredHeight: contentHeight Layout.alignment: Qt.AlignTop | Qt.AlignLeft @@ -183,6 +188,7 @@ ColumnLayout { } } Icon{ + id: secureIcon Layout.alignment: Qt.AlignVCenter visible: securityLevel != 1 icon: securityLevel === 2?'secure_level_1': securityLevel===3? 'secure_level_2' : 'secure_level_unsafe' @@ -440,8 +446,28 @@ ColumnLayout { // ------------------------------------------------------------------------- // Search. // ------------------------------------------------------------------------- + MouseArea{ + anchors.right: parent.right + anchors.top: parent.top + anchors.bottom: parent.bottom + anchors.rightMargin: 10 + anchors.topMargin: 10 + anchors.bottomMargin: 10 + width: 30 + Icon{ + anchors.verticalCenter: parent.verticalCenter + anchors.horizontalCenter: parent.horizontalCenter + icon: (searchView.visible? 'close': 'search') + iconSize: 20 + } + onClicked: { + searchView.visible = !searchView.visible + chatRoomProxyModel.filterText = searchView.text + } + } Rectangle{ id:searchView + property alias text: searchBar.text anchors.right: parent.right anchors.top: parent.top anchors.bottom: parent.bottom @@ -450,6 +476,7 @@ ColumnLayout { anchors.leftMargin: 50 anchors.topMargin: 10 anchors.bottomMargin: 10 + visible: false TextField { id:searchBar @@ -458,11 +485,16 @@ ColumnLayout { margins: 1 } width: parent.width-14 - icon: 'search' + icon: 'textfield_close' + persistentIcon: true //: 'Search in messages' : this is a placeholder when searching something in the timeline list placeholderText: qsTr('searchMessagesPlaceholder') onTextChanged: chatRoomProxyModel.filterText = text + onIconClicked: { + searchView.visible = false + chatRoomProxyModel.filterText = '' + } } }