fix flickable direction

fix ui left panel call history/contact/meeting
This commit is contained in:
gaelle 2025-02-24 14:20:36 +01:00
parent 8c5ebd8b5e
commit c8b65fb5b2
8 changed files with 137 additions and 124 deletions

View file

@ -122,6 +122,10 @@ std::shared_ptr<linphone::Friend> ToolModel::findFriendByAddress(const QString &
return CoreModel::getInstance()->getCore()->findFriend(linphoneAddr);
}
std::shared_ptr<linphone::Friend> ToolModel::findFriendByAddress(std::shared_ptr<linphone::Address> linphoneAddr) {
return CoreModel::getInstance()->getCore()->findFriend(linphoneAddr);
}
bool ToolModel::createCall(const QString &sipAddress,
const QVariantMap &options,
const QString &prepareTransfertAddress,

View file

@ -51,6 +51,8 @@ public:
static QString getDisplayName(QString address);
static std::shared_ptr<linphone::Friend> findFriendByAddress(const QString &address);
static std::shared_ptr<linphone::Friend> findFriendByAddress(std::shared_ptr<linphone::Address> linphoneAddr);
static bool createCall(const QString &sipAddress,
const QVariantMap &options = {},

View file

@ -15,6 +15,7 @@ ListView {
property SearchBar searchBar
property bool loading: false
property string searchText: searchBar?.text
property double busyIndicatorSize: 60 * DefaultStyle.dp
signal resultsReceived()
@ -98,6 +99,7 @@ ListView {
onVisibleChanged: {
if (!visible) currentIndex = -1
}
// Qt bug: sometimes, containsMouse may not be send and update on each MouseArea.
// So we need to use this variable to switch off all hovered items.
property int lastMouseContainsIndex: -1
@ -221,6 +223,4 @@ ListView {
}
}
}
Control.ScrollBar.vertical: scrollbar
}

View file

@ -6,4 +6,5 @@ Flickable {
contentWidth: contentItem.childrenRect.width
contentHeight: contentItem.childrenRect.height
clip: true
flickableDirection: Flickable.VerticalFlick
}

View file

@ -38,7 +38,6 @@ FocusScope {
Layout.fillWidth: true
Layout.preferredHeight: callList.height
Layout.maximumHeight: mainItem.height/2
// Layout.fillHeight: true
contentHeight: callList.height
contentWidth: width
RoundedPane {

View file

@ -195,39 +195,43 @@ AbstractMainPage {
}
}
Item {
Layout.topMargin: 38 * DefaultStyle.dp
Layout.fillWidth: true
Layout.fillHeight: true
Control.Control {
id: listLayout
anchors.fill: parent
anchors.rightMargin: 39 * DefaultStyle.dp
padding: 0
background: Item{}
contentItem: ColumnLayout {
Text {
visible: historyListView.count === 0
Layout.alignment: Qt.AlignHCenter
Layout.topMargin: 137 * DefaultStyle.dp
text: qsTr("Aucun appel%1").arg(searchBar.text.length != 0 ? " correspondant" : "")
font {
pixelSize: 16 * DefaultStyle.dp
weight: 800 * DefaultStyle.dp
}
}
BusyIndicator {
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: visible ? 60 * DefaultStyle.dp : 0
Layout.preferredWidth: 60 * DefaultStyle.dp
indicatorHeight: 60 * DefaultStyle.dp
indicatorWidth: 60 * DefaultStyle.dp
visible: historyListView.loading
indicatorColor: DefaultStyle.main1_500_main
}
CallHistoryListView {
id: historyListView
Layout.fillWidth: true
Layout.fillHeight: true
Layout.topMargin: 38 * DefaultStyle.dp
searchBar: searchBar
Control.ScrollBar.vertical: scrollbar
BusyIndicator {
anchors.horizontalCenter: historyListView.horizontalCenter
visible: historyListView.loading && historyListView.count === 0 && searchBar.text.length === 0
height: visible ? historyListView.busyIndicatorSize : 0
width: historyListView.busyIndicatorSize
indicatorHeight: historyListView.busyIndicatorSize
indicatorWidth: historyListView.busyIndicatorSize
indicatorColor: DefaultStyle.main1_500_main
}
Connections{
target: mainItem
function onListViewUpdated(){
@ -245,11 +249,12 @@ AbstractMainPage {
}
ScrollBar {
id: scrollbar
visible: historyListView.contentHeight > parent.height
active: visible
anchors.top: parent.top
anchors.bottom: parent.bottom
anchors.right: parent.right
anchors.rightMargin: 8 * DefaultStyle.dp
active: true
policy: Control.ScrollBar.AsNeeded
}
}
@ -544,6 +549,8 @@ AbstractMainPage {
detailContent: RoundedPane {
id: detailControl
Layout.preferredWidth: 360 * DefaultStyle.dp
Layout.fillHeight: true
// height: Math.min(430 * DefaultStyle.dp, detailListView.contentHeight) + topPadding + bottomPadding
background: Rectangle {
id: detailListBackground
@ -552,24 +559,24 @@ AbstractMainPage {
radius: 15 * DefaultStyle.dp
}
contentItem: StackLayout {
currentIndex: detailListView.loading ? 0 : 1
height: Math.min(430 * DefaultStyle.dp, detailListView.contentHeight)
BusyIndicator {
Layout.alignment: Qt.AlignCenter
Layout.preferredHeight: visible ? 60 * DefaultStyle.dp : 0
Layout.preferredWidth: 60 * DefaultStyle.dp
indicatorHeight: 60 * DefaultStyle.dp
indicatorWidth: 60 * DefaultStyle.dp
indicatorColor: DefaultStyle.main1_500_main
}
CallHistoryListView {
contentItem: CallHistoryListView {
id: detailListView
Layout.fillWidth: true
Layout.preferredHeight: Math.min(detailControl.implicitHeight, contentHeight)
Layout.fillHeight: true
spacing: 14 * DefaultStyle.dp
clip: true
searchText: mainItem.selectedRowHistoryGui ? mainItem.selectedRowHistoryGui.core.remoteAddress : ""
busyIndicatorSize: 40 * DefaultStyle.dp
BusyIndicator {
anchors.horizontalCenter: detailListView.horizontalCenter
visible: detailListView.loading && detailListView.count === 0
height: visible ? detailListView.busyIndicatorSize : 0
width: detailListView.busyIndicatorSize
indicatorHeight: detailListView.busyIndicatorSize
indicatorWidth: detailListView.busyIndicatorSize
indicatorColor: DefaultStyle.main1_500_main
}
delegate: Item {
width:detailListView.width
@ -650,7 +657,6 @@ AbstractMainPage {
}
}
}
}
Item{
Layout.fillHeight: true
}

View file

@ -211,12 +211,13 @@ AbstractMainPage {
anchors.top: title.bottom
anchors.right: leftPanel.right
anchors.left: leftPanel.left
anchors.leftMargin: leftPanel.leftMargin
anchors.bottom: leftPanel.bottom
enabled: mainItem.leftPanelEnabled
spacing: 38 * DefaultStyle.dp
SearchBar {
id: searchBar
Layout.leftMargin: leftPanel.leftMargin
visible: contactList.haveContacts || text.length !== 0
Layout.rightMargin: leftPanel.rightMargin
Layout.topMargin: 18 * DefaultStyle.dp
Layout.fillWidth: true
@ -227,7 +228,6 @@ AbstractMainPage {
ColumnLayout {
id: content
spacing: 15 * DefaultStyle.dp
Layout.leftMargin: 45 * DefaultStyle.dp
Text {
visible: !contactList.loading && !contactList.haveContacts
Layout.alignment: Qt.AlignHCenter

View file

@ -162,6 +162,7 @@ AbstractMainPage {
placeholderText: qsTr("Rechercher une réunion")
KeyNavigation.up: conferenceList
KeyNavigation.down: conferenceList
visible: conferenceList.count !== 0 || text.length !== 0
Binding {
target: mainItem
property: "showDefaultItem"