mirror of
https://gitlab.linphone.org/BC/public/linphone-desktop.git
synced 2026-05-07 05:23:06 +00:00
Fix refresh contacts panel when clicking on tab
This commit is contained in:
parent
cade8647fb
commit
bee72586ab
2 changed files with 106 additions and 93 deletions
|
|
@ -7,97 +7,107 @@ import Common.Styles 1.0
|
|||
// =============================================================================
|
||||
|
||||
Rectangle {
|
||||
id: entry
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
property string icon
|
||||
property alias name: text.text
|
||||
|
||||
readonly property bool isSelected: parent.parent._selected === this
|
||||
property alias iconSize : mainIcon.iconSize
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
signal selected
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function select () {
|
||||
var menu = parent.parent
|
||||
if (menu._selected !== this) {
|
||||
menu._selected = this
|
||||
selected()
|
||||
}
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
color: mouseArea.pressed
|
||||
? ApplicationMenuStyle.entry.color.pressed
|
||||
: (isSelected
|
||||
? ApplicationMenuStyle.entry.color.selected
|
||||
: (mouseArea.containsMouse
|
||||
? ApplicationMenuStyle.entry.color.hovered
|
||||
: ApplicationMenuStyle.entry.color.normal
|
||||
)
|
||||
)
|
||||
height: parent.parent.entryHeight
|
||||
width: parent.parent.entryWidth
|
||||
|
||||
RowLayout {
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: ApplicationMenuStyle.entry.leftMargin
|
||||
right: parent.right
|
||||
rightMargin: ApplicationMenuStyle.entry.rightMargin
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
spacing: ApplicationMenuStyle.entry.spacing
|
||||
|
||||
Icon {
|
||||
id:mainIcon
|
||||
icon: entry.icon + (
|
||||
entry.isSelected
|
||||
? '_selected'
|
||||
: '_normal'
|
||||
)
|
||||
iconSize: ApplicationMenuStyle.entry.iconSize
|
||||
}
|
||||
|
||||
Text {
|
||||
id: text
|
||||
|
||||
Layout.fillWidth: true
|
||||
color: entry.isSelected
|
||||
? ApplicationMenuStyle.entry.text.color.selected
|
||||
: ApplicationMenuStyle.entry.text.color.normal
|
||||
font.pointSize: ApplicationMenuStyle.entry.text.pointSize
|
||||
font.weight: Font.DemiBold
|
||||
height: parent.height
|
||||
text: entry.name
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors {
|
||||
left: parent.left
|
||||
}
|
||||
|
||||
height: parent.height
|
||||
color: entry.isSelected
|
||||
? ApplicationMenuStyle.entry.indicator.color
|
||||
: 'transparent'
|
||||
width: ApplicationMenuStyle.entry.indicator.width
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
onClicked: entry.select()
|
||||
}
|
||||
id: entry
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
property string icon
|
||||
property alias name: text.text
|
||||
|
||||
readonly property bool isSelected: parent.parent._selected === this
|
||||
property alias iconSize : mainIcon.iconSize
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
signal selected
|
||||
signal clicked
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
function select () {
|
||||
var menu = parent.parent
|
||||
if (menu._selected !== this) {
|
||||
menu._selected = this
|
||||
selected()
|
||||
}
|
||||
}
|
||||
|
||||
function mouseClicked(){
|
||||
var menu = parent.parent
|
||||
if (menu._selected !== this) {
|
||||
menu._selected = this
|
||||
selected()
|
||||
}else
|
||||
clicked()
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
color: mouseArea.pressed
|
||||
? ApplicationMenuStyle.entry.color.pressed
|
||||
: (isSelected
|
||||
? ApplicationMenuStyle.entry.color.selected
|
||||
: (mouseArea.containsMouse
|
||||
? ApplicationMenuStyle.entry.color.hovered
|
||||
: ApplicationMenuStyle.entry.color.normal
|
||||
)
|
||||
)
|
||||
height: parent.parent.entryHeight
|
||||
width: parent.parent.entryWidth
|
||||
|
||||
RowLayout {
|
||||
anchors {
|
||||
left: parent.left
|
||||
leftMargin: ApplicationMenuStyle.entry.leftMargin
|
||||
right: parent.right
|
||||
rightMargin: ApplicationMenuStyle.entry.rightMargin
|
||||
verticalCenter: parent.verticalCenter
|
||||
}
|
||||
|
||||
spacing: ApplicationMenuStyle.entry.spacing
|
||||
|
||||
Icon {
|
||||
id:mainIcon
|
||||
icon: entry.icon + (
|
||||
entry.isSelected
|
||||
? '_selected'
|
||||
: '_normal'
|
||||
)
|
||||
iconSize: ApplicationMenuStyle.entry.iconSize
|
||||
}
|
||||
|
||||
Text {
|
||||
id: text
|
||||
|
||||
Layout.fillWidth: true
|
||||
color: entry.isSelected
|
||||
? ApplicationMenuStyle.entry.text.color.selected
|
||||
: ApplicationMenuStyle.entry.text.color.normal
|
||||
font.pointSize: ApplicationMenuStyle.entry.text.pointSize
|
||||
font.weight: Font.DemiBold
|
||||
height: parent.height
|
||||
text: entry.name
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors {
|
||||
left: parent.left
|
||||
}
|
||||
|
||||
height: parent.height
|
||||
color: entry.isSelected
|
||||
? ApplicationMenuStyle.entry.indicator.color
|
||||
: 'transparent'
|
||||
width: ApplicationMenuStyle.entry.indicator.width
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
id: mouseArea
|
||||
|
||||
anchors.fill: parent
|
||||
|
||||
onClicked: entry.mouseClicked()
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -267,6 +267,9 @@ ApplicationWindow {
|
|||
timeline.model.unselectAll()
|
||||
setView('Contacts')
|
||||
}
|
||||
onClicked:{
|
||||
setView('Contacts')
|
||||
}
|
||||
Icon{
|
||||
anchors.right:parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue