mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-06 20:23:08 +00:00
fix(Timeline.qml): do not anchors rectangle in ColumnLayout (Qt5.11)
This commit is contained in:
parent
ea6c5da00d
commit
c840bbab8c
1 changed files with 83 additions and 85 deletions
|
|
@ -9,7 +9,7 @@ import 'Timeline.js' as Logic
|
|||
|
||||
// =============================================================================
|
||||
|
||||
ColumnLayout {
|
||||
Rectangle {
|
||||
id: timeline
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
|
@ -35,110 +35,108 @@ ColumnLayout {
|
|||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
spacing: 0
|
||||
color: TimelineStyle.color
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Connections {
|
||||
target: model
|
||||
|
||||
onDataChanged: Logic.handleDataChanged(topLeft, bottomRight, roles)
|
||||
onRowsAboutToBeRemoved: Logic.handleRowsAboutToBeRemoved (parent, first, last)
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Rectangle {
|
||||
ColumnLayout {
|
||||
anchors.fill: parent
|
||||
color: TimelineStyle.color
|
||||
}
|
||||
spacing: 0
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// Legend.
|
||||
// ---------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: TimelineStyle.legend.height
|
||||
color: TimelineStyle.legend.backgroundColor
|
||||
Connections {
|
||||
target: model
|
||||
|
||||
Row {
|
||||
anchors {
|
||||
fill: parent
|
||||
leftMargin: TimelineStyle.legend.leftMargin
|
||||
rightMargin: TimelineStyle.legend.rightMargin
|
||||
}
|
||||
spacing: TimelineStyle.legend.spacing
|
||||
onDataChanged: Logic.handleDataChanged(topLeft, bottomRight, roles)
|
||||
onRowsAboutToBeRemoved: Logic.handleRowsAboutToBeRemoved(parent, first, last)
|
||||
}
|
||||
|
||||
Icon {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
icon: 'history'
|
||||
iconSize: TimelineStyle.legend.iconSize
|
||||
}
|
||||
// -------------------------------------------------------------------------
|
||||
// Legend.
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
Text {
|
||||
color: TimelineStyle.legend.color
|
||||
font.pointSize: TimelineStyle.legend.pointSize
|
||||
height: parent.height
|
||||
text: qsTr('timelineTitle')
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
Rectangle {
|
||||
Layout.fillWidth: true
|
||||
Layout.preferredHeight: TimelineStyle.legend.height
|
||||
color: TimelineStyle.legend.backgroundColor
|
||||
|
||||
Row {
|
||||
anchors {
|
||||
fill: parent
|
||||
leftMargin: TimelineStyle.legend.leftMargin
|
||||
rightMargin: TimelineStyle.legend.rightMargin
|
||||
}
|
||||
spacing: TimelineStyle.legend.spacing
|
||||
|
||||
Icon {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
icon: 'history'
|
||||
iconSize: TimelineStyle.legend.iconSize
|
||||
}
|
||||
|
||||
Text {
|
||||
color: TimelineStyle.legend.color
|
||||
font.pointSize: TimelineStyle.legend.pointSize
|
||||
height: parent.height
|
||||
text: qsTr('timelineTitle')
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// History.
|
||||
// ---------------------------------------------------------------------------
|
||||
// -------------------------------------------------------------------------
|
||||
// History.
|
||||
// -------------------------------------------------------------------------
|
||||
|
||||
ScrollableListView {
|
||||
id: view
|
||||
ScrollableListView {
|
||||
id: view
|
||||
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
currentIndex: -1
|
||||
Layout.fillHeight: true
|
||||
Layout.fillWidth: true
|
||||
currentIndex: -1
|
||||
|
||||
delegate: Item {
|
||||
height: TimelineStyle.contact.height
|
||||
width: parent ? parent.width : 0
|
||||
delegate: Item {
|
||||
height: TimelineStyle.contact.height
|
||||
width: parent ? parent.width : 0
|
||||
|
||||
Contact {
|
||||
anchors.fill: parent
|
||||
color: view.currentIndex === index
|
||||
? TimelineStyle.contact.backgroundColor.selected
|
||||
: (
|
||||
index % 2 == 0
|
||||
? TimelineStyle.contact.backgroundColor.a
|
||||
: TimelineStyle.contact.backgroundColor.b
|
||||
)
|
||||
displayUnreadMessagesCount: SettingsModel.chatEnabled && view.currentIndex !== index
|
||||
entry: $timelineEntry
|
||||
sipAddressColor: view.currentIndex === index
|
||||
? TimelineStyle.contact.sipAddress.color.selected
|
||||
: TimelineStyle.contact.sipAddress.color.normal
|
||||
usernameColor: view.currentIndex === index
|
||||
? TimelineStyle.contact.username.color.selected
|
||||
: TimelineStyle.contact.username.color.normal
|
||||
|
||||
Loader {
|
||||
Contact {
|
||||
anchors.fill: parent
|
||||
sourceComponent: TooltipArea {
|
||||
text: $timelineEntry.timestamp.toLocaleString(
|
||||
Qt.locale(App.locale),
|
||||
Locale.ShortFormat
|
||||
color: view.currentIndex === index
|
||||
? TimelineStyle.contact.backgroundColor.selected
|
||||
: (
|
||||
index % 2 == 0
|
||||
? TimelineStyle.contact.backgroundColor.a
|
||||
: TimelineStyle.contact.backgroundColor.b
|
||||
)
|
||||
displayUnreadMessagesCount: SettingsModel.chatEnabled && view.currentIndex !== index
|
||||
entry: $timelineEntry
|
||||
sipAddressColor: view.currentIndex === index
|
||||
? TimelineStyle.contact.sipAddress.color.selected
|
||||
: TimelineStyle.contact.sipAddress.color.normal
|
||||
usernameColor: view.currentIndex === index
|
||||
? TimelineStyle.contact.username.color.selected
|
||||
: TimelineStyle.contact.username.color.normal
|
||||
|
||||
Loader {
|
||||
anchors.fill: parent
|
||||
sourceComponent: TooltipArea {
|
||||
text: $timelineEntry.timestamp.toLocaleString(
|
||||
Qt.locale(App.locale),
|
||||
Locale.ShortFormat
|
||||
)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
view.currentIndex = index
|
||||
timeline.entrySelected($timelineEntry.sipAddress)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
anchors.fill: parent
|
||||
onClicked: {
|
||||
view.currentIndex = index
|
||||
timeline.entrySelected($timelineEntry.sipAddress)
|
||||
}
|
||||
}
|
||||
onCountChanged: Logic.handleCountChanged(count)
|
||||
}
|
||||
|
||||
onCountChanged: Logic.handleCountChanged(count)
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue