Changeset 4584

Show
Ignore:
Timestamp:
08/24/06 22:34:12 (2 years ago)
Author:
emostar
Message:

Use tab positions and ids. when a tab got closed, the id is lost which caused bug #1366
Thanks to Eric for pointing this out.
--This line, and those below, will be ignored--
M ewidgets.cpp

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • trunk/qt-gui/src/ewidgets.cpp

    r4583 r4584  
    490490void CETabBar::setPreviousTab() 
    491491{ 
    492   int tab = currentTab() - 1; 
     492  if (currentTab() == -1) 
     493    return; // No current tab 
     494 
     495  int tab = indexOf(currentTab()) - 1; 
    493496  if (tab < 0) 
    494497    tab = count() - 1; 
    495498 
    496   setCurrentTab(tab); 
     499  setCurrentTab(tabAt(tab)); 
    497500} 
    498501 
    499502void CETabBar::setNextTab() 
    500503{ 
    501   int tab = currentTab() + 1; 
     504  if (currentTab() == -1) 
     505    return; // No current tab 
     506 
     507  int tab = indexOf(currentTab()) + 1; 
    502508  if (tab >= count()) 
    503509    tab = 0; 
    504510 
    505   setCurrentTab(tab); 
     511  setCurrentTab(tabAt(tab)); 
    506512} 
    507513