From adf9bcf5d1c2efdb57ebf01f06dc4457122c512c Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 4 Apr 2005 17:57:40 +0000 Subject: [PATCH] Fix for bug #1166231 (GUI: Caret not removed when switching tabs) svn-id: r17379 --- gui/TabWidget.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/gui/TabWidget.cpp b/gui/TabWidget.cpp index 0e0f654e2b0..a082ef72956 100644 --- a/gui/TabWidget.cpp +++ b/gui/TabWidget.cpp @@ -60,7 +60,7 @@ int TabWidget::addTab(const String &title) { // Add a new tab page Tab newTab; newTab.title = title; - newTab.firstWidget = NULL; + newTab.firstWidget = 0; _tabs.push_back(newTab); @@ -84,8 +84,10 @@ void TabWidget::setActiveTab(int tabID) { assert(0 <= tabID && tabID < (int)_tabs.size()); if (_activeTab != tabID) { // Exchange the widget lists, and switch to the new tab - if (_activeTab != -1) + if (_activeTab != -1) { _tabs[_activeTab].firstWidget = _firstWidget; + releaseFocus(); + } _activeTab = tabID; _firstWidget = _tabs[tabID].firstWidget; _boss->draw();