From ae597a532683e5d544400b62497c870cf570b069 Mon Sep 17 00:00:00 2001 From: Janne Anttila Date: Fri, 31 Jul 2009 15:31:16 +0300 Subject: Restored window title after another top-level window was closed. Task: 249995 The window title in S60 is global entity, i.e. is located in application status pane. When top level window, for example mesage box is closed, the window title has to be restored for window which is getting the focus. This way we don't leave title from destroyed window to title bar. It is also into question, whether the non-maximized dialogs should set title to statuspane at all. For now they will, but things may change if we switch to use native dialogs. --- src/gui/kernel/qwidget_s60.cpp | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/gui/kernel/qwidget_s60.cpp b/src/gui/kernel/qwidget_s60.cpp index 2b3dbf4..d860eba 100644 --- a/src/gui/kernel/qwidget_s60.cpp +++ b/src/gui/kernel/qwidget_s60.cpp @@ -765,8 +765,12 @@ void QWidgetPrivate::setWindowTitle_sys(const QString &caption) if (q->isWindow()) { Q_ASSERT(q->testAttribute(Qt::WA_WState_Created)); CAknTitlePane* titlePane = S60->titlePane(); - if(titlePane) - titlePane->SetTextL(qt_QString2TPtrC(caption)); + if(titlePane) { + if(caption.isEmpty()) + titlePane->SetTextToDefaultL(); + else + titlePane->SetTextL(qt_QString2TPtrC(caption)); + } } #else Q_UNUSED(caption) @@ -1113,8 +1117,10 @@ void QWidget::destroy(bool destroyWindow, bool destroySubWindows) // the next visible window will get keyboard focus WId wid = CEikonEnv::Static()->AppUi()->TopFocusedControl(); if (wid) { - QWidget *widget = QWidget::find(wid); + QWidget *widget = QWidget::find(wid); QApplication::setActiveWindow(widget); + // Reset global window title for focusing window + widget->d_func()->setWindowTitle_sys(widget->windowTitle()); } } -- cgit v0.12