mirror of
https://github.com/RetroShare/RetroShare.git
synced 2024-12-29 09:26:18 -05:00
Change toolbar label on chat view opened with the name of remote
This commit is contained in:
parent
69ed518555
commit
4a90436e8e
@ -94,6 +94,11 @@ Item {
|
||||
|
||||
}
|
||||
|
||||
Component.onCompleted: {
|
||||
toolBar.state = "CHATVIEW"
|
||||
toolBar.titleText = model.author_name
|
||||
}
|
||||
|
||||
function getMessageTime(){
|
||||
|
||||
var timeFormat = "hh:mm";
|
||||
|
@ -27,6 +27,8 @@ Item
|
||||
property string chatId
|
||||
property int token: 0
|
||||
|
||||
property string objectName:"chatView"
|
||||
|
||||
|
||||
function refreshData()
|
||||
{
|
||||
|
@ -57,6 +57,18 @@ ApplicationWindow
|
||||
header: ToolBar
|
||||
{
|
||||
id: toolBar
|
||||
property alias titleText: toolBarText.text
|
||||
property string defaultLabel: "RetroShare"
|
||||
|
||||
states: [
|
||||
State {
|
||||
name: "DEFAULT"
|
||||
PropertyChanges { target: toolBar; titleText: defaultLabel}
|
||||
},
|
||||
State {
|
||||
name: "CHATVIEW"
|
||||
}
|
||||
]
|
||||
|
||||
Image
|
||||
{
|
||||
@ -68,7 +80,8 @@ ApplicationWindow
|
||||
}
|
||||
Label
|
||||
{
|
||||
text: "RetroShare"
|
||||
id: toolBarText
|
||||
text: defaultLabel
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: rsIcon.right
|
||||
anchors.leftMargin: 20
|
||||
@ -135,7 +148,15 @@ ApplicationWindow
|
||||
id: stackView
|
||||
anchors.fill: parent
|
||||
focus: true
|
||||
onCurrentItemChanged: if (currentItem) currentItem.focus = true
|
||||
onCurrentItemChanged: {
|
||||
if (currentItem) {
|
||||
if (currentItem.objectName != "chatView" && toolBar.state != "DEFAULT"){
|
||||
toolBar.state = "DEFAULT"
|
||||
}
|
||||
currentItem.focus = true
|
||||
}
|
||||
}
|
||||
|
||||
Keys.onReleased:
|
||||
if (event.key === Qt.Key_Back && stackView.depth > 1)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user