diff options
Diffstat (limited to 'src/tabwindow')
| -rw-r--r-- | src/tabwindow/tabwidget.cpp | 20 | ||||
| -rw-r--r-- | src/tabwindow/tabwidget.h | 2 | 
2 files changed, 21 insertions, 1 deletions
| diff --git a/src/tabwindow/tabwidget.cpp b/src/tabwindow/tabwidget.cpp index bdc7a47a..9494fad4 100644 --- a/src/tabwindow/tabwidget.cpp +++ b/src/tabwindow/tabwidget.cpp @@ -35,9 +35,11 @@  #include "application.h"  #include "rekonqwindow.h" +#include "tabbar.h" +  #include "webpage.h" +#include "webtab.h"  #include "webwindow.h" -#include "tabbar.h"  #include "tabhistory.h" @@ -78,6 +80,7 @@ TabWidget::TabWidget(bool withTab, bool PrivateBrowsingMode, QWidget *parent)      , _openedTabsCounter(0)      , _isPrivateBrowsing(PrivateBrowsingMode)      , _ac(new KActionCollection(this)) +    , _lastCurrentTabIndex(-1)  {      init(); @@ -98,6 +101,7 @@ TabWidget::TabWidget(WebPage *pg, QWidget *parent)      , _openedTabsCounter(0)      , _isPrivateBrowsing(false)      , _ac(new KActionCollection(this)) +    , _lastCurrentTabIndex(-1)  {      init(); @@ -394,6 +398,8 @@ void TabWidget::pageCreated(WebPage *page)  void TabWidget::currentChanged(int newIndex)  { +    _lastCurrentTabIndex = newIndex; +          _openedTabsCounter = 0;      tabBar()->setTabHighlighted(newIndex, false); @@ -403,6 +409,8 @@ void TabWidget::currentChanged(int newIndex)      if (!tab)          return; +    tab->tabView()->focusIn(); +          QString t = tab->title();      (t.isEmpty() || t == QL1S("rekonq")) @@ -410,6 +418,16 @@ void TabWidget::currentChanged(int newIndex)      : setWindowTitle(t + QL1S(" - rekonq"));      tab->checkFocus(); +     +    // ---------------------------------------------------- +     +    WebWindow *oldTab = webWindow(_lastCurrentTabIndex); +    if (!oldTab) +        return; +     +    oldTab->tabView()->focusOut(); +     +    _lastCurrentTabIndex = newIndex;  } diff --git a/src/tabwindow/tabwidget.h b/src/tabwindow/tabwidget.h index 2718904c..a6b36e33 100644 --- a/src/tabwindow/tabwidget.h +++ b/src/tabwindow/tabwidget.h @@ -144,6 +144,8 @@ private:      bool _isPrivateBrowsing;      KActionCollection *_ac; + +    int _lastCurrentTabIndex;  };  #endif // TAB_WIDGET | 
