From b1ff25111a3a3abb4093e1017644e2fbed3d32e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89milie=20Feral?= Date: Thu, 1 Dec 2016 17:02:30 +0100 Subject: [PATCH] [escher] Add a method to update the title in stack view controller Change-Id: Id3a7702c108de38fed74fa0db33022f186780b13 --- escher/include/escher/stack_view_controller.h | 1 + escher/src/stack_view_controller.cpp | 6 +++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/escher/include/escher/stack_view_controller.h b/escher/include/escher/stack_view_controller.h index 5c8439075..9a899751b 100644 --- a/escher/include/escher/stack_view_controller.h +++ b/escher/include/escher/stack_view_controller.h @@ -14,6 +14,7 @@ public: /* Push creates a new StackView and adds it */ void push(ViewController * vc); + void updateTitle(); void pop(); diff --git a/escher/src/stack_view_controller.cpp b/escher/src/stack_view_controller.cpp index 11481e2c7..b4dc3497b 100644 --- a/escher/src/stack_view_controller.cpp +++ b/escher/src/stack_view_controller.cpp @@ -87,11 +87,15 @@ const char * StackViewController::title() const { } } +void StackViewController::updateTitle() { + m_view.popStack(); + m_view.pushStack(m_children[m_numberOfChildren-1]->title()); +} + void StackViewController::push(ViewController * vc) { m_view.pushStack(vc->title()); m_children[m_numberOfChildren++] = vc; setupActiveViewController(); - //vc->setParentResponder(this); } void StackViewController::pop() {