mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-16 18:07:11 -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(){
|
function getMessageTime(){
|
||||||
|
|
||||||
var timeFormat = "hh:mm";
|
var timeFormat = "hh:mm";
|
||||||
|
@ -27,6 +27,8 @@ Item
|
|||||||
property string chatId
|
property string chatId
|
||||||
property int token: 0
|
property int token: 0
|
||||||
|
|
||||||
|
property string objectName:"chatView"
|
||||||
|
|
||||||
|
|
||||||
function refreshData()
|
function refreshData()
|
||||||
{
|
{
|
||||||
|
@ -57,6 +57,18 @@ ApplicationWindow
|
|||||||
header: ToolBar
|
header: ToolBar
|
||||||
{
|
{
|
||||||
id: 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
|
Image
|
||||||
{
|
{
|
||||||
@ -68,7 +80,8 @@ ApplicationWindow
|
|||||||
}
|
}
|
||||||
Label
|
Label
|
||||||
{
|
{
|
||||||
text: "RetroShare"
|
id: toolBarText
|
||||||
|
text: defaultLabel
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
anchors.left: rsIcon.right
|
anchors.left: rsIcon.right
|
||||||
anchors.leftMargin: 20
|
anchors.leftMargin: 20
|
||||||
@ -135,7 +148,15 @@ ApplicationWindow
|
|||||||
id: stackView
|
id: stackView
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
focus: true
|
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:
|
Keys.onReleased:
|
||||||
if (event.key === Qt.Key_Back && stackView.depth > 1)
|
if (event.key === Qt.Key_Back && stackView.depth > 1)
|
||||||
{
|
{
|
||||||
|
Loading…
Reference in New Issue
Block a user