- Add call history button.

- Fix scrolling speed and add a cache for framebuffers in list
This commit is contained in:
Julien Wadel 2021-10-30 19:19:39 +02:00
parent 5b51b82712
commit 3da5903bff
12 changed files with 200 additions and 82 deletions

View file

@ -0,0 +1,53 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<svg
width="80"
height="80"
version="1.1"
id="svg4"
sodipodi:docname="call_history_custom2.svg"
inkscape:version="1.1 (c68e22c387, 2021-05-23)"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns="http://www.w3.org/2000/svg"
xmlns:svg="http://www.w3.org/2000/svg">
<defs
id="defs8" />
<sodipodi:namedview
id="namedview6"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageshadow="2"
inkscape:pageopacity="0.0"
inkscape:pagecheckerboard="0"
showgrid="false"
inkscape:zoom="6.7098284"
inkscape:cx="2.6081144"
inkscape:cy="59.763078"
inkscape:window-width="1920"
inkscape:window-height="1131"
inkscape:window-x="0"
inkscape:window-y="0"
inkscape:window-maximized="1"
inkscape:current-layer="svg4" />
<path
d="m 20.032548,25.306346 c -2.922789,8.273156 1.173621,20.093116 7.803662,26.723927 l 0.139279,0.137194 c 6.627993,6.628763 18.450233,10.726431 26.718838,7.802159 l 6.271605,-8.22196 -8.541016,-8.539373 -7.815954,6.608287 -7.14209,-7.142763 -0.13723,-0.137195 -7.142092,-7.14276 6.607512,-7.818542 -8.53897,-8.53937 z"
stroke="#000000"
stroke-width="5.072"
fill="none"
fill-rule="evenodd"
stroke-linecap="round"
stroke-linejoin="round"
id="path2"
style="stroke-width:5.2119685;stroke-miterlimit:4;stroke-dasharray:none;paint-order:normal" />
<path
d="m 63.999928,25.141826 a 9.230749,9.2313207 0 1 1 -18.461498,0 9.2307491,9.2313205 0 0 1 18.461498,0 z m -9.232801,-4.989014 v 5.060814 H 60.0625"
stroke="#000000"
stroke-width="3.03851"
fill="none"
fill-rule="evenodd"
stroke-linecap="round"
stroke-linejoin="round"
id="path2-5"
style="stroke-width:3.17784;stroke-miterlimit:4;stroke-dasharray:none" />
</svg>

After

Width:  |  Height:  |  Size: 1.9 KiB

View file

@ -18,6 +18,7 @@
<file>assets/images/call_chat_secure_custom.svg</file>
<file>assets/images/call_chat_unsecure_custom.svg</file>
<file>assets/images/call_custom.svg</file>
<file>assets/images/call_history_custom.svg</file>
<file>assets/images/call_quality_custom.svg</file>
<file>assets/images/call_sign_connected.svg</file>
<file>assets/images/call_sign_ended.svg</file>

View file

@ -23,8 +23,8 @@ ListView {
clip: true
contentWidth: width - (vScrollBar.visible?vScrollBar.width:0)
spacing: 0
synchronousDrag:true
maximumFlickVelocity:-1
synchronousDrag: true
cacheBuffer: height
// ---------------------------------------------------------------------------
// TODO: Find a solution at this bug =>

View file

@ -20,73 +20,73 @@ Row {
Component.onCompleted: {
if ($historyEntry.status == LinphoneEnums.CallStatusSuccess) {
if(!$historyEntry.isStart){
iconData = ChatStyle.entry.event.endedCall
iconData = HistoryStyle.entry.event.endedCall
translation ='endedCall'
}else if($historyEntry.isOutgoing ){
iconData = ChatStyle.entry.event.outgoingCall
iconData = HistoryStyle.entry.event.outgoingCall
translation ='outgoingCall'
}else{
iconData = ChatStyle.entry.event.incomingCall
iconData = HistoryStyle.entry.event.incomingCall
translation ='incomingCall'
}
}else if($historyEntry.status == LinphoneEnums.CallStatusDeclined) {
if($historyEntry.isOutgoing ){
iconData = ChatStyle.entry.event.declinedOutgoingCall
iconData = HistoryStyle.entry.event.declinedOutgoingCall
translation ='declinedOutgoingCall'
}else{
iconData = ChatStyle.entry.event.declinedIncomingCall
iconData = HistoryStyle.entry.event.declinedIncomingCall
translation ='declinedIncomingCall'
}
}else if($historyEntry.status == LinphoneEnums.CallStatusMissed) {
if($historyEntry.isOutgoing ){
iconData = ChatStyle.entry.event.missedOutgoingCall
iconData = HistoryStyle.entry.event.missedOutgoingCall
translation ='missedOutgoingCall'
}else{
iconData = ChatStyle.entry.event.missedIncomingCall
iconData = HistoryStyle.entry.event.missedIncomingCall
translation ='missedIncomingCall'
}
}else if($historyEntry.status == LinphoneEnums.CallStatusAborted) {
if($historyEntry.isOutgoing ){
iconData = ChatStyle.entry.event.outgoingCall
iconData = HistoryStyle.entry.event.outgoingCall
translation ='outgoingCall'
}else{
iconData = ChatStyle.entry.event.incomingCall
iconData = HistoryStyle.entry.event.incomingCall
translation ='incomingCall'
}
}else if($historyEntry.status == LinphoneEnums.CallStatusDeclined) {
if($historyEntry.isOutgoing ){
iconData = ChatStyle.entry.event.declinedOutgoingCall
iconData = HistoryStyle.entry.event.declinedOutgoingCall
translation ='declinedOutgoingCall'
}else{
iconData = ChatStyle.entry.event.declinedIncomingCall
iconData = HistoryStyle.entry.event.declinedIncomingCall
translation ='declinedIncomingCall'
}
}else if($historyEntry.status == LinphoneEnums.CallStatusEarlyAborted) {
if($historyEntry.isOutgoing ){
iconData = ChatStyle.entry.event.missedOutgoingCall
iconData = HistoryStyle.entry.event.missedOutgoingCall
translation ='missedOutgoingCall'
}else{
iconData = ChatStyle.entry.event.missedIncomingCall
iconData = HistoryStyle.entry.event.missedIncomingCall
translation ='missedIncomingCall'
}
}else if($historyEntry.status == LinphoneEnums.CallStatusAcceptedElsewhere) {
if($historyEntry.isOutgoing ){
iconData = ChatStyle.entry.event.outgoingCall
iconData = HistoryStyle.entry.event.outgoingCall
translation ='outgoingCall'
}else{
iconData = ChatStyle.entry.event.incomingCall
iconData = HistoryStyle.entry.event.incomingCall
translation ='incomingCall'
}
}else if($historyEntry.status == LinphoneEnums.CallStatusDeclinedElsewhere) {
if($historyEntry.isOutgoing ){
iconData = ChatStyle.entry.event.declinedOutgoingCall
iconData = HistoryStyle.entry.event.declinedOutgoingCall
translation ='declinedOutgoingCall'
}else{
iconData = ChatStyle.entry.event.declinedIncomingCall
iconData = HistoryStyle.entry.event.declinedIncomingCall
translation ='declinedIncomingCall'
}
}else {
iconData = ChatStyle.entry.event.unknownCallEvent
iconData = HistoryStyle.entry.event.unknownCallEvent
translation = 'unknownCallEvent'
}
}
@ -129,7 +129,7 @@ Row {
height: parent.height
icon: mainItem.iconData ? mainItem.iconData.icon : null
overwriteColor: mainItem.iconData ? mainItem.iconData.color: null
iconSize: ChatStyle.entry.event.iconSize
iconSize: HistoryStyle.entry.event.iconSize
width: HistoryStyle.entry.metaWidth
}
@ -174,10 +174,10 @@ Row {
}
}
ActionButton {
height: HistoryStyle.entry.lineHeight
//height: HistoryStyle.entry.lineHeight
isCustom: true
backgroundRadius: 8
colorSet: ChatStyle.entry.deleteAction
colorSet: HistoryStyle.entry.deleteAction
visible: isHoverEntry()
onClicked: removeEntry()

View file

@ -129,7 +129,7 @@ Rectangle {
leftMargin: HistoryStyle.entry.leftMargin
right: parent ? parent.right : undefined
rightMargin: HistoryStyle.entry.deleteIconSize +
rightMargin: HistoryStyle.entry.deleteAction.iconSize +
HistoryStyle.entry.message.extraContent.spacing +
HistoryStyle.entry.message.extraContent.rightMargin +
HistoryStyle.entry.message.extraContent.leftMargin

View file

@ -71,7 +71,6 @@ QtObject {
property color foregroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_n', icon, '', '', '#595759').color
property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, '', '', '#595759').color
property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, '', '', '#595759').color
}
property QtObject deleteAction: QtObject {
property int iconSize: 22
@ -83,7 +82,6 @@ QtObject {
property color foregroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_n', icon, '', '', '#595759').color
property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, '', '', '#595759').color
property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, '', '', '#595759').color
}
property QtObject event: QtObject {

View file

@ -28,18 +28,62 @@ QtObject {
property QtObject entry: QtObject {
property int bottomMargin: 10
property int deleteIconSize: 22
property int leftMargin: 18
property int lineHeight: 30
property int metaWidth: 40
property QtObject deleteAction: QtObject {
property int iconSize: 30
property string name : 'delete'
property string icon : 'delete_custom'
property color backgroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_n', icon, 'l_n_b_bg').color
property color backgroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_h', icon, 'l_h_b_bg').color
property color backgroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_p', icon, 'l_p_b_bg').color
property color foregroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_n', icon, 'l_n_b_fg').color
property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, 'l_h_b_fg').color
property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, 'l_p_b_fg').color
}
property QtObject event: QtObject {
property int iconSize: 18
property int iconSize: 30
property QtObject text: QtObject {
property color color: ColorsList.add(sectionName+'_event_text', 'd').color
property int pointSize: Units.dp * 10
}
property QtObject declinedIncomingCall: QtObject{
property string icon: 'declined_incoming_call_custom'
property color color: ColorsList.addImageColor(sectionName+'_declinedIncomingCall', icon, 'event_bad').color
}
property QtObject declinedOutgoingCall: QtObject{
property string icon: 'declined_outgoing_call_custom'
property color color: ColorsList.addImageColor(sectionName+'_declinedOutgoingCall', icon, 'event_bad').color
}
property QtObject endedCall: QtObject{
property string icon: 'ended_call_custom'
property color color: ColorsList.addImageColor(sectionName+'_endedCall', icon, 'event_neutral').color
}
property QtObject incomingCall: QtObject{
property string icon: 'incoming_call_custom'
property color color: ColorsList.addImageColor(sectionName+'_incomingCall', icon, 'event_in').color
}
property QtObject outgoingCall: QtObject{
property string icon: 'outgoing_call_custom'
property color color: ColorsList.addImageColor(sectionName+'_outgoingCall', icon, 'event_out').color
}
property QtObject missedIncomingCall: QtObject{
property string icon: 'missed_incoming_call_custom'
property color color: ColorsList.addImageColor(sectionName+'_missedIncominCall', icon, 'event_bad').color
}
property QtObject missedOutgoingCall: QtObject{
property string icon: 'missed_outgoing_call_custom'
property color color: ColorsList.addImageColor(sectionName+'_missedOutgoingCall', icon, 'event_bad').color
}
property QtObject unknownCallEvent: QtObject{
property string icon: 'unknown_call_event'
property color color: ColorsList.addImageColor(sectionName+'_unknownCallEvent', icon, 'event_bad').color
}
}
property QtObject message: QtObject {

View file

@ -52,6 +52,7 @@ QtObject {
property int iconSize: 28
property int leftMargin: 17
property int rightMargin: 17
property int lastRightMargin: 5
property int spacing: 1
}
property QtObject filterField: QtObject {

View file

@ -25,6 +25,7 @@ Rectangle {
//signal entrySelected (string entry)
signal entrySelected (TimelineModel entry)
signal showHistoryRequest()
// ---------------------------------------------------------------------------
@ -99,7 +100,6 @@ Rectangle {
}
MouseArea{
Layout.alignment: Qt.AlignRight
Layout.rightMargin: TimelineStyle.legend.rightMargin
Layout.fillHeight: true
Layout.preferredWidth: TimelineStyle.legend.iconSize
onClicked:{
@ -116,6 +116,24 @@ Rectangle {
overwriteColor: TimelineStyle.legend.color
}
}
MouseArea{
Layout.alignment: Qt.AlignRight
Layout.rightMargin: TimelineStyle.legend.lastRightMargin
Layout.fillHeight: true
Layout.preferredWidth: TimelineStyle.legend.iconSize
onClicked:{
showHistoryRequest()
}
Icon {
id:callHistoryButton
anchors.verticalCenter: parent.verticalCenter
anchors.horizontalCenter: parent.horizontalCenter
property bool searching: searchView.visible
icon: 'call_history_custom'
iconSize: TimelineStyle.legend.iconSize
overwriteColor: TimelineStyle.legend.color
}
}
}
}
// -------------------------------------------------------------------------

View file

@ -83,7 +83,7 @@ ColumnLayout {
ActionButton {
isCustom: true
backgroundRadius: 90
colorSet: ContactsStyle.videoCall
colorSet: HistoryViewStyle.videoCall
visible: peerAddress && SettingsModel.videoSupported && SettingsModel.outgoingCallsEnabled && SettingsModel.showStartVideoCallButton
onClicked: CallsListModel.launchVideoCall(historyView.peerAddress)
@ -92,7 +92,7 @@ ColumnLayout {
ActionButton {
isCustom: true
backgroundRadius: 90
colorSet: ContactsStyle.call
colorSet: HistoryViewStyle.call
visible: peerAddress && SettingsModel.outgoingCallsEnabled
onClicked: CallsListModel.launchAudioCall(historyView.peerAddress)
@ -116,7 +116,7 @@ ColumnLayout {
ActionButton {
isCustom: true
backgroundRadius: 90
colorSet: ContactsStyle.deleteAction
colorSet: HistoryViewStyle.deleteAction
onClicked: Logic.removeAllEntries()

View file

@ -331,6 +331,9 @@ ApplicationWindow {
}
menu.resetSelectedEntry()
}
onShowHistoryRequest: {
window.setView('HistoryView')
}
}
}

View file

@ -6,48 +6,48 @@ import ColorsList 1.0
QtObject {
property string sectionName: 'HistoryView'
property QtObject bar: QtObject {
property color backgroundColor: ColorsList.add(sectionName+'_bar_bg', 'e').color
property int avatarSize: 60
property int height: 80
property int leftMargin: 40
property int rightMargin: 30
property int spacing: 20
property QtObject actions: QtObject {
property int spacing: 40
property QtObject call: QtObject {
property int iconSize: 40
}
property QtObject del: QtObject {
property int iconSize: 22
}
property QtObject edit: QtObject {
property int iconSize: 22
}
}
property QtObject description: QtObject {
property color sipAddressColor: ColorsList.add(sectionName+'_bar_description_sipAddress', 'g').color
property color usernameColor: ColorsList.add(sectionName+'_bar_description_username', 'j').color
}
}
property QtObject filters: QtObject {
property color backgroundColor: ColorsList.add(sectionName+'_filters_bg', 'q').color
property int height: 51
property int leftMargin: 40
property QtObject border: QtObject {
property color color: ColorsList.add(sectionName+'_filters_border', 'g10').color
property int bottomWidth: 1
property int topWidth: 0
}
}
property QtObject videoCall: QtObject {
property QtObject bar: QtObject {
property color backgroundColor: ColorsList.add(sectionName+'_bar_bg', 'e').color
property int avatarSize: 60
property int height: 80
property int leftMargin: 40
property int rightMargin: 30
property int spacing: 20
property QtObject actions: QtObject {
property int spacing: 40
property QtObject call: QtObject {
property int iconSize: 40
}
property QtObject del: QtObject {
property int iconSize: 40
}
property QtObject edit: QtObject {
property int iconSize: 40
}
}
property QtObject description: QtObject {
property color sipAddressColor: ColorsList.add(sectionName+'_bar_description_sipAddress', 'g').color
property color usernameColor: ColorsList.add(sectionName+'_bar_description_username', 'j').color
}
}
property QtObject filters: QtObject {
property color backgroundColor: ColorsList.add(sectionName+'_filters_bg', 'q').color
property int height: 51
property int leftMargin: 40
property QtObject border: QtObject {
property color color: ColorsList.add(sectionName+'_filters_border', 'g10').color
property int bottomWidth: 1
property int topWidth: 0
}
}
property QtObject videoCall: QtObject {
property int iconSize: 40
property string name : 'videoCall'
property string icon : 'video_call_custom'
@ -69,15 +69,15 @@ QtObject {
property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, 's_h_b_fg').color
property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, 's_p_b_fg').color
}
property QtObject deleteAction: QtObject {
property int iconSize: 22
property QtObject deleteAction: QtObject {
property int iconSize: 40
property string name : 'delete'
property string icon : 'delete_custom'
property color backgroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_n', icon, 'me_n_b_bg').color
property color backgroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_h', icon, 'me_h_b_bg').color
property color backgroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_p', icon, 'me_p_b_bg').color
property color foregroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_n', icon, 'me_n_b_fg').color
property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, 'me_h_b_fg').color
property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, 'me_p_b_fg').color
property color backgroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_n', icon, 'l_n_b_bg').color
property color backgroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_h', icon, 'l_h_b_bg').color
property color backgroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_bg_p', icon, 'l_p_b_bg').color
property color foregroundNormalColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_n', icon, 'l_n_b_fg').color
property color foregroundHoveredColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_h', icon, 'l_h_b_fg').color
property color foregroundPressedColor : ColorsList.addImageColor(sectionName+'_'+name+'_fg_p', icon, 'l_p_b_fg').color
}
}