Skip to content
Snippets Groups Projects
Commit a2a263c6 authored by Sébastien Blin's avatar Sébastien Blin
Browse files

settings: add settings to change the position of the chatview in calls

GitLab: #160
GitLab: #571
Change-Id: Ifc1a4183c614f4754df5b617067a433d1227dcdf
parent 70a6972b
No related branches found
No related tags found
No related merge requests found
......@@ -44,6 +44,7 @@ extern const QString defaultDownloadPath;
X(EnableDarkTheme, false) \
X(AutoUpdate, true) \
X(StartMinimized, false) \
X(ShowChatviewHorizontally, true) \
X(NeverShowMeAgain, false) \
X(WindowGeometry, QRectF(qQNaN(), qQNaN(), 0., 0.)) \
X(WindowState, QWindow::AutomaticVisibility)
......
......@@ -375,6 +375,9 @@ Item {
property string chatview: qsTr("Chatview")
property string enableTypingIndicator: qsTr("Enable typing indicators")
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
property string fileTransfer: qsTr("File transfer")
......
......@@ -25,6 +25,7 @@ import Qt5Compat.GraphicalEffects
import net.jami.Models 1.1
import net.jami.Adapters 1.1
import net.jami.Enums 1.1
import net.jami.Constants 1.1
import "../../commoncomponents"
......@@ -64,6 +65,7 @@ Rectangle {
}
function openInCallConversation() {
mainColumnLayout.isHorizontal = UtilsAdapter.getAppValue(Settings.Key.ShowChatviewHorizontally)
inCallMessageWebViewStack.visible = true
inCallMessageWebViewStack.push(linkedWebview)
}
......@@ -127,11 +129,12 @@ Rectangle {
anchors.fill: parent
orientation: Qt.Vertical
property bool isHorizontal: false // Calculated when showing the stack view
orientation: isHorizontal ? Qt.Horizontal : Qt.Vertical
handle: Rectangle {
implicitWidth: root.width
implicitHeight: JamiTheme.splitViewHandlePreferredWidth
implicitWidth: isHorizontal ? JamiTheme.splitViewHandlePreferredWidth : root.width
implicitHeight: isHorizontal ? root.height : JamiTheme.splitViewHandlePreferredWidth
color: SplitHandle.pressed ? JamiTheme.pressColor :
(SplitHandle.hovered ? JamiTheme.hoverColor :
JamiTheme.tabbarBorderColor)
......@@ -139,9 +142,11 @@ Rectangle {
Rectangle {
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.fillWidth: true
SplitView.minimumWidth: root.width / 2 + 20
SplitView.fillWidth: !mainColumnLayout.isHorizontal
MouseArea {
anchors.fill: parent
......@@ -379,8 +384,9 @@ Rectangle {
StackView {
id: inCallMessageWebViewStack
SplitView.preferredHeight: root.height / 3
SplitView.fillWidth: true
SplitView.preferredHeight: mainColumnLayout.isHorizontal ? root.height : root.height / 3
SplitView.preferredWidth: mainColumnLayout.isHorizontal ? root.width / 3 : root.width
SplitView.fillWidth: false
visible: false
......
......@@ -77,4 +77,32 @@ ColumnLayout {
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
)
}
}
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment