|
|
|
@ -326,7 +326,7 @@ WebTab* TabBar::webTab(int index) const |
|
|
|
|
|
|
|
|
|
|
|
void TabBar::showCloseButton(int index) |
|
|
|
void TabBar::showCloseButton(int index) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!validIndex(index) || m_isRestoring) { |
|
|
|
if (!validIndex(index)) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -358,7 +358,7 @@ void TabBar::contextMenuEvent(QContextMenuEvent* event) |
|
|
|
|
|
|
|
|
|
|
|
void TabBar::hideCloseButton(int index) |
|
|
|
void TabBar::hideCloseButton(int index) |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (!validIndex(index) || tabsClosable() || m_isRestoring) { |
|
|
|
if (!validIndex(index) || tabsClosable()) { |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
@ -422,7 +422,7 @@ void TabBar::currentTabChanged(int index) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Don't hide close buttons when dragging tabs
|
|
|
|
// Don't hide close buttons when dragging tabs
|
|
|
|
if (m_dragStartPosition.isNull()) { |
|
|
|
if (m_dragStartPosition.isNull() && !m_isRestoring) { |
|
|
|
showCloseButton(index); |
|
|
|
showCloseButton(index); |
|
|
|
if (m_lastTab) { |
|
|
|
if (m_lastTab) { |
|
|
|
hideCloseButton(m_lastTab->tabIndex()); |
|
|
|
hideCloseButton(m_lastTab->tabIndex()); |
|
|
|
@ -436,6 +436,10 @@ void TabBar::currentTabChanged(int index) |
|
|
|
|
|
|
|
|
|
|
|
void TabBar::setTabText(int index, const QString &text) |
|
|
|
void TabBar::setTabText(int index, const QString &text) |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (m_isRestoring) { |
|
|
|
|
|
|
|
return; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString tabText = text; |
|
|
|
QString tabText = text; |
|
|
|
|
|
|
|
|
|
|
|
// Avoid Alt+letter shortcuts
|
|
|
|
// Avoid Alt+letter shortcuts
|
|
|
|
@ -735,4 +739,9 @@ void TabBar::setIsRestoring(bool restoring) |
|
|
|
m_isRestoring = restoring; |
|
|
|
m_isRestoring = restoring; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool TabBar::isRestoring() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return m_isRestoring; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
#include "tabbar.moc" |
|
|
|
#include "tabbar.moc" |
|
|
|
|