mirror of
https://git.jami.net/savoirfairelinux/jami-client-qt.git
synced 2025-08-07 16:26:12 +02:00
settings: add settings to change the position of the chatview in calls
GitLab: #160 GitLab: #571 Change-Id: Ifc1a4183c614f4754df5b617067a433d1227dcdf
This commit is contained in:
parent
70a6972b7e
commit
a2a263c6c1
4 changed files with 45 additions and 7 deletions
|
@ -44,6 +44,7 @@ extern const QString defaultDownloadPath;
|
||||||
X(EnableDarkTheme, false) \
|
X(EnableDarkTheme, false) \
|
||||||
X(AutoUpdate, true) \
|
X(AutoUpdate, true) \
|
||||||
X(StartMinimized, false) \
|
X(StartMinimized, false) \
|
||||||
|
X(ShowChatviewHorizontally, true) \
|
||||||
X(NeverShowMeAgain, false) \
|
X(NeverShowMeAgain, false) \
|
||||||
X(WindowGeometry, QRectF(qQNaN(), qQNaN(), 0., 0.)) \
|
X(WindowGeometry, QRectF(qQNaN(), qQNaN(), 0., 0.)) \
|
||||||
X(WindowState, QWindow::AutomaticVisibility)
|
X(WindowState, QWindow::AutomaticVisibility)
|
||||||
|
|
|
@ -375,6 +375,9 @@ Item {
|
||||||
property string chatview: qsTr("Chatview")
|
property string chatview: qsTr("Chatview")
|
||||||
property string enableTypingIndicator: qsTr("Enable typing indicators")
|
property string enableTypingIndicator: qsTr("Enable typing indicators")
|
||||||
property string displayHyperlinkPreviews: qsTr("Display hyperlink previews in the chatview")
|
property string displayHyperlinkPreviews: qsTr("Display hyperlink previews in the chatview")
|
||||||
|
property string chatviewPositionInCall: qsTr("Chatview's position in calls")
|
||||||
|
property string bottomOpt: qsTr("Bottom")
|
||||||
|
property string rightOpt: qsTr("Right")
|
||||||
|
|
||||||
// File transfer settings
|
// File transfer settings
|
||||||
property string fileTransfer: qsTr("File transfer")
|
property string fileTransfer: qsTr("File transfer")
|
||||||
|
|
|
@ -25,6 +25,7 @@ import Qt5Compat.GraphicalEffects
|
||||||
|
|
||||||
import net.jami.Models 1.1
|
import net.jami.Models 1.1
|
||||||
import net.jami.Adapters 1.1
|
import net.jami.Adapters 1.1
|
||||||
|
import net.jami.Enums 1.1
|
||||||
import net.jami.Constants 1.1
|
import net.jami.Constants 1.1
|
||||||
|
|
||||||
import "../../commoncomponents"
|
import "../../commoncomponents"
|
||||||
|
@ -64,6 +65,7 @@ Rectangle {
|
||||||
}
|
}
|
||||||
|
|
||||||
function openInCallConversation() {
|
function openInCallConversation() {
|
||||||
|
mainColumnLayout.isHorizontal = UtilsAdapter.getAppValue(Settings.Key.ShowChatviewHorizontally)
|
||||||
inCallMessageWebViewStack.visible = true
|
inCallMessageWebViewStack.visible = true
|
||||||
inCallMessageWebViewStack.push(linkedWebview)
|
inCallMessageWebViewStack.push(linkedWebview)
|
||||||
}
|
}
|
||||||
|
@ -127,11 +129,12 @@ Rectangle {
|
||||||
|
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
orientation: Qt.Vertical
|
property bool isHorizontal: false // Calculated when showing the stack view
|
||||||
|
orientation: isHorizontal ? Qt.Horizontal : Qt.Vertical
|
||||||
|
|
||||||
handle: Rectangle {
|
handle: Rectangle {
|
||||||
implicitWidth: root.width
|
implicitWidth: isHorizontal ? JamiTheme.splitViewHandlePreferredWidth : root.width
|
||||||
implicitHeight: JamiTheme.splitViewHandlePreferredWidth
|
implicitHeight: isHorizontal ? root.height : JamiTheme.splitViewHandlePreferredWidth
|
||||||
color: SplitHandle.pressed ? JamiTheme.pressColor :
|
color: SplitHandle.pressed ? JamiTheme.pressColor :
|
||||||
(SplitHandle.hovered ? JamiTheme.hoverColor :
|
(SplitHandle.hovered ? JamiTheme.hoverColor :
|
||||||
JamiTheme.tabbarBorderColor)
|
JamiTheme.tabbarBorderColor)
|
||||||
|
@ -139,9 +142,11 @@ Rectangle {
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: callPageMainRect
|
id: callPageMainRect
|
||||||
SplitView.preferredHeight: (root.height / 3) * 2
|
SplitView.preferredHeight: mainColumnLayout.isHorizontal ? root.height : (root.height / 3) * 2
|
||||||
|
SplitView.preferredWidth: mainColumnLayout.isHorizontal ? (root.width / 3) * 2 : root.width
|
||||||
SplitView.minimumHeight: root.height / 2 + 20
|
SplitView.minimumHeight: root.height / 2 + 20
|
||||||
SplitView.fillWidth: true
|
SplitView.minimumWidth: root.width / 2 + 20
|
||||||
|
SplitView.fillWidth: !mainColumnLayout.isHorizontal
|
||||||
|
|
||||||
MouseArea {
|
MouseArea {
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
@ -379,8 +384,9 @@ Rectangle {
|
||||||
StackView {
|
StackView {
|
||||||
id: inCallMessageWebViewStack
|
id: inCallMessageWebViewStack
|
||||||
|
|
||||||
SplitView.preferredHeight: root.height / 3
|
SplitView.preferredHeight: mainColumnLayout.isHorizontal ? root.height : root.height / 3
|
||||||
SplitView.fillWidth: true
|
SplitView.preferredWidth: mainColumnLayout.isHorizontal ? root.width / 3 : root.width
|
||||||
|
SplitView.fillWidth: false
|
||||||
|
|
||||||
visible: false
|
visible: false
|
||||||
|
|
||||||
|
|
|
@ -77,4 +77,32 @@ ColumnLayout {
|
||||||
UtilsAdapter.setAppValue(Settings.Key.DisplayHyperlinkPreviews, checked)
|
UtilsAdapter.setAppValue(Settings.Key.DisplayHyperlinkPreviews, checked)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SettingsComboBox {
|
||||||
|
id: outputComboBoxSetting
|
||||||
|
|
||||||
|
Layout.fillWidth: true
|
||||||
|
Layout.preferredHeight: JamiTheme.preferredFieldHeight
|
||||||
|
Layout.leftMargin: JamiTheme.preferredMarginSize
|
||||||
|
|
||||||
|
labelText: JamiStrings.chatviewPositionInCall
|
||||||
|
fontPointSize: JamiTheme.settingsFontSize
|
||||||
|
comboModel: ListModel {
|
||||||
|
Component.onCompleted: {
|
||||||
|
append({ textDisplay: JamiStrings.bottomOpt })
|
||||||
|
append({ textDisplay: JamiStrings.rightOpt })
|
||||||
|
}
|
||||||
|
}
|
||||||
|
widthOfComboBox: itemWidth
|
||||||
|
role: "textDisplay"
|
||||||
|
|
||||||
|
modelIndex: UtilsAdapter.getAppValue(Settings.Key.ShowChatviewHorizontally) ? 1 : 0
|
||||||
|
|
||||||
|
onActivated: {
|
||||||
|
UtilsAdapter.setAppValue(
|
||||||
|
Settings.Key.ShowChatviewHorizontally,
|
||||||
|
comboModel.get(modelIndex).textDisplay === JamiStrings.rightOpt
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue