mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-01-17 11:28:07 +00:00
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)
|
||||
// if conference, the main item is only
|
||||
// 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
|
||||
|
||||
function joinConference(withVideo) {
|
||||
|
|
@ -702,7 +702,6 @@ Window {
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
Component {
|
||||
id: waitingRoom
|
||||
|
|
@ -732,10 +731,6 @@ Window {
|
|||
onJoinConfRequested: mainWindow.joinConference(cameraEnabled)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Component {
|
||||
id: inCallItem
|
||||
Item {
|
||||
|
|
@ -761,20 +756,17 @@ Window {
|
|||
Component.onCompleted: console.log("New inCallItem " + inCallItem)
|
||||
}
|
||||
}
|
||||
GridLayout {
|
||||
RowLayout {
|
||||
id: bottomButtonsLayout
|
||||
rows: 1
|
||||
columns: 3
|
||||
Layout.alignment: Qt.AlignHCenter
|
||||
layoutDirection: Qt.LeftToRight
|
||||
columnSpacing: 20 * DefaultStyle.dp
|
||||
spacing: 20 * DefaultStyle.dp
|
||||
visible: mainWindow.call && !mainWindow.conferenceInfo
|
||||
|
||||
function refreshLayout() {
|
||||
if (mainWindow.callState === LinphoneEnums.CallState.Connected || mainWindow.callState === LinphoneEnums.CallState.StreamsRunning) {
|
||||
bottomButtonsLayout.layoutDirection = Qt.RightToLeft
|
||||
connectedCallButtons.visible = bottomButtonsLayout.visible
|
||||
moreOptionsButton.visible = bottomButtonsLayout.visible
|
||||
bottomButtonsLayout.layoutDirection = Qt.RightToLeft
|
||||
}
|
||||
else if (mainWindow.callState === LinphoneEnums.CallState.OutgoingInit) {
|
||||
connectedCallButtons.visible = false
|
||||
|
|
@ -952,7 +944,7 @@ Window {
|
|||
target: moreOptionsButton.popup
|
||||
onOpened: {
|
||||
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 {
|
||||
|
|
|
|||
|
|
@ -9,7 +9,6 @@ ColumnLayout {
|
|||
property CallGui call
|
||||
onCallChanged: {
|
||||
if (call) {
|
||||
console.log("============================== volume ", speakerVolume.value, microVolume.value)
|
||||
call.core.lSetOutputAudioDevice(outputAudioDeviceCBox.currentText)
|
||||
call.core.lSetSpeakerVolumeGain(speakerVolume.value)
|
||||
call.core.lSetInputAudioDevice(inputAudioDeviceCBox.currentText)
|
||||
|
|
|
|||
|
|
@ -75,7 +75,7 @@ RowLayout {
|
|||
iconUrl: AppIcons.speaker
|
||||
checkedIconUrl: AppIcons.speakerSlash
|
||||
color: DefaultStyle.grey_500
|
||||
contentImageColor: checked ? DefaultStyle.grey_500 : DefaultStyle.grey_0
|
||||
contentImageColor: DefaultStyle.main2_0
|
||||
Layout.preferredWidth: 55 * DefaultStyle.dp
|
||||
Layout.preferredHeight: 55 * DefaultStyle.dp
|
||||
icon.width: 32 * DefaultStyle.dp
|
||||
|
|
|
|||
|
|
@ -41,20 +41,25 @@ Button {
|
|||
}
|
||||
Control.Popup {
|
||||
id: popup
|
||||
x: - width
|
||||
x: 0
|
||||
y: mainItem.height
|
||||
closePolicy: Popup.CloseOnPressOutsideParent | Popup.CloseOnPressOutside
|
||||
padding: 10 * DefaultStyle.dp
|
||||
parent: mainItem // Explicit define for coordinates references.
|
||||
|
||||
onAboutToShow: {
|
||||
onVisibleChanged: {
|
||||
if (!visible) return
|
||||
// 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) {
|
||||
position = mainItem.Window.contentItem.mapToItem(mainItem, 0,0)
|
||||
y = position.y
|
||||
y = -mainItem.height - popup.implicitContentHeight
|
||||
}else {
|
||||
y = mainItem.height
|
||||
y = mainItem.height + popup.padding
|
||||
}
|
||||
if (position.x >= mainItem.Window.width) {
|
||||
x = -popup.implicitContentWidth
|
||||
} else {
|
||||
x = 0
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue