mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-09-10 12:03:18 +02:00
SwarmDetailsPanel: apply the new design
GitLab: #1054 Change-Id: I003f88c111c6c012434f7e3f7437d6c5475edcfd
This commit is contained in:
parent
530aa34788
commit
e154ba9ba2
26 changed files with 749 additions and 769 deletions
|
@ -44,12 +44,12 @@ AbstractButton {
|
|||
property var keysNavigationFocusColor: Qt.darker(hoveredColor, 2)
|
||||
property bool hasIcon: animatedIconSource.length !== 0 ||
|
||||
iconSource.length !== 0
|
||||
property bool canBeHovered: true
|
||||
|
||||
property var preferredWidth
|
||||
property real textLeftPadding
|
||||
property real textRightPadding
|
||||
property real fontSize: JamiTheme.wizardViewButtonFontPixelSize
|
||||
property real textAlignment: Text.AlignHCenter
|
||||
|
||||
Binding on width {
|
||||
when: root.preferredWidth !== undefined ||
|
||||
|
@ -67,6 +67,7 @@ AbstractButton {
|
|||
height: preferredHeight
|
||||
Layout.preferredHeight: height
|
||||
|
||||
hoverEnabled: true
|
||||
focusPolicy: Qt.TabFocus
|
||||
|
||||
Accessible.role: Accessible.Button
|
||||
|
@ -163,7 +164,6 @@ AbstractButton {
|
|||
}
|
||||
|
||||
Text {
|
||||
|
||||
id: textButton
|
||||
|
||||
Layout.rightMargin: {
|
||||
|
@ -180,10 +180,10 @@ AbstractButton {
|
|||
leftPadding: root.primary ? JamiTheme.buttontextWizzardPadding : textLeftPadding
|
||||
rightPadding: root.primary ? JamiTheme.buttontextWizzardPadding : textRightPadding
|
||||
text: root.text
|
||||
font.weight: root.hovered || boldFont ? Font.Bold : Font.Medium
|
||||
font.weight: (root.hovered && root.hoverEnabled) || boldFont ? Font.Bold : Font.Medium
|
||||
elide: Text.ElideRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
horizontalAlignment: root.textAlignment
|
||||
color: contentColorProvider
|
||||
font.pixelSize: fontSize
|
||||
}
|
||||
|
@ -195,20 +195,20 @@ AbstractButton {
|
|||
color: {
|
||||
var baseColor = root.focus ? root.keysNavigationFocusColor : root.color
|
||||
if(root.primary) {
|
||||
if (root.hovered && root.canBeHovered)
|
||||
if (root.hovered && root.hoverEnabled)
|
||||
return root.hoveredColor
|
||||
return baseColor
|
||||
}
|
||||
|
||||
if (root.secondary || root.tertiary) {
|
||||
if (root.hovered || root.focus)
|
||||
if ((root.hovered && root.hoverEnabled) || root.focus)
|
||||
return root.secHoveredColor
|
||||
return JamiTheme.transparentColor
|
||||
}
|
||||
|
||||
if (root.down)
|
||||
return root.pressedColor
|
||||
if (root.hovered)
|
||||
if (root.hovered && root.hoverEnabled)
|
||||
return root.hoveredColor
|
||||
|
||||
return baseColor
|
||||
|
@ -219,7 +219,7 @@ AbstractButton {
|
|||
if (root.primary || root.tertiary)
|
||||
return JamiTheme.transparentColor
|
||||
|
||||
if (root.secondary && root.hovered)
|
||||
if (root.secondary && root.hovered && root.hoverEnabled)
|
||||
return JamiTheme.secondaryButtonHoveredBorderColor
|
||||
|
||||
if(root.secondary)
|
||||
|
@ -249,7 +249,7 @@ AbstractButton {
|
|||
|
||||
// We don't want to eat clicks on the Text.
|
||||
acceptedButtons: Qt.NoButton
|
||||
cursorShape: root.hovered ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
cursorShape: (root.hovered && root.hoverEnabled) ? Qt.PointingHandCursor : Qt.ArrowCursor
|
||||
}
|
||||
|
||||
Shortcut {
|
||||
|
|
|
@ -28,10 +28,19 @@ TextField {
|
|||
// except the context menu.
|
||||
property bool isActive: activeFocus || contextMenu.active
|
||||
property bool isSettings: false
|
||||
property bool isSwarmDetail: false
|
||||
|
||||
onActiveFocusChanged: {
|
||||
root.cursorPosition = 0
|
||||
if (!activeFocus && !contextMenu.active) {
|
||||
root.focus = false
|
||||
}
|
||||
if (root.focus)
|
||||
root.cursorPosition = root.text.length
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
root.cursorPosition = 0
|
||||
}
|
||||
|
||||
signal keyPressed
|
||||
|
@ -50,12 +59,14 @@ TextField {
|
|||
? prefixIconColor
|
||||
: JamiTheme.buttonTintedBlue
|
||||
property color baseColor: JamiTheme.primaryForegroundColor
|
||||
color: JamiTheme.textColor
|
||||
property color textColor: JamiTheme.textColor
|
||||
color: textColor
|
||||
placeholderTextColor: !isActive
|
||||
? JamiTheme.transparentColor
|
||||
: JamiTheme.placeholderTextColor
|
||||
: root.color
|
||||
|
||||
property alias infoTipText: infoTip.text
|
||||
property alias infoTipLineText: infoTipLine.text
|
||||
|
||||
wrapMode: "NoWrap"
|
||||
|
||||
|
@ -64,7 +75,7 @@ TextField {
|
|||
selectByMouse: true
|
||||
mouseSelectionMode: TextInput.SelectCharacters
|
||||
|
||||
leftPadding: readOnly || prefixIconSrc === '' ? 0 : 32
|
||||
leftPadding: readOnly || prefixIconSrc === '' || (isSwarmDetail && !root.isActive) ? 0 : 32
|
||||
rightPadding: {
|
||||
var total = 2
|
||||
if (!readOnly) {
|
||||
|
@ -77,7 +88,6 @@ TextField {
|
|||
return total
|
||||
}
|
||||
|
||||
bottomPadding: 20
|
||||
topPadding: 2
|
||||
|
||||
Keys.onPressed: function (event) {
|
||||
|
@ -111,20 +121,32 @@ TextField {
|
|||
id: overBaseLineLabel
|
||||
font.pixelSize: root.font.pixelSize
|
||||
anchors.baseline: root.baseline
|
||||
anchors.horizontalCenter: root.horizontalCenter
|
||||
anchors.horizontalCenter: !isSwarmDetail ? root.horizontalCenter : undefined
|
||||
text: root.placeholderText
|
||||
color: root.baseColor
|
||||
color: isSwarmDetail ? root.color : root.baseColor
|
||||
visible: !root.isActive && !readOnly && root.text.toString() === ""
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: baselineLine
|
||||
width: parent.width
|
||||
height: 1
|
||||
height: visible ? 1 : 0
|
||||
anchors.top: root.baseline
|
||||
anchors.topMargin: root.font.pixelSize
|
||||
color: root.accent
|
||||
visible: !readOnly
|
||||
anchors.topMargin: root.font.pixelSize / 1.5
|
||||
color: isSwarmDetail ? textColor : root.accent
|
||||
visible: {
|
||||
if (!readOnly) {
|
||||
if (isSwarmDetail && root.hovered
|
||||
|| root.isActive ) {
|
||||
return true
|
||||
}
|
||||
if (isSwarmDetail) {
|
||||
return false
|
||||
}
|
||||
return true
|
||||
}
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
component TextFieldIcon: ResponsiveImage {
|
||||
|
@ -154,10 +176,10 @@ TextField {
|
|||
anchors.top: baselineLine.bottom
|
||||
anchors.topMargin: 2
|
||||
text: root.placeholderText
|
||||
color: root.baseColor
|
||||
color: root.textColor
|
||||
|
||||
// Show the alternate placeholder while the user types.
|
||||
visible: root.isActive && !readOnly && root.text.toString() !== "" && !root.isSettings
|
||||
visible: root.isActive && !readOnly && root.text.toString() !== "" && !root.isSettings && !root.isSwarmDetail
|
||||
}
|
||||
|
||||
Item {
|
||||
|
@ -180,7 +202,7 @@ TextField {
|
|||
id: infoTip
|
||||
textColor: JamiTheme.blackColor
|
||||
backGroundColor: JamiTheme.whiteColor
|
||||
visible: parent.hovered && infoTipText.toString() !== ''
|
||||
visible: parent.hovered && infoTipText.toString() !== ""
|
||||
delay: Qt.styleHints.mousePressAndHoldInterval
|
||||
}
|
||||
}
|
||||
|
@ -203,5 +225,13 @@ TextField {
|
|||
}
|
||||
}
|
||||
|
||||
MaterialToolTip {
|
||||
id: infoTipLine
|
||||
|
||||
visible: parent.hovered && infoTipLineText.toString() !== "" && !readOnly
|
||||
delay: Qt.styleHints.mousePressAndHoldInterval
|
||||
y: implicitHeight
|
||||
}
|
||||
|
||||
background: null
|
||||
}
|
||||
|
|
|
@ -29,6 +29,7 @@ Loader {
|
|||
property color suffixIconColor: JamiTheme.buttonTintedBlue
|
||||
property string suffixBisIconSrc : ""
|
||||
property color suffixBisIconColor: JamiTheme.buttonTintedBlue
|
||||
property color textColor: JamiTheme.textColor
|
||||
|
||||
required property string placeholderText
|
||||
property string staticText: ""
|
||||
|
@ -36,6 +37,7 @@ Loader {
|
|||
|
||||
property bool inputIsValid: true
|
||||
property string infoTipText
|
||||
property string infoTipLineText
|
||||
property bool isPersistent: true
|
||||
|
||||
property real fontPixelSize: JamiTheme.materialLineEditPixelSize
|
||||
|
@ -46,6 +48,10 @@ Loader {
|
|||
|
||||
property var icon
|
||||
property bool isSettings
|
||||
property bool isSwarmDetail
|
||||
|
||||
property bool readOnly: false
|
||||
property bool isEditing: false
|
||||
|
||||
onStatusChanged: {
|
||||
if(status == Loader.Ready && icon)
|
||||
|
@ -69,6 +75,7 @@ Loader {
|
|||
if (root.focus && root.isPersistent) {
|
||||
item.forceActiveFocus()
|
||||
}
|
||||
isEditing = !isEditing
|
||||
}
|
||||
|
||||
// This is used when the user is not editing the text.
|
||||
|
@ -94,12 +101,14 @@ Loader {
|
|||
|
||||
focus: true
|
||||
infoTipText: root.infoTipText
|
||||
infoTipLineText: root.infoTipLineText
|
||||
prefixIconSrc: root.prefixIconSrc
|
||||
prefixIconColor: root.prefixIconColor
|
||||
suffixIconSrc: root.suffixIconSrc
|
||||
suffixIconColor: root.suffixIconColor
|
||||
suffixBisIconSrc: root.suffixBisIconSrc
|
||||
suffixBisIconColor: root.suffixBisIconColor
|
||||
textColor: root.textColor
|
||||
font.pixelSize: root.fontPixelSize
|
||||
font.bold: root.fontBold
|
||||
echoMode: root.echoMode
|
||||
|
@ -118,6 +127,8 @@ Loader {
|
|||
onIsActiveChanged: activeChanged(isActive)
|
||||
validator: root.textValidator
|
||||
isSettings: root.isSettings
|
||||
isSwarmDetail: root.isSwarmDetail
|
||||
readOnly: root.readOnly
|
||||
}
|
||||
}
|
||||
|
||||
|
|
299
src/app/commoncomponents/PhotoboothPopup.qml
Normal file
299
src/app/commoncomponents/PhotoboothPopup.qml
Normal file
|
@ -0,0 +1,299 @@
|
|||
/*
|
||||
* Copyright (C) 2023 Savoir-faire Linux Inc.
|
||||
* Author: Franck Laurent <nicolas.vengeon@savoirfairelinux.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import Qt.labs.platform
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Constants 1.1
|
||||
|
||||
import "../mainview/components"
|
||||
|
||||
|
||||
BaseModalDialog {
|
||||
id: root
|
||||
|
||||
height: 157
|
||||
x: - width / 2
|
||||
y: - height / 5
|
||||
|
||||
property string imageId
|
||||
property bool newItem
|
||||
property real buttonSize: JamiTheme.smartListAvatarSize
|
||||
property real imageSize: 25
|
||||
|
||||
signal focusOnPreviousItem
|
||||
signal focusOnNextItem
|
||||
|
||||
function startBooth() {
|
||||
recordBox.openRecorder(true)
|
||||
}
|
||||
|
||||
function stopBooth(){
|
||||
recordBox.closeRecorder()
|
||||
}
|
||||
|
||||
function focusOnNextPhotoBoothItem () {
|
||||
takePhotoButton.forceActiveFocus()
|
||||
}
|
||||
|
||||
function focusOnPreviousPhotoBoothItem () {
|
||||
importButton.forceActiveFocus()
|
||||
}
|
||||
|
||||
RecordBox {
|
||||
id: recordBox
|
||||
|
||||
isPhoto: true
|
||||
visible: false
|
||||
|
||||
onValidatePhoto: function(photo) {
|
||||
if (!root.newItem)
|
||||
AccountAdapter.setCurrentAccountAvatarBase64(photo)
|
||||
else
|
||||
UtilsAdapter.setTempCreationImageFromString(photo, imageId)
|
||||
|
||||
root.close()
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
popupContent: Item {
|
||||
|
||||
Component.onCompleted: {
|
||||
root.width = Qt.binding(() => clearButton.visible ? 283 : 210)
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: container
|
||||
|
||||
anchors.fill: parent
|
||||
radius: JamiTheme.photoPopupRadius
|
||||
color: JamiTheme.inviteHoverColor
|
||||
|
||||
PushButton {
|
||||
id: btnCancel
|
||||
imageColor: "grey"
|
||||
normalColor: "transparent"
|
||||
anchors.right: parent.right
|
||||
anchors.top: parent.top
|
||||
anchors.topMargin: 10
|
||||
anchors.rightMargin: 10
|
||||
source: JamiResources.round_close_24dp_svg
|
||||
onClicked: { close();}
|
||||
}
|
||||
|
||||
|
||||
ColumnLayout {
|
||||
id: mainLayout
|
||||
anchors.fill: parent
|
||||
anchors.margins: JamiTheme.preferredMarginSize
|
||||
|
||||
Text {
|
||||
id: informativeLabel
|
||||
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
Layout.fillWidth: true
|
||||
Layout.topMargin: 26
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
text: JamiStrings.chooseAvatarPicture
|
||||
color: JamiTheme.primaryForegroundColor
|
||||
font.pixelSize: JamiTheme.popupPhotoTextSize
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: buttonsRowLayout
|
||||
Layout.preferredHeight: childrenRect.height
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
spacing: 10
|
||||
|
||||
PushButton {
|
||||
id: takePhotoButton
|
||||
|
||||
objectName: "takePhotoButton"
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
height: buttonSize
|
||||
width: buttonSize
|
||||
imageContainerWidth: imageSize
|
||||
imageContainerHeight: imageSize
|
||||
radius: height / 2
|
||||
border.color: JamiTheme.buttonTintedBlue
|
||||
normalColor: "transparent"
|
||||
imageColor: JamiTheme.buttonTintedBlue
|
||||
toolTipText: JamiStrings.takePhoto
|
||||
source: JamiResources.baseline_camera_alt_24dp_svg
|
||||
hoveredColor: JamiTheme.smartListHoveredColor
|
||||
|
||||
Keys.onPressed: function (keyEvent) {
|
||||
if (keyEvent.key === Qt.Key_Enter ||
|
||||
keyEvent.key === Qt.Key_Return) {
|
||||
clicked()
|
||||
keyEvent.accepted = true
|
||||
} else if (keyEvent.key === Qt.Key_Up) {
|
||||
root.focusOnPreviousItem()
|
||||
keyEvent.accepted = true
|
||||
}
|
||||
}
|
||||
|
||||
KeyNavigation.tab: {
|
||||
if (clearButton.visible)
|
||||
return clearButton
|
||||
return importButton
|
||||
}
|
||||
KeyNavigation.down: KeyNavigation.tab
|
||||
|
||||
onClicked: {
|
||||
recordBox.parent = buttonsRowLayout
|
||||
|
||||
recordBox.x = Qt.binding(function() {
|
||||
var buttonCenterX = buttonsRowLayout.width / 2
|
||||
return buttonCenterX - recordBox.width / 2
|
||||
})
|
||||
recordBox.y = Qt.binding(function() {
|
||||
return - recordBox.height / 2
|
||||
})
|
||||
startBooth()
|
||||
}
|
||||
}
|
||||
|
||||
PushButton {
|
||||
id: importButton
|
||||
|
||||
objectName: "photoboothViewImportButton"
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
visible: parent.visible
|
||||
|
||||
height: buttonSize
|
||||
width: buttonSize
|
||||
imageContainerWidth: imageSize
|
||||
imageContainerHeight: imageSize
|
||||
radius: height / 2
|
||||
border.color: JamiTheme.buttonTintedBlue
|
||||
normalColor: "transparent"
|
||||
source: JamiResources.round_folder_24dp_svg
|
||||
toolTipText: JamiStrings.importFromFile
|
||||
imageColor: JamiTheme.buttonTintedBlue
|
||||
hoveredColor: JamiTheme.smartListHoveredColor
|
||||
|
||||
|
||||
Keys.onPressed: function (keyEvent) {
|
||||
if (keyEvent.key === Qt.Key_Enter ||
|
||||
keyEvent.key === Qt.Key_Return) {
|
||||
clicked()
|
||||
keyEvent.accepted = true
|
||||
} else if (keyEvent.key === Qt.Key_Down ||
|
||||
keyEvent.key === Qt.Key_Tab) {
|
||||
clearButton.forceActiveFocus()
|
||||
keyEvent.accepted = true
|
||||
}
|
||||
}
|
||||
|
||||
KeyNavigation.up: takePhotoButton
|
||||
|
||||
onClicked: {
|
||||
stopBooth()
|
||||
var dlg = viewCoordinator.presentDialog(
|
||||
appWindow,
|
||||
"commoncomponents/JamiFileDialog.qml",
|
||||
{
|
||||
title: JamiStrings.chooseAvatarImage,
|
||||
fileMode: JamiFileDialog.OpenFile,
|
||||
folder: StandardPaths.writableLocation(
|
||||
StandardPaths.PicturesLocation),
|
||||
nameFilters: [JamiStrings.imageFiles,
|
||||
JamiStrings.allFiles]
|
||||
})
|
||||
dlg.fileAccepted.connect(function(file) {
|
||||
var filePath = UtilsAdapter.getAbsPath(file)
|
||||
if (!root.newItem) {
|
||||
AccountAdapter.setCurrentAccountAvatarFile(filePath)
|
||||
} else {
|
||||
UtilsAdapter.setTempCreationImageFromFile(filePath, root.imageId)
|
||||
}
|
||||
root.close()
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
PushButton {
|
||||
id: clearButton
|
||||
|
||||
objectName: "photoboothViewClearButton"
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
height: buttonSize
|
||||
width: buttonSize
|
||||
imageContainerWidth: imageSize
|
||||
imageContainerHeight: imageSize
|
||||
radius: height / 2
|
||||
border.color: JamiTheme.buttonTintedBlue
|
||||
normalColor: "transparent"
|
||||
source: JamiResources.ic_hangup_participant_24dp_svg
|
||||
toolTipText: JamiStrings.clearAvatar
|
||||
imageColor: JamiTheme.buttonTintedBlue
|
||||
hoveredColor: JamiTheme.smartListHoveredColor
|
||||
|
||||
|
||||
visible: {
|
||||
if (!newItem && LRCInstance.currentAccountAvatarSet)
|
||||
return true
|
||||
if (newItem && UtilsAdapter.tempCreationImage(imageId).length !== 0)
|
||||
return true
|
||||
return false
|
||||
}
|
||||
|
||||
KeyNavigation.up: importButton
|
||||
|
||||
Keys.onPressed: function (keyEvent) {
|
||||
if (keyEvent.key === Qt.Key_Enter ||
|
||||
keyEvent.key === Qt.Key_Return) {
|
||||
clicked()
|
||||
importButton.forceActiveFocus()
|
||||
keyEvent.accepted = true
|
||||
} else if (keyEvent.key === Qt.Key_Down ||
|
||||
keyEvent.key === Qt.Key_Tab) {
|
||||
btnCancel.forceActiveFocus()
|
||||
keyEvent.accepted = true
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
if (!root.newItem)
|
||||
AccountAdapter.setCurrentAccountAvatarBase64()
|
||||
else
|
||||
UtilsAdapter.setTempCreationImageFromString("", imageId)
|
||||
visible = false
|
||||
stopBooth()
|
||||
root.close()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -31,59 +31,14 @@ Item {
|
|||
id: root
|
||||
|
||||
property alias imageId: avatar.imageId
|
||||
property alias cancelButton: cancelButton.visible
|
||||
|
||||
property bool newItem: false
|
||||
property bool readOnly: false
|
||||
property real avatarSize
|
||||
property real buttonSize: avatarSize
|
||||
property bool darkTheme: false
|
||||
property bool doubleEditAvatar: false
|
||||
|
||||
signal focusOnPreviousItem
|
||||
signal focusOnNextItem
|
||||
|
||||
height: Math.max(avatarSize, buttonSize)
|
||||
|
||||
function startBooth() {
|
||||
recordBox.openRecorder(true)
|
||||
}
|
||||
|
||||
function stopBooth(){
|
||||
recordBox.closeRecorder()
|
||||
}
|
||||
|
||||
function focusOnNextPhotoBoothItem () {
|
||||
takePhotoButton.forceActiveFocus()
|
||||
}
|
||||
|
||||
function focusOnPreviousPhotoBoothItem () {
|
||||
importButton.forceActiveFocus()
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
if (!visible) {
|
||||
imageLayer.visible = true
|
||||
buttonsRowLayout.visible = false
|
||||
stopBooth()
|
||||
}
|
||||
}
|
||||
|
||||
RecordBox {
|
||||
id: recordBox
|
||||
|
||||
isPhoto: true
|
||||
visible: false
|
||||
|
||||
onValidatePhoto: function(photo) {
|
||||
if (!root.newItem)
|
||||
AccountAdapter.setCurrentAccountAvatarBase64(photo)
|
||||
else
|
||||
UtilsAdapter.setTempCreationImageFromString(photo, imageId)
|
||||
buttonsRowLayout.backToAvatar()
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: imageLayer
|
||||
|
||||
|
@ -126,232 +81,16 @@ Item {
|
|||
enabled: avatar.visible && !root.readOnly
|
||||
visible: enabled
|
||||
|
||||
onClicked :{
|
||||
|
||||
imageLayer.visible = false
|
||||
buttonsRowLayout.visible = true
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: buttonsRowLayout
|
||||
visible: false
|
||||
|
||||
anchors.centerIn: parent
|
||||
Layout.preferredHeight: childrenRect.height
|
||||
spacing: 10
|
||||
|
||||
function backToAvatar() {
|
||||
imageLayer.visible = true
|
||||
buttonsRowLayout.visible = false
|
||||
}
|
||||
|
||||
PushButton {
|
||||
id: takePhotoButton
|
||||
|
||||
objectName: "takePhotoButton"
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.leftMargin: cancelButton.width
|
||||
|
||||
height: buttonSize
|
||||
width: buttonSize
|
||||
imageContainerWidth: buttonSize
|
||||
imageContainerHeight: buttonSize
|
||||
radius: height / 2
|
||||
border.width: 2
|
||||
border.color: darkTheme ? "white" : JamiTheme.buttonTintedBlue
|
||||
normalColor: "transparent"
|
||||
imageColor: darkTheme ? "white" : JamiTheme.buttonTintedBlue
|
||||
toolTipText: JamiStrings.takePhoto
|
||||
source: JamiResources.baseline_camera_alt_24dp_svg
|
||||
hoveredColor: darkTheme ? Qt.rgba(255, 255, 255, 0.2) : JamiTheme.buttonTintedBlueInternalHover
|
||||
|
||||
Keys.onPressed: function (keyEvent) {
|
||||
if (keyEvent.key === Qt.Key_Enter ||
|
||||
keyEvent.key === Qt.Key_Return) {
|
||||
clicked()
|
||||
keyEvent.accepted = true
|
||||
} else if (keyEvent.key === Qt.Key_Up) {
|
||||
root.focusOnPreviousItem()
|
||||
keyEvent.accepted = true
|
||||
}
|
||||
}
|
||||
|
||||
KeyNavigation.tab: {
|
||||
if (clearButton.visible)
|
||||
return clearButton
|
||||
return importButton
|
||||
}
|
||||
KeyNavigation.down: KeyNavigation.tab
|
||||
|
||||
onClicked: {
|
||||
recordBox.parent = buttonsRowLayout
|
||||
|
||||
recordBox.x = Qt.binding(function() {
|
||||
var buttonCenterX = buttonsRowLayout.width / 2
|
||||
return buttonCenterX - recordBox.width / 2
|
||||
})
|
||||
recordBox.y = Qt.binding(function() {
|
||||
return - recordBox.height / 2
|
||||
})
|
||||
startBooth()
|
||||
}
|
||||
}
|
||||
|
||||
PushButton {
|
||||
id: importButton
|
||||
|
||||
objectName: "photoboothViewImportButton"
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
visible: parent.visible
|
||||
|
||||
height: buttonSize
|
||||
width: buttonSize
|
||||
imageContainerWidth: buttonSize
|
||||
imageContainerHeight: buttonSize
|
||||
radius: height / 2
|
||||
border.width: 2
|
||||
border.color: darkTheme ? "white" : JamiTheme.buttonTintedBlue
|
||||
normalColor: "transparent"
|
||||
source: JamiResources.round_folder_24dp_svg
|
||||
toolTipText: JamiStrings.importFromFile
|
||||
imageColor: darkTheme ? "white" : JamiTheme.buttonTintedBlue
|
||||
hoveredColor: darkTheme ? Qt.rgba(255, 255, 255, 0.2) : JamiTheme.buttonTintedBlueInternalHover
|
||||
|
||||
Keys.onPressed: function (keyEvent) {
|
||||
if (keyEvent.key === Qt.Key_Enter ||
|
||||
keyEvent.key === Qt.Key_Return) {
|
||||
clicked()
|
||||
keyEvent.accepted = true
|
||||
} else if (keyEvent.key === Qt.Key_Down ||
|
||||
keyEvent.key === Qt.Key_Tab) {
|
||||
clearButton.forceActiveFocus()
|
||||
keyEvent.accepted = true
|
||||
}
|
||||
}
|
||||
|
||||
KeyNavigation.up: takePhotoButton
|
||||
|
||||
onClicked: {
|
||||
stopBooth()
|
||||
buttonsRowLayout.backToAvatar()
|
||||
var dlg = viewCoordinator.presentDialog(
|
||||
appWindow,
|
||||
"commoncomponents/JamiFileDialog.qml",
|
||||
{
|
||||
title: JamiStrings.chooseAvatarImage,
|
||||
fileMode: JamiFileDialog.OpenFile,
|
||||
folder: StandardPaths.writableLocation(
|
||||
StandardPaths.PicturesLocation),
|
||||
nameFilters: [JamiStrings.imageFiles,
|
||||
JamiStrings.allFiles]
|
||||
onClicked : viewCoordinator.presentDialog(
|
||||
parent,
|
||||
"commoncomponents/PhotoboothPopup.qml",
|
||||
{ parent: editImage,
|
||||
imageId: root.imageId,
|
||||
newItem: root.newItem,
|
||||
})
|
||||
dlg.fileAccepted.connect(function(file) {
|
||||
var filePath = UtilsAdapter.getAbsPath(file)
|
||||
if (!root.newItem) {
|
||||
AccountAdapter.setCurrentAccountAvatarFile(filePath)
|
||||
} else {
|
||||
UtilsAdapter.setTempCreationImageFromFile(filePath, root.imageId)
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
|
||||
PushButton {
|
||||
id: clearButton
|
||||
|
||||
objectName: "photoboothViewClearButton"
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
height: buttonSize
|
||||
width: buttonSize
|
||||
imageContainerWidth: buttonSize
|
||||
imageContainerHeight: buttonSize
|
||||
radius: height / 2
|
||||
border.width: 2
|
||||
border.color: darkTheme ? "white" : JamiTheme.buttonTintedBlue
|
||||
normalColor: "transparent"
|
||||
source: JamiResources.ic_hangup_participant_24dp_svg
|
||||
toolTipText: JamiStrings.clearAvatar
|
||||
imageColor: darkTheme ? "white" : JamiTheme.buttonTintedBlue
|
||||
hoveredColor: darkTheme ? Qt.rgba(255, 255, 255, 0.2) : JamiTheme.buttonTintedBlueInternalHover
|
||||
|
||||
visible: {
|
||||
if (!newItem && LRCInstance.currentAccountAvatarSet)
|
||||
return true
|
||||
if (newItem && UtilsAdapter.tempCreationImage(imageId).length !== 0)
|
||||
return true
|
||||
return false
|
||||
}
|
||||
|
||||
KeyNavigation.up: importButton
|
||||
|
||||
Keys.onPressed: function (keyEvent) {
|
||||
if (keyEvent.key === Qt.Key_Enter ||
|
||||
keyEvent.key === Qt.Key_Return) {
|
||||
clicked()
|
||||
importButton.forceActiveFocus()
|
||||
keyEvent.accepted = true
|
||||
} else if (keyEvent.key === Qt.Key_Down ||
|
||||
keyEvent.key === Qt.Key_Tab) {
|
||||
cancelButton.forceActiveFocus()
|
||||
keyEvent.accepted = true
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
if (!root.newItem)
|
||||
AccountAdapter.setCurrentAccountAvatarBase64()
|
||||
else
|
||||
UtilsAdapter.setTempCreationImageFromString("", imageId)
|
||||
stopBooth()
|
||||
buttonsRowLayout.backToAvatar()
|
||||
}
|
||||
}
|
||||
|
||||
PushButton {
|
||||
id: cancelButton
|
||||
|
||||
visible: true
|
||||
preferredSize: 18
|
||||
width: 18
|
||||
height: 18
|
||||
radius: height / 2
|
||||
normalColor: "transparent"
|
||||
source: JamiResources.round_close_24dp_svg
|
||||
toolTipText: JamiStrings.cancel
|
||||
imageColor: darkTheme ? "white" : JamiTheme.buttonTintedBlue
|
||||
hoveredColor: darkTheme ? Qt.rgba(255, 255, 255, 0.2) : JamiTheme.buttonTintedBlueInternalHover
|
||||
|
||||
Keys.onPressed: function (keyEvent) {
|
||||
if (keyEvent.key === Qt.Key_Enter ||
|
||||
keyEvent.key === Qt.Key_Return) {
|
||||
clicked()
|
||||
takePhotoButton.forceActiveFocus()
|
||||
keyEvent.accepted = true
|
||||
} else if (keyEvent.key === Qt.Key_Down ||
|
||||
keyEvent.key === Qt.Key_Tab) {
|
||||
importButton.forceActiveFocus()
|
||||
keyEvent.accepted = true
|
||||
}
|
||||
}
|
||||
|
||||
KeyNavigation.up: {
|
||||
if (clearButton.visible)
|
||||
return clearButton
|
||||
if (importButton.visible)
|
||||
return importButton
|
||||
return takePhotoButton
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
stopBooth()
|
||||
buttonsRowLayout.backToAvatar()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -130,6 +130,7 @@ AbstractButton {
|
|||
|
||||
anchors.centerIn: image.status !== Image.Null ? undefined : root
|
||||
anchors.left: image.status !== Image.Null ? image.right : undefined
|
||||
|
||||
anchors.leftMargin: preferredMargin
|
||||
anchors.verticalCenter: root.verticalCenter
|
||||
|
||||
|
|
|
@ -33,6 +33,7 @@ Item {
|
|||
|
||||
property alias source: image.source
|
||||
property alias status: image.status
|
||||
property alias cache: image.cache
|
||||
property string color: "transparent"
|
||||
property bool hovered: false
|
||||
property bool mirrorHorizontally: false
|
||||
|
|
|
@ -32,7 +32,7 @@ MaterialButton {
|
|||
color: !enabled ? JamiTheme.buttonTintedGreyInactive :
|
||||
JamiTheme.buttonTintedBlue
|
||||
|
||||
canBeHovered: enabled
|
||||
hoverEnabled: enabled
|
||||
hoveredColor: JamiTheme.buttonTintedBlueHovered
|
||||
pressedColor: JamiTheme.buttonTintedBluePressed
|
||||
}
|
||||
|
|
|
@ -644,6 +644,7 @@ Item {
|
|||
|
||||
// PhotoBoothView
|
||||
property string chooseAvatarImage: qsTr("Choose a picture as your avatar")
|
||||
property string chooseAvatarPicture: qsTr("Choose a picture")
|
||||
property string importFromFile: qsTr("Import avatar from image file")
|
||||
property string stopTakingPhoto: qsTr("Stop taking photo")
|
||||
property string clearAvatar: qsTr("Clear avatar image")
|
||||
|
|
|
@ -302,6 +302,7 @@ Item {
|
|||
property real buttonFontSize: calcSize(9)
|
||||
property real materialButtonPreferredHeight: calcSize(36)
|
||||
property real participantFontSize: calcSize(10 + fontSizeOffset)
|
||||
property real participantSwarmDetailFontSize: calcSize(15 + fontSizeOffset)
|
||||
property real menuFontSize: calcSize(12 + fontSizeOffset)
|
||||
property real headerFontSize: calcSize(14.25 + fontSizeOffset)
|
||||
property real titleFontSize: calcSize(16 + fontSizeOffset)
|
||||
|
@ -390,6 +391,8 @@ Item {
|
|||
property real swarmDetailsPageDocumentsMediaRadius: 15
|
||||
property real swarmDetailsPageDocumentsPaperClipSize: 24
|
||||
property real swarmDetailsPageDocumentsMediaSize: 150
|
||||
property real swarmDetailsPageDocumentsHeight: 40 * baseZoom
|
||||
property real swarmDetailsPageDocumentsMinHeight: 40
|
||||
|
||||
//Call information
|
||||
property real textFontPointSize: calcSize(10)
|
||||
|
@ -413,6 +416,7 @@ Item {
|
|||
|
||||
// Modal Popup
|
||||
property real modalPopupRadius: 20
|
||||
property real photoPopupRadius: 5
|
||||
|
||||
//MessagesResearch
|
||||
property color blueLinkColor: darkTheme ? "#3366BB" : "#0645AD"
|
||||
|
@ -541,6 +545,7 @@ Item {
|
|||
//Popups
|
||||
property real popuptextSize: calcSize(15)
|
||||
property real popupButtonsMargin: 20
|
||||
property real popupPhotoTextSize: calcSize(18)
|
||||
|
||||
// MaterialLineEdit
|
||||
property real materialLineEditPointSize: calcSize(10 + fontSizeOffset)
|
||||
|
|
|
@ -664,6 +664,6 @@ ConversationsAdapter::createSwarm(const QString& title,
|
|||
auto convModel = lrcInstance_->getCurrentConversationModel();
|
||||
return convModel->createConversation(participants,
|
||||
{{"title", title},
|
||||
{"description", description},
|
||||
{"avatar", avatar}});
|
||||
{"description", description},
|
||||
{"avatar", avatar}});
|
||||
}
|
||||
|
|
|
@ -84,14 +84,11 @@ ColumnLayout {
|
|||
width: avatarSize + avatarSize / 2
|
||||
height: avatarSize + avatarSize / 2
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
darkTheme: UtilsAdapter.luma(JamiTheme.primaryBackgroundColor)
|
||||
visible: opened
|
||||
enabled: true
|
||||
buttonSize: 35
|
||||
imageId: CurrentAccount.id
|
||||
avatarSize: 53
|
||||
doubleEditAvatar: true
|
||||
cancelButton: false
|
||||
|
||||
}
|
||||
|
||||
|
|
|
@ -182,7 +182,18 @@ BaseModalDialog {
|
|||
MaterialButton {
|
||||
id: chooseBtn
|
||||
|
||||
TextMetrics{
|
||||
id: chooseBtnTextSize
|
||||
font.weight: Font.Bold
|
||||
font.pixelSize: JamiTheme.wizardViewButtonFontPixelSize
|
||||
font.capitalization: Font.AllUppercase
|
||||
text: chooseBtn.text
|
||||
}
|
||||
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
Layout.fillWidth: true
|
||||
primary: true
|
||||
preferredWidth: chooseBtnTextSize.width + 2*JamiTheme.buttontextWizzardPadding
|
||||
enabled: devicesListView.currentItem
|
||||
|
||||
text: JamiStrings.chooseThisDevice
|
||||
|
@ -198,7 +209,18 @@ BaseModalDialog {
|
|||
MaterialButton {
|
||||
id: rmDeviceBtn
|
||||
|
||||
TextMetrics{
|
||||
id: rmDeviceBtnTextSize
|
||||
font.weight: Font.Bold
|
||||
font.pixelSize: JamiTheme.wizardViewButtonFontPixelSize
|
||||
font.capitalization: Font.AllUppercase
|
||||
text: rmDeviceBtn.text
|
||||
}
|
||||
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
Layout.fillWidth: true
|
||||
primary: true
|
||||
preferredWidth: rmDeviceBtnTextSize.width + 2*JamiTheme.buttontextWizzardPadding
|
||||
enabled: devicesListView.currentItem
|
||||
|
||||
text: JamiStrings.removeCurrentDevice
|
||||
|
@ -211,9 +233,6 @@ BaseModalDialog {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
194
src/app/mainview/components/DocumentPreview.qml
Normal file
194
src/app/mainview/components/DocumentPreview.qml
Normal file
|
@ -0,0 +1,194 @@
|
|||
/*
|
||||
* Copyright (C) 2023 Savoir-faire Linux Inc.
|
||||
* Author: Franck Laurent <franck.laurent@savoirfairelinux.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import Qt5Compat.GraphicalEffects
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Constants 1.1
|
||||
import net.jami.Models 1.1
|
||||
import "../../commoncomponents"
|
||||
|
||||
Item {
|
||||
|
||||
id: root
|
||||
|
||||
property real margin: 2
|
||||
signal removeFileButtonClicked(int index)
|
||||
property var mediaInfo: MessagesAdapter.getMediaInfo(Body)
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
acceptedButtons: Qt.LeftButton | Qt.RightButton
|
||||
|
||||
onEntered: {
|
||||
cursorShape = Qt.PointingHandCursor
|
||||
}
|
||||
|
||||
onClicked: function(mouse) {
|
||||
if (mouse.button === Qt.RightButton) {
|
||||
ctxMenu.x = mouse.x
|
||||
ctxMenu.y = mouse.y
|
||||
ctxMenu.openMenu()
|
||||
} else {
|
||||
MessagesAdapter.openUrl(name.fileSource)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
SBSContextMenu {
|
||||
id: ctxMenu
|
||||
|
||||
msgId: Id
|
||||
location: Body
|
||||
transferId: Id
|
||||
transferName: TransferName
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
|
||||
anchors.fill: root
|
||||
anchors.rightMargin: JamiTheme.preferredMarginSize
|
||||
anchors.leftMargin: JamiTheme.preferredMarginSize
|
||||
spacing : 2
|
||||
|
||||
Rectangle {
|
||||
id: mainRect
|
||||
|
||||
radius: JamiTheme.filesToSendDelegateRadius
|
||||
Layout.preferredHeight: root.height
|
||||
Layout.preferredWidth: root.height
|
||||
color: JamiTheme.transparentColor
|
||||
|
||||
Rectangle {
|
||||
id: rect
|
||||
|
||||
anchors.fill: parent
|
||||
color: fileIcon.visible ? CurrentConversation.color : JamiTheme.transparentColor
|
||||
layer.enabled: true
|
||||
|
||||
layer.effect: OpacityMask {
|
||||
maskSource: Item {
|
||||
width: rect.width
|
||||
height: rect.height
|
||||
Rectangle {
|
||||
anchors.centerIn: parent
|
||||
width: rect.width
|
||||
height: rect.height
|
||||
radius: JamiTheme.chatViewFooterButtonRadius
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: fileIcon.visible ? margin : 0
|
||||
radius: JamiTheme.chatViewFooterButtonRadius
|
||||
color: JamiTheme.secondaryBackgroundColor
|
||||
|
||||
ResponsiveImage {
|
||||
id: fileIcon
|
||||
visible : !mediaInfo.isImage && !mediaInfo.isAnimatedImage
|
||||
anchors.fill: parent
|
||||
anchors.margins: 8
|
||||
source: JamiResources.file_black_24dp_svg
|
||||
cache: false
|
||||
color: JamiTheme.textColor
|
||||
}
|
||||
|
||||
AnimatedImage {
|
||||
id: name
|
||||
|
||||
property string fileSource: ""
|
||||
anchors.fill: parent
|
||||
cache: false
|
||||
|
||||
asynchronous: true
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
|
||||
source: {
|
||||
fileSource = "file://" + Body
|
||||
if (!mediaInfo.isImage && !mediaInfo.isAnimatedImage){
|
||||
return ""
|
||||
}
|
||||
return "file://" + Body
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
id: info
|
||||
Layout.preferredHeight: root.height
|
||||
Layout.fillWidth: true
|
||||
color : JamiTheme.transparentColor
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
|
||||
ColumnLayout {
|
||||
|
||||
anchors.margins: 5
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
|
||||
Text {
|
||||
id: fileName
|
||||
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
Layout.preferredWidth: info.width
|
||||
font.pointSize: JamiTheme.filesToSendDelegateFontPointSize
|
||||
color: JamiTheme.chatviewTextColor
|
||||
font.bold : true
|
||||
text: TransferName
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
|
||||
RowLayout {
|
||||
id: infoLayout
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
spacing: FileExtension.length === 0 ? 0 : 2
|
||||
|
||||
Text {
|
||||
id: fileExtension
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
font.pointSize: JamiTheme.filesToSendDelegateFontPointSize
|
||||
font.capitalization: Font.AllUppercase
|
||||
color: JamiTheme.chatviewTextColor
|
||||
text: FileExtension
|
||||
|
||||
elide: Text.ElideMiddle
|
||||
}
|
||||
|
||||
Text {
|
||||
id: fileProperty
|
||||
font.pointSize: JamiTheme.filesToSendDelegateFontPointSize
|
||||
color: JamiTheme.chatviewTextColor
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
Layout.maximumWidth: info.width - fileExtension.width - infoLayout.spacing
|
||||
text: " " + UtilsAdapter.humanFileSize(TotalSize) + ", " + MessagesAdapter.getFormattedDay(Timestamp)
|
||||
+ " - " + MessagesAdapter.getFormattedTime(Timestamp)
|
||||
elide: Text.ElideRight
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -21,6 +21,7 @@ import QtQuick.Controls
|
|||
import QtQuick.Layouts
|
||||
import Qt.labs.platform
|
||||
import Qt5Compat.GraphicalEffects
|
||||
import SortFilterProxyModel
|
||||
|
||||
import net.jami.Models 1.1
|
||||
import net.jami.Adapters 1.1
|
||||
|
@ -29,63 +30,58 @@ import net.jami.Constants 1.1
|
|||
import "../../commoncomponents"
|
||||
import "../../settingsview/components"
|
||||
|
||||
Flickable {
|
||||
JamiListView {
|
||||
id: root
|
||||
|
||||
contentHeight: flow.implicitHeight
|
||||
contentWidth: width
|
||||
anchors.fill: parent
|
||||
topMargin: JamiTheme.preferredMarginSize
|
||||
bottomMargin: JamiTheme.preferredMarginSize
|
||||
spacing: JamiTheme.preferredMarginSize
|
||||
|
||||
property int spacingFlow: JamiTheme.swarmDetailsPageDocumentsMargins
|
||||
property real flickableWidth: width
|
||||
property int numberElementsPerRow: {
|
||||
var sizeW = flow.width
|
||||
var breakSize = JamiTheme.swarmDetailsPageDocumentsMediaSize
|
||||
return Math.floor(sizeW / breakSize)
|
||||
}
|
||||
property int spacingLength: spacingFlow * (numberElementsPerRow - 1)
|
||||
property color themeColor: CurrentConversation.color
|
||||
property string textFilter: ""
|
||||
property var convId: CurrentConversation.id
|
||||
|
||||
onVisibleChanged: {
|
||||
if (visible) {
|
||||
MessagesAdapter.startSearch(textFilter,true)
|
||||
}
|
||||
}
|
||||
|
||||
onConvIdChanged: {
|
||||
if (visible) {
|
||||
MessagesAdapter.startSearch(textFilter,true)
|
||||
}
|
||||
}
|
||||
|
||||
onTextFilterChanged: {
|
||||
MessagesAdapter.startSearch(textFilter,true)
|
||||
}
|
||||
|
||||
Flow {
|
||||
id: flow
|
||||
model: SortFilterProxyModel {
|
||||
id: proxyModel
|
||||
|
||||
width: parent.width
|
||||
spacing: spacingFlow
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
property var messageListModel: MessagesAdapter.mediaMessageListModel
|
||||
readonly property int documentType: Interaction.Type.DATA_TRANSFER
|
||||
readonly property int transferFinishedType: Interaction.Status.TRANSFER_FINISHED
|
||||
readonly property int transferSuccesType: Interaction.Status.SUCCESS
|
||||
|
||||
Repeater {
|
||||
model: root.visible ? MessagesAdapter.mediaMessageListModel : 0
|
||||
onMessageListModelChanged: sourceModel = root.visible && messageListModel ?
|
||||
messageListModel :
|
||||
null
|
||||
|
||||
delegate: Loader {
|
||||
id: loaderRoot
|
||||
sorters: RoleSorter { roleName: "Timestamp"; sortOrder: Qt.DescendingOrder }
|
||||
|
||||
sourceComponent: {
|
||||
if (MessagesAdapter.isDocument(Type)) {
|
||||
if(Status === Interaction.Status.TRANSFER_FINISHED || Status === Interaction.Status.SUCCESS ){
|
||||
if (Object.keys(MessagesAdapter.getMediaInfo(Body)).length !== 0 && WITH_WEBENGINE)
|
||||
return localMediaMsgComp
|
||||
filters: [
|
||||
ExpressionFilter { expression: Type === proxyModel.documentType },
|
||||
ExpressionFilter { expression: Status === proxyModel.transferFinishedType || Status === proxyModel.transferSuccesType }
|
||||
]
|
||||
|
||||
return fileMsgComp
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
FilePreview {
|
||||
id: fileMsgComp
|
||||
}
|
||||
MediaPreview {
|
||||
id: localMediaMsgComp
|
||||
}
|
||||
}
|
||||
}
|
||||
delegate: DocumentPreview {
|
||||
id: member
|
||||
width: root.width
|
||||
height: Math.max(JamiTheme.swarmDetailsPageDocumentsHeight,JamiTheme.swarmDetailsPageDocumentsMinHeight)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ Item {
|
|||
id: rect
|
||||
|
||||
anchors.fill: parent
|
||||
color: CurrentConversation.color // "#E5E5E5"
|
||||
color: fileIcon.visible ? CurrentConversation.color : JamiTheme.transparentColor
|
||||
layer.enabled: true
|
||||
|
||||
layer.effect: OpacityMask {
|
||||
|
@ -65,33 +65,28 @@ Item {
|
|||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
width: parent.width
|
||||
anchors.bottom: parent.bottom
|
||||
height: 3/4 * mainRect.height
|
||||
color: CurrentConversation.color
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: margin
|
||||
anchors.margins: fileIcon.visible ? margin : 0
|
||||
radius: JamiTheme.chatViewFooterButtonRadius
|
||||
color: JamiTheme.whiteColor
|
||||
color: JamiTheme.secondaryBackgroundColor
|
||||
|
||||
ResponsiveImage {
|
||||
id: fileIcon
|
||||
visible : !IsImage
|
||||
anchors.fill: parent
|
||||
anchors.margins: margin
|
||||
anchors.margins: 14
|
||||
source: JamiResources.file_black_24dp_svg
|
||||
cache: false
|
||||
color: JamiTheme.textColor
|
||||
}
|
||||
|
||||
AnimatedImage {
|
||||
id: name
|
||||
|
||||
anchors.fill: parent
|
||||
anchors.margins: margin
|
||||
cache: false
|
||||
|
||||
asynchronous: true
|
||||
fillMode: Image.PreserveAspectCrop
|
||||
|
@ -144,7 +139,6 @@ Item {
|
|||
}
|
||||
|
||||
Rectangle {
|
||||
|
||||
id: info
|
||||
Layout.preferredHeight: root.height -margin
|
||||
Layout.preferredWidth: JamiTheme.layoutWidthFileTransfer
|
||||
|
@ -153,7 +147,7 @@ Item {
|
|||
|
||||
ColumnLayout {
|
||||
|
||||
anchors.margins: margin
|
||||
anchors.margins: 5
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
|
||||
|
|
|
@ -132,14 +132,12 @@ DualPaneView {
|
|||
id: currentAccountAvatar
|
||||
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
darkTheme: UtilsAdapter.luma(root.color)
|
||||
width: avatarSize
|
||||
height: avatarSize
|
||||
|
||||
newItem: true
|
||||
imageId: root.visible ? "temp" : ""
|
||||
avatarSize: 180
|
||||
buttonSize: JamiTheme.smartListAvatarSize
|
||||
}
|
||||
|
||||
EditableLineEdit {
|
||||
|
|
|
@ -36,11 +36,17 @@ Rectangle {
|
|||
property int tabBarItemsLength: tabBar.contentChildren.length
|
||||
|
||||
color: CurrentConversation.color
|
||||
|
||||
property var isAdmin: UtilsAdapter.getParticipantRole(CurrentAccount.id,
|
||||
CurrentConversation.id,
|
||||
CurrentAccount.uri) === Member.Role.ADMIN
|
||||
|| CurrentConversation.isCoreDialog
|
||||
|
||||
property string textColor: UtilsAdapter.luma(root.color) ?
|
||||
JamiTheme.chatviewTextColorLight :
|
||||
JamiTheme.chatviewTextColorDark
|
||||
|
||||
|
||||
ColumnLayout {
|
||||
id: swarmProfileDetails
|
||||
anchors.fill: parent
|
||||
|
@ -52,143 +58,85 @@ Rectangle {
|
|||
Layout.fillWidth: true
|
||||
spacing: JamiTheme.preferredMarginSize
|
||||
|
||||
PhotoboothView {
|
||||
id: currentAccountAvatar
|
||||
darkTheme: UtilsAdapter.luma(root.color)
|
||||
readOnly: !root.isAdmin
|
||||
width: avatarSize
|
||||
height: avatarSize
|
||||
RowLayout {
|
||||
spacing: 15
|
||||
Layout.leftMargin: 15
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
PhotoboothView {
|
||||
id: currentAccountAvatar
|
||||
|
||||
newItem: true
|
||||
imageId: LRCInstance.selectedConvUid
|
||||
avatarSize: JamiTheme.smartListAvatarSize * 3/2
|
||||
}
|
||||
readOnly: !root.isAdmin
|
||||
width: avatarSize
|
||||
height: avatarSize
|
||||
|
||||
EditableLineEdit {
|
||||
id: titleLine
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
Layout.topMargin: 5
|
||||
|
||||
TextMetrics {
|
||||
id: formattedTitle
|
||||
|
||||
font.pointSize: JamiTheme.titleFontSize
|
||||
elide: !titleLine.editable ? Text.ElideRight : Text.ElideNone
|
||||
elideWidth: titleLine.lineEdit.width - 25
|
||||
text: CurrentConversation.title
|
||||
newItem: true
|
||||
imageId: LRCInstance.selectedConvUid
|
||||
avatarSize: JamiTheme.smartListAvatarSize * 3/2
|
||||
}
|
||||
|
||||
wrapMode: Text.NoWrap
|
||||
font.pointSize: JamiTheme.titleFontSize
|
||||
ColumnLayout {
|
||||
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
signal accepted
|
||||
|
||||
firstIco: JamiResources.round_edit_24dp_svg
|
||||
secondIco: editable ? JamiResources.close_black_24dp_svg : ""
|
||||
ModalTextEdit {
|
||||
id: titleLine
|
||||
|
||||
fontSize: 20
|
||||
borderColor: "transparent"
|
||||
isSwarmDetail: true
|
||||
readOnly: !isAdmin
|
||||
|
||||
text: formattedTitle.elidedText
|
||||
readOnly: !root.isAdmin
|
||||
placeholderText: JamiStrings.swarmName
|
||||
placeholderTextColor: {
|
||||
if (editable) {
|
||||
if (UtilsAdapter.luma(root.color)) {
|
||||
return JamiTheme.placeholderTextColorWhite
|
||||
} else {
|
||||
return JamiTheme.placeholderTextColor
|
||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||
Layout.preferredWidth: Math.min(217,swarmProfileDetails.width - currentAccountAvatar.width - 30 - JamiTheme.settingsMarginSize)
|
||||
|
||||
staticText: CurrentConversation.title
|
||||
|
||||
textColor: root.textColor
|
||||
prefixIconColor: root.textColor
|
||||
|
||||
onAccepted: {
|
||||
ConversationsAdapter.updateConversationTitle(
|
||||
LRCInstance.selectedConvUid, dynamicText)
|
||||
}
|
||||
} else {
|
||||
if (UtilsAdapter.luma(root.color)) {
|
||||
return JamiTheme.chatviewTextColorLight
|
||||
} else {
|
||||
return JamiTheme.chatviewTextColorDark
|
||||
|
||||
onActiveFocusChanged: {
|
||||
if(!activeFocus){
|
||||
ConversationsAdapter.updateConversationTitle(LRCInstance.selectedConvUid, dynamicText)
|
||||
}
|
||||
}
|
||||
|
||||
infoTipLineText: JamiStrings.swarmName
|
||||
}
|
||||
|
||||
ModalTextEdit {
|
||||
id: descriptionLineButton
|
||||
|
||||
isSwarmDetail: true
|
||||
|
||||
readOnly: !isAdmin || CurrentConversation.isCoreDialog
|
||||
|
||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||
Layout.preferredWidth: Math.min(217,swarmProfileDetails.width - currentAccountAvatar.width - 30 - JamiTheme.settingsMarginSize)
|
||||
|
||||
staticText: CurrentConversation.description
|
||||
placeholderText: JamiStrings.addADescription
|
||||
|
||||
textColor: root.textColor
|
||||
prefixIconColor: root.textColor
|
||||
|
||||
onAccepted: ConversationsAdapter.updateConversationDescription(
|
||||
LRCInstance.selectedConvUid, dynamicText)
|
||||
|
||||
onActiveFocusChanged: {
|
||||
if(!activeFocus){
|
||||
ConversationsAdapter.updateConversationDescription(
|
||||
LRCInstance.selectedConvUid, dynamicText)
|
||||
}
|
||||
}
|
||||
|
||||
infoTipLineText: JamiStrings.addADescription
|
||||
}
|
||||
}
|
||||
tooltipText: JamiStrings.swarmName
|
||||
backgroundColor: root.color
|
||||
color: UtilsAdapter.luma(backgroundColor) ?
|
||||
JamiTheme.chatviewTextColorLight :
|
||||
JamiTheme.chatviewTextColorDark
|
||||
|
||||
onEditingFinished: {
|
||||
if (text !== CurrentConversation.title)
|
||||
ConversationsAdapter.updateConversationTitle(LRCInstance.selectedConvUid, text)
|
||||
}
|
||||
onSecondIcoClicked: {editable = !editable}
|
||||
}
|
||||
|
||||
EditableLineEdit {
|
||||
id: descriptionLine
|
||||
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
Layout.leftMargin: 16
|
||||
Layout.rightMargin: 16
|
||||
|
||||
font.pointSize: JamiTheme.menuFontSize
|
||||
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
|
||||
fontSize: 16
|
||||
|
||||
firstIco: JamiResources.round_edit_24dp_svg
|
||||
secondIco: editable ? JamiResources.close_black_24dp_svg : ""
|
||||
borderColor: "transparent"
|
||||
|
||||
TextMetrics {
|
||||
id: formattedDescription
|
||||
|
||||
font.pointSize: JamiTheme.titleFontSize
|
||||
elide: !descriptionLine.editable ? Text.ElideRight : Text.ElideNone
|
||||
elideWidth: descriptionLine.lineEdit.width - 25
|
||||
text: CurrentConversation.description
|
||||
}
|
||||
|
||||
wrapMode: Text.NoWrap
|
||||
|
||||
text: formattedDescription.elidedText
|
||||
readOnly: !root.isAdmin || CurrentConversation.isCoreDialog
|
||||
visible: root.isAdmin || text.length > 0
|
||||
placeholderText: JamiStrings.addADescription
|
||||
placeholderTextColor: {
|
||||
if (editable) {
|
||||
if (UtilsAdapter.luma(root.color)) {
|
||||
return JamiTheme.placeholderTextColorWhite
|
||||
} else {
|
||||
return JamiTheme.placeholderTextColor
|
||||
}
|
||||
} else {
|
||||
if (UtilsAdapter.luma(root.color)) {
|
||||
return JamiTheme.chatviewTextColorLight
|
||||
} else {
|
||||
return JamiTheme.chatviewTextColorDark
|
||||
}
|
||||
}
|
||||
}
|
||||
tooltipText: JamiStrings.addADescription
|
||||
backgroundColor: root.color
|
||||
color: UtilsAdapter.luma(backgroundColor) ?
|
||||
JamiTheme.chatviewTextColorLight :
|
||||
JamiTheme.chatviewTextColorDark
|
||||
|
||||
onEditingFinished: {
|
||||
if (text !== CurrentConversation.description)
|
||||
ConversationsAdapter.updateConversationDescription(
|
||||
LRCInstance.selectedConvUid, text)
|
||||
}
|
||||
|
||||
onSecondIcoClicked: {editable = !editable}
|
||||
}
|
||||
|
||||
TabBar {
|
||||
|
@ -252,17 +200,19 @@ Rectangle {
|
|||
}
|
||||
}
|
||||
|
||||
DetailsTabButton {
|
||||
id: settingsTabButton
|
||||
objectName: "settings"
|
||||
labelText: JamiStrings.settings
|
||||
}
|
||||
|
||||
|
||||
DetailsTabButton {
|
||||
id: documentsTabButton
|
||||
objectName: "documents"
|
||||
labelText: JamiStrings.documents
|
||||
}
|
||||
|
||||
DetailsTabButton {
|
||||
id: settingsTabButton
|
||||
objectName: "settings"
|
||||
labelText: JamiStrings.settings
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -282,10 +232,9 @@ Rectangle {
|
|||
Rectangle {
|
||||
id: details
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: root.height - header.height - JamiTheme.preferredMarginSize
|
||||
Layout.preferredHeight: root.height - header.height - 2*JamiTheme.preferredMarginSize
|
||||
color: JamiTheme.secondaryBackgroundColor
|
||||
|
||||
|
||||
JamiFlickable {
|
||||
id: settingsScrollView
|
||||
property ScrollBar vScrollBar: ScrollBar.vertical
|
||||
|
@ -297,11 +246,12 @@ Rectangle {
|
|||
id: aboutSwarm
|
||||
anchors.left: parent.left
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: JamiTheme.settingsMarginSize
|
||||
visible: tabBar.currentItemName === "settings"
|
||||
Layout.alignment: Qt.AlignTop
|
||||
spacing: 0
|
||||
|
||||
SwarmDetailsItem {
|
||||
id: firstParameter
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: JamiTheme.settingsFontSize + 2 * JamiTheme.preferredMarginSize + 4
|
||||
|
||||
|
@ -310,6 +260,7 @@ Rectangle {
|
|||
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: JamiTheme.preferredMarginSize
|
||||
anchors.rightMargin: JamiTheme.settingsMarginSize
|
||||
|
||||
checked: CurrentConversation.ignoreNotifications
|
||||
|
||||
|
@ -333,7 +284,7 @@ Rectangle {
|
|||
anchors.top: parent.top
|
||||
anchors.margins: JamiTheme.preferredMarginSize
|
||||
text: JamiStrings.leaveConversation
|
||||
font.pointSize: JamiTheme.settingsFontSize
|
||||
font.pixelSize: JamiTheme.participantSwarmDetailFontSize
|
||||
font.kerning: true
|
||||
elide: Text.ElideRight
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
|
@ -369,6 +320,7 @@ Rectangle {
|
|||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: JamiTheme.preferredMarginSize
|
||||
anchors.rightMargin: JamiTheme.preferredMarginSize
|
||||
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
|
@ -376,7 +328,7 @@ Rectangle {
|
|||
Layout.rightMargin: JamiTheme.preferredMarginSize
|
||||
|
||||
text: JamiStrings.chooseAColor
|
||||
font.pointSize: JamiTheme.settingsFontSize
|
||||
font.pixelSize: JamiTheme.participantSwarmDetailFontSize
|
||||
font.kerning: true
|
||||
elide: Text.ElideRight
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
|
@ -416,6 +368,7 @@ Rectangle {
|
|||
RowLayout {
|
||||
anchors.fill: parent
|
||||
anchors.leftMargin: JamiTheme.preferredMarginSize
|
||||
anchors.rightMargin: JamiTheme.preferredMarginSize
|
||||
|
||||
Text {
|
||||
id: settingsSwarmText
|
||||
|
@ -425,7 +378,7 @@ Rectangle {
|
|||
Layout.maximumWidth: settingsSwarmItem.width / 2
|
||||
|
||||
text: JamiStrings.defaultCallHost
|
||||
font.pointSize: JamiTheme.settingsFontSize
|
||||
font.pixelSize: JamiTheme.participantSwarmDetailFontSize
|
||||
font.kerning: true
|
||||
elide: Text.ElideRight
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
|
@ -439,7 +392,7 @@ Rectangle {
|
|||
id: swarmRdvPref
|
||||
spacing: 10
|
||||
Layout.alignment: Qt.AlignRight
|
||||
Layout.maximumWidth: settingsSwarmItem.width / 2
|
||||
Layout.fillWidth: true
|
||||
|
||||
Connections {
|
||||
target: CurrentConversation
|
||||
|
@ -467,6 +420,7 @@ Rectangle {
|
|||
ColumnLayout {
|
||||
spacing: 0
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
Layout.fillWidth: true
|
||||
|
||||
ElidedTextLabel {
|
||||
id: bestName
|
||||
|
@ -479,12 +433,14 @@ Rectangle {
|
|||
else
|
||||
return UtilsAdapter.getBestNameForUri(CurrentAccount.id, CurrentConversation.rdvAccount)
|
||||
}
|
||||
maxWidth: JamiTheme.preferredFieldWidth
|
||||
maxWidth: settingsSwarmItem.width / 2 - JamiTheme.contactMessageAvatarSize
|
||||
|
||||
font.pointSize: JamiTheme.participantFontSize
|
||||
font.pointSize: eText === JamiStrings.none ? JamiTheme.settingsFontSize : JamiTheme.smartlistItemInfoFontSize
|
||||
font.weight: eText === JamiStrings.none ? Font.Medium : Font.Normal
|
||||
color: JamiTheme.primaryForegroundColor
|
||||
font.kerning: true
|
||||
|
||||
horizontalAlignment: Text.AlignRight
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
|
||||
|
@ -493,9 +449,9 @@ Rectangle {
|
|||
|
||||
eText: CurrentConversation.rdvDevice === "" ? JamiStrings.none : CurrentConversation.rdvDevice
|
||||
visible: CurrentConversation.rdvDevice !== ""
|
||||
maxWidth: JamiTheme.preferredFieldWidth
|
||||
maxWidth: settingsSwarmItem.width / 2 - JamiTheme.contactMessageAvatarSize
|
||||
|
||||
font.pointSize: JamiTheme.participantFontSize
|
||||
font.pointSize: JamiTheme.settingsFontSize
|
||||
color: JamiTheme.textColorHovered
|
||||
font.kerning: true
|
||||
|
||||
|
@ -529,7 +485,7 @@ Rectangle {
|
|||
Layout.rightMargin: JamiTheme.preferredMarginSize
|
||||
|
||||
text: JamiStrings.typeOfSwarm
|
||||
font.pointSize: JamiTheme.settingsFontSize
|
||||
font.pixelSize: JamiTheme.participantSwarmDetailFontSize
|
||||
font.kerning: true
|
||||
elide: Text.ElideRight
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
|
@ -538,13 +494,15 @@ Rectangle {
|
|||
color: JamiTheme.textColor
|
||||
}
|
||||
|
||||
Label {
|
||||
Text {
|
||||
id: typeOfSwarmLabel
|
||||
|
||||
Layout.alignment: Qt.AlignRight
|
||||
Layout.rightMargin: JamiTheme.preferredMarginSize
|
||||
|
||||
color: JamiTheme.textColor
|
||||
|
||||
font.pixelSize: JamiTheme.participantSwarmDetailFontSize
|
||||
font.weight: Font.Medium
|
||||
text: CurrentConversation.modeString
|
||||
}
|
||||
}
|
||||
|
@ -562,7 +520,7 @@ Rectangle {
|
|||
Layout.maximumWidth: parent.width / 2
|
||||
|
||||
text: JamiStrings.identifier
|
||||
font.pointSize: JamiTheme.settingsFontSize
|
||||
font.pixelSize: JamiTheme.participantSwarmDetailFontSize
|
||||
font.kerning: true
|
||||
elide: Text.ElideRight
|
||||
horizontalAlignment: Text.AlignLeft
|
||||
|
@ -573,9 +531,12 @@ Rectangle {
|
|||
|
||||
Text {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
Layout.rightMargin: JamiTheme.settingsMarginSize
|
||||
|
||||
Layout.maximumWidth: parent.width / 2
|
||||
|
||||
color: JamiTheme.textColor
|
||||
font.pixelSize: JamiTheme.participantSwarmDetailFontSize
|
||||
|
||||
|
||||
text: CurrentConversation.id
|
||||
|
@ -643,7 +604,6 @@ Rectangle {
|
|||
anchors.rightMargin: JamiTheme.preferredMarginSize
|
||||
|
||||
Avatar {
|
||||
id: avatar
|
||||
width: JamiTheme.smartListAvatarSize
|
||||
height: JamiTheme.smartListAvatarSize
|
||||
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||
|
@ -651,9 +611,9 @@ Rectangle {
|
|||
z: -index
|
||||
opacity: (MemberRole === Member.Role.INVITED || MemberRole === Member.Role.BANNED)? 0.5 : 1
|
||||
|
||||
imageId: CurrentAccount.uri == MemberUri ? CurrentAccount.id : MemberUri
|
||||
imageId: CurrentAccount.uri === MemberUri ? CurrentAccount.id : MemberUri
|
||||
showPresenceIndicator: UtilsAdapter.getContactPresence(CurrentAccount.id, MemberUri)
|
||||
mode: CurrentAccount.uri == MemberUri ? Avatar.Mode.Account : Avatar.Mode.Contact
|
||||
mode: CurrentAccount.uri === MemberUri ? Avatar.Mode.Account : Avatar.Mode.Contact
|
||||
}
|
||||
|
||||
ElidedTextLabel {
|
||||
|
@ -666,7 +626,7 @@ Rectangle {
|
|||
eText: UtilsAdapter.getContactBestName(CurrentAccount.id, MemberUri)
|
||||
maxWidth: width
|
||||
|
||||
font.pointSize: JamiTheme.participantFontSize
|
||||
font.pointSize: JamiTheme.settingsFontSize
|
||||
color: JamiTheme.primaryForegroundColor
|
||||
opacity: (MemberRole === Member.Role.INVITED || MemberRole === Member.Role.BANNED)? 0.5 : 1
|
||||
font.kerning: true
|
||||
|
@ -695,7 +655,7 @@ Rectangle {
|
|||
}
|
||||
maxWidth: JamiTheme.preferredFieldWidth
|
||||
|
||||
font.pointSize: JamiTheme.participantFontSize
|
||||
font.pointSize: JamiTheme.settingsFontSize
|
||||
color: JamiTheme.textColorHovered
|
||||
opacity: (MemberRole === Member.Role.INVITED || MemberRole === Member.Role.BANNED)? 0.5 : 1
|
||||
font.kerning: true
|
||||
|
@ -710,7 +670,6 @@ Rectangle {
|
|||
DocumentsScrollview {
|
||||
id: documents
|
||||
|
||||
clip: true
|
||||
visible: tabBar.currentItemName === "documents"
|
||||
anchors.fill: parent
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@ ListSelectionView {
|
|||
// Trigger an update to messages if needed.
|
||||
// Currently needed when changing the show link preview setting.
|
||||
CurrentConversation.reloadInteractions()
|
||||
settingsViewRect.stopBooth()
|
||||
if (UtilsAdapter.getAccountListSize() === 0) {
|
||||
viewCoordinator.requestAppWindowWizardView()
|
||||
} else {
|
||||
|
|
|
@ -30,18 +30,6 @@ ColumnLayout {
|
|||
spacing: 8
|
||||
id: root
|
||||
|
||||
Connections {
|
||||
target: settingsViewRect
|
||||
|
||||
function onStopBooth() {
|
||||
stopBooth()
|
||||
}
|
||||
}
|
||||
|
||||
function stopBooth() {
|
||||
currentAccountAvatar.stopBooth()
|
||||
}
|
||||
|
||||
Text {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||
|
@ -59,7 +47,6 @@ ColumnLayout {
|
|||
|
||||
PhotoboothView {
|
||||
id: currentAccountAvatar
|
||||
darkTheme: UtilsAdapter.luma(JamiTheme.primaryBackgroundColor)
|
||||
width: avatarSize
|
||||
height: avatarSize
|
||||
|
||||
|
@ -67,7 +54,6 @@ ColumnLayout {
|
|||
|
||||
imageId: LRCInstance.currentAccountId
|
||||
avatarSize: 180
|
||||
buttonSize: JamiTheme.smartListAvatarSize
|
||||
}
|
||||
|
||||
ModalTextEdit {
|
||||
|
|
|
@ -110,14 +110,6 @@ BaseView {
|
|||
onShowThisPage: controlPanelStackView.setPage(this)
|
||||
}
|
||||
|
||||
ProfilePage {
|
||||
id: profilePage
|
||||
|
||||
objectName: "profilePage"
|
||||
|
||||
onShowThisPage: controlPanelStackView.setPage(this)
|
||||
}
|
||||
|
||||
ImportFromDevicePage {
|
||||
id: importFromDevicePage
|
||||
|
||||
|
|
|
@ -430,8 +430,6 @@ Rectangle {
|
|||
|
||||
width: avatarSize
|
||||
height: avatarSize
|
||||
darkTheme: UtilsAdapter.luma(JamiTheme.primaryBackgroundColor)
|
||||
|
||||
|
||||
Layout.alignment: Qt.AlignLeft
|
||||
Layout.topMargin: 10
|
||||
|
@ -441,7 +439,6 @@ Rectangle {
|
|||
newItem: true
|
||||
imageId: visible? "temp" : ""
|
||||
avatarSize: 80
|
||||
buttonSize: JamiTheme.smartListAvatarSize
|
||||
}
|
||||
|
||||
ModalTextEdit {
|
||||
|
|
|
@ -284,7 +284,6 @@ Rectangle {
|
|||
|
||||
PhotoboothView {
|
||||
id: currentAccountAvatar
|
||||
darkTheme: UtilsAdapter.luma(JamiTheme.primaryBackgroundColor)
|
||||
width: avatarSize
|
||||
height: avatarSize
|
||||
|
||||
|
@ -294,7 +293,6 @@ Rectangle {
|
|||
newItem: true
|
||||
imageId: visible ? "temp" : ""
|
||||
avatarSize: 150
|
||||
buttonSize: JamiTheme.smartListAvatarSize
|
||||
}
|
||||
|
||||
ModalTextEdit {
|
||||
|
|
|
@ -1,240 +0,0 @@
|
|||
/*
|
||||
* Copyright (C) 2021-2023 Savoir-faire Linux Inc.
|
||||
* Author: Yang Wang <yang.wang@savoirfairelinux.com>
|
||||
* Author: Mingrui Zhang <mingrui.zhang@savoirfairelinux.com>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
|
||||
import net.jami.Adapters 1.1
|
||||
import net.jami.Constants 1.1
|
||||
import net.jami.Helpers 1.1
|
||||
import net.jami.Models 1.1
|
||||
|
||||
import "../../commoncomponents"
|
||||
|
||||
Rectangle {
|
||||
id: root
|
||||
|
||||
// trigger a default avatar prior to account generation
|
||||
property string createdAccountId
|
||||
property int preferredHeight: profilePageColumnLayout.implicitHeight
|
||||
|
||||
signal showThisPage
|
||||
|
||||
function initializeOnShowUp() {
|
||||
clearAllTextFields()
|
||||
saveProfileBtn.spinnerTriggered = true
|
||||
}
|
||||
|
||||
function clearAllTextFields() {
|
||||
aliasEdit.clear()
|
||||
}
|
||||
|
||||
color: JamiTheme.backgroundColor
|
||||
|
||||
Connections {
|
||||
target: WizardViewStepModel
|
||||
|
||||
function onMainStepChanged() {
|
||||
if (WizardViewStepModel.mainStep === WizardViewStepModel.MainSteps.Profile) {
|
||||
initializeOnShowUp()
|
||||
root.showThisPage()
|
||||
}
|
||||
}
|
||||
|
||||
function onAccountIsReady(accountId) {
|
||||
saveProfileBtn.spinnerTriggered = false
|
||||
createdAccountId = accountId
|
||||
aliasEdit.forceActiveFocus()
|
||||
}
|
||||
}
|
||||
|
||||
ColumnLayout {
|
||||
id: profilePageColumnLayout
|
||||
|
||||
spacing: JamiTheme.wizardViewPageLayoutSpacing
|
||||
|
||||
width: parent.width
|
||||
anchors.horizontalCenter: parent.horizontalCenter
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
||||
RowLayout {
|
||||
spacing: JamiTheme.wizardViewPageLayoutSpacing
|
||||
|
||||
Layout.topMargin: JamiTheme.wizardViewPageBackButtonMargins
|
||||
Layout.preferredWidth: saveProfileBtn.width
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
|
||||
Label {
|
||||
text: JamiStrings.profileSharedWithContacts
|
||||
color: JamiTheme.textColor
|
||||
font.pointSize: JamiTheme.textFontSize + 3
|
||||
}
|
||||
|
||||
BubbleLabel {
|
||||
Layout.alignment: Qt.AlignRight
|
||||
|
||||
text: JamiStrings.optional
|
||||
bubbleColor: JamiTheme.wizardBlueButtons
|
||||
}
|
||||
}
|
||||
|
||||
PhotoboothView {
|
||||
id: setAvatarWidget
|
||||
|
||||
objectName: "setAvatarWidget"
|
||||
width: avatarSize
|
||||
height: avatarSize
|
||||
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
darkTheme: UtilsAdapter.luma(JamiTheme.primaryBackgroundColor)
|
||||
|
||||
enabled: !saveProfileBtn.spinnerTriggered
|
||||
imageId: createdAccountId
|
||||
avatarSize: 200
|
||||
buttonSize: JamiTheme.smartListAvatarSize
|
||||
|
||||
onFocusOnPreviousItem: {
|
||||
skipProfileSavingButton.forceActiveFocus()
|
||||
}
|
||||
|
||||
onFocusOnNextItem: {
|
||||
aliasEdit.forceActiveFocus()
|
||||
}
|
||||
|
||||
onVisibleChanged: {
|
||||
if (visible)
|
||||
LRCInstance.currentAccountAvatarSet = false
|
||||
}
|
||||
}
|
||||
|
||||
MaterialLineEdit {
|
||||
id: aliasEdit
|
||||
|
||||
objectName: "aliasEdit"
|
||||
|
||||
property string lastFirstChar
|
||||
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
|
||||
focus: visible
|
||||
|
||||
selectByMouse: true
|
||||
enabled: !saveProfileBtn.spinnerTriggered
|
||||
placeholderText: {
|
||||
if (WizardViewStepModel.accountCreationOption !==
|
||||
WizardViewStepModel.AccountCreationOption.CreateRendezVous)
|
||||
return JamiStrings.enterYourName
|
||||
else
|
||||
return JamiStrings.enterRVName
|
||||
}
|
||||
font.pointSize: JamiTheme.textFontSize
|
||||
font.kerning: true
|
||||
|
||||
KeyNavigation.tab: saveProfileBtn
|
||||
KeyNavigation.down: KeyNavigation.tab
|
||||
|
||||
Keys.onPressed: function (keyEvent) {
|
||||
if (keyEvent.key === Qt.Key_Up) {
|
||||
setAvatarWidget.focusOnPreviousPhotoBoothItem()
|
||||
keyEvent.accepted = true
|
||||
}
|
||||
}
|
||||
|
||||
onTextEdited: {
|
||||
if (LRCInstance.currentAccountAvatarSet)
|
||||
return
|
||||
if (text.length === 0) {
|
||||
lastFirstChar = ""
|
||||
AccountAdapter.setCurrAccDisplayName(lastFirstChar)
|
||||
} else if (text.length == 1 && text.charAt(0) !== lastFirstChar) {
|
||||
lastFirstChar = text.charAt(0)
|
||||
AccountAdapter.setCurrAccDisplayName(lastFirstChar)
|
||||
}
|
||||
}
|
||||
|
||||
onAccepted: {
|
||||
if (saveProfileBtn.enabled)
|
||||
saveProfileBtn.clicked()
|
||||
}
|
||||
}
|
||||
|
||||
SpinnerButton {
|
||||
id: saveProfileBtn
|
||||
|
||||
objectName: "saveProfileBtn"
|
||||
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
|
||||
preferredWidth: JamiTheme.wizardButtonWidth
|
||||
|
||||
enabled: !spinnerTriggered
|
||||
normalText: JamiStrings.saveProfile
|
||||
spinnerTriggeredtext: {
|
||||
if (WizardViewStepModel.accountCreationOption ===
|
||||
WizardViewStepModel.AccountCreationOption.CreateRendezVous)
|
||||
return JamiStrings.generatingRV
|
||||
else
|
||||
return JamiStrings.creatingAccount
|
||||
}
|
||||
|
||||
KeyNavigation.tab: skipProfileSavingButton
|
||||
KeyNavigation.up: aliasEdit
|
||||
KeyNavigation.down: KeyNavigation.tab
|
||||
|
||||
onClicked: {
|
||||
AccountAdapter.setCurrAccDisplayName(aliasEdit.text)
|
||||
WizardViewStepModel.nextStep()
|
||||
}
|
||||
}
|
||||
|
||||
MaterialButton {
|
||||
id: skipProfileSavingButton
|
||||
|
||||
objectName: "skipProfileSavingButton"
|
||||
|
||||
Layout.alignment: Qt.AlignCenter
|
||||
|
||||
preferredWidth: JamiTheme.wizardButtonWidth
|
||||
|
||||
text: JamiStrings.skip
|
||||
enabled: saveProfileBtn.enabled
|
||||
color: enabled? JamiTheme.buttonTintedGrey : JamiTheme.buttonTintedGreyInactive
|
||||
hoveredColor: JamiTheme.buttonTintedGreyHovered
|
||||
pressedColor: JamiTheme.buttonTintedGreyPressed
|
||||
secondary: true
|
||||
|
||||
KeyNavigation.up: saveProfileBtn
|
||||
|
||||
Keys.onPressed: function (keyEvent) {
|
||||
if (keyEvent.key === Qt.Key_Down ||
|
||||
keyEvent.key === Qt.Key_Tab) {
|
||||
setAvatarWidget.focusOnNextPhotoBoothItem()
|
||||
keyEvent.accepted = true
|
||||
}
|
||||
}
|
||||
|
||||
onClicked: {
|
||||
AccountAdapter.setCurrentAccountAvatarBase64()
|
||||
aliasEdit.clear()
|
||||
WizardViewStepModel.nextStep()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -26,6 +26,7 @@
|
|||
#include "qtwrapper/conversions_wrap.hpp"
|
||||
|
||||
#include <QAbstractListModel>
|
||||
#include <QFileInfo>
|
||||
|
||||
namespace lrc {
|
||||
|
||||
|
@ -492,6 +493,8 @@ MessageListModel::dataForItem(item_t item, int, int role) const
|
|||
return QVariant(item.second.commit["totalSize"].toInt());
|
||||
case Role::TransferName:
|
||||
return QVariant(item.second.commit["displayName"]);
|
||||
case Role::FileExtension:
|
||||
return QVariant(QFileInfo(item.second.body).suffix());
|
||||
case Role::Readers:
|
||||
return QVariant(messageToReaders_[item.first]);
|
||||
case Role::IsEmojiOnly:
|
||||
|
|
|
@ -54,6 +54,7 @@ struct Info;
|
|||
X(ReplyToAuthor) \
|
||||
X(TotalSize) \
|
||||
X(TransferName) \
|
||||
X(FileExtension) \
|
||||
X(Readers) \
|
||||
X(IsEmojiOnly)
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue