fix popup position popup button + bottom buttons position calls window
This commit is contained in:
parent
579cf7e773
commit
2f6a4828cb
4 changed files with 18 additions and 22 deletions
|
|
@ -26,9 +26,9 @@ Window {
|
||||||
console.log("CALL", call)
|
console.log("CALL", call)
|
||||||
// if conference, the main item is only
|
// if conference, the main item is only
|
||||||
// displayed when state is connected
|
// displayed when state is connected
|
||||||
//if (call && middleItemStackView.currentItem != inCallItem) middleItemStackView.replace(inCallItem)
|
if (!conferenceInfo)
|
||||||
|
if (call && middleItemStackView.currentItem != inCallItem) middleItemStackView.replace(inCallItem)
|
||||||
}
|
}
|
||||||
//Component.onCompleted: if (call && !conferenceInfo && middleItemStackView.currentItem != inCallItem) middleItemStackView.replace(inCallItem)
|
|
||||||
property var callObj
|
property var callObj
|
||||||
|
|
||||||
function joinConference(withVideo) {
|
function joinConference(withVideo) {
|
||||||
|
|
@ -702,7 +702,6 @@ Window {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
Component {
|
Component {
|
||||||
id: waitingRoom
|
id: waitingRoom
|
||||||
|
|
@ -732,10 +731,6 @@ Window {
|
||||||
onJoinConfRequested: mainWindow.joinConference(cameraEnabled)
|
onJoinConfRequested: mainWindow.joinConference(cameraEnabled)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
id: inCallItem
|
id: inCallItem
|
||||||
Item {
|
Item {
|
||||||
|
|
@ -761,20 +756,17 @@ Window {
|
||||||
Component.onCompleted: console.log("New inCallItem " + inCallItem)
|
Component.onCompleted: console.log("New inCallItem " + inCallItem)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
GridLayout {
|
RowLayout {
|
||||||
id: bottomButtonsLayout
|
id: bottomButtonsLayout
|
||||||
rows: 1
|
|
||||||
columns: 3
|
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
layoutDirection: Qt.LeftToRight
|
spacing: 20 * DefaultStyle.dp
|
||||||
columnSpacing: 20 * DefaultStyle.dp
|
|
||||||
visible: mainWindow.call && !mainWindow.conferenceInfo
|
visible: mainWindow.call && !mainWindow.conferenceInfo
|
||||||
|
|
||||||
function refreshLayout() {
|
function refreshLayout() {
|
||||||
if (mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning) {
|
if (mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning) {
|
||||||
bottomButtonsLayout.layoutDirection = Qt.RightToLeft
|
|
||||||
connectedCallButtons.visible = bottomButtonsLayout.visible
|
connectedCallButtons.visible = bottomButtonsLayout.visible
|
||||||
moreOptionsButton.visible = bottomButtonsLayout.visible
|
moreOptionsButton.visible = bottomButtonsLayout.visible
|
||||||
|
bottomButtonsLayout.layoutDirection = Qt.RightToLeft
|
||||||
}
|
}
|
||||||
else if (mainWindow.callState === LinphoneEnums.CallState.OutgoingInit) {
|
else if (mainWindow.callState === LinphoneEnums.CallState.OutgoingInit) {
|
||||||
connectedCallButtons.visible = false
|
connectedCallButtons.visible = false
|
||||||
|
|
@ -952,7 +944,7 @@ Window {
|
||||||
target: moreOptionsButton.popup
|
target: moreOptionsButton.popup
|
||||||
onOpened: {
|
onOpened: {
|
||||||
console.log("y", moreOptionsButton.y, moreOptionsButton.popup.y, moreOptionsButton.popup.height)
|
console.log("y", moreOptionsButton.y, moreOptionsButton.popup.y, moreOptionsButton.popup.height)
|
||||||
moreOptionsButton.popup.y = - moreOptionsButton.popup.height + moreOptionsButton.height/4
|
moreOptionsButton.popup.y = - moreOptionsButton.popup.height - moreOptionsButton.popup.padding
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
component MenuButton: Button {
|
component MenuButton: Button {
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,6 @@ ColumnLayout {
|
||||||
property CallGui call
|
property CallGui call
|
||||||
onCallChanged: {
|
onCallChanged: {
|
||||||
if (call) {
|
if (call) {
|
||||||
console.log("============================== volume ", speakerVolume.value, microVolume.value)
|
|
||||||
call.core.lSetOutputAudioDevice(outputAudioDeviceCBox.currentText)
|
call.core.lSetOutputAudioDevice(outputAudioDeviceCBox.currentText)
|
||||||
call.core.lSetSpeakerVolumeGain(speakerVolume.value)
|
call.core.lSetSpeakerVolumeGain(speakerVolume.value)
|
||||||
call.core.lSetInputAudioDevice(inputAudioDeviceCBox.currentText)
|
call.core.lSetInputAudioDevice(inputAudioDeviceCBox.currentText)
|
||||||
|
|
|
||||||
|
|
@ -75,7 +75,7 @@ RowLayout {
|
||||||
iconUrl: AppIcons.speaker
|
iconUrl: AppIcons.speaker
|
||||||
checkedIconUrl: AppIcons.speakerSlash
|
checkedIconUrl: AppIcons.speakerSlash
|
||||||
color: DefaultStyle.grey_500
|
color: DefaultStyle.grey_500
|
||||||
contentImageColor: checked ? DefaultStyle.grey_500 : DefaultStyle.grey_0
|
contentImageColor: DefaultStyle.main2_0
|
||||||
Layout.preferredWidth: 55 * DefaultStyle.dp
|
Layout.preferredWidth: 55 * DefaultStyle.dp
|
||||||
Layout.preferredHeight: 55 * DefaultStyle.dp
|
Layout.preferredHeight: 55 * DefaultStyle.dp
|
||||||
icon.width: 32 * DefaultStyle.dp
|
icon.width: 32 * DefaultStyle.dp
|
||||||
|
|
|
||||||
|
|
@ -41,20 +41,25 @@ Button {
|
||||||
}
|
}
|
||||||
Control.Popup {
|
Control.Popup {
|
||||||
id: popup
|
id: popup
|
||||||
x: - width
|
x: 0
|
||||||
y: mainItem.height
|
y: mainItem.height
|
||||||
closePolicy: Popup.CloseOnPressOutsideParent | Popup.CloseOnPressOutside
|
closePolicy: Popup.CloseOnPressOutsideParent | Popup.CloseOnPressOutside
|
||||||
padding: 10 * DefaultStyle.dp
|
padding: 10 * DefaultStyle.dp
|
||||||
parent: mainItem // Explicit define for coordinates references.
|
parent: mainItem // Explicit define for coordinates references.
|
||||||
|
|
||||||
onAboutToShow: {
|
onVisibleChanged: {
|
||||||
|
if (!visible) return
|
||||||
// Do not use popup.height as it is not consistent.
|
// Do not use popup.height as it is not consistent.
|
||||||
var position = mainItem.mapToItem(mainItem.Window.contentItem, mainItem.x, mainItem.y + mainItem.height + popup.implicitContentHeight + popup.padding)
|
var position = mainItem.mapToItem(mainItem.Window.contentItem, mainItem.x + popup.implicitContentWidth + popup.padding, mainItem.y + mainItem.height + popup.implicitContentHeight + popup.padding)
|
||||||
if (position.y >= mainItem.Window.height) {
|
if (position.y >= mainItem.Window.height) {
|
||||||
position = mainItem.Window.contentItem.mapToItem(mainItem, 0,0)
|
y = -mainItem.height - popup.implicitContentHeight
|
||||||
y = position.y
|
|
||||||
}else {
|
}else {
|
||||||
y = mainItem.height
|
y = mainItem.height + popup.padding
|
||||||
|
}
|
||||||
|
if (position.x >= mainItem.Window.width) {
|
||||||
|
x = -popup.implicitContentWidth
|
||||||
|
} else {
|
||||||
|
x = 0
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue