1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 01:22:10 +01:00

TabStackedWidget: Emit signal on change of pin state.

This commit is contained in:
S. Razi Alavizadeh 2014-12-02 10:04:03 +03:30
parent 9301a5a2a8
commit 598ad6f13c
2 changed files with 7 additions and 1 deletions

View File

@ -235,11 +235,12 @@ int TabStackedWidget::pinUnPinTab(int index, const QString &title)
int newIndex = -1;
QWidget* widget = m_stack->widget(index);
QWidget* currentWidget = m_stack->currentWidget();
bool makePinned = false;
m_tabBar->m_blockCurrentChangedSignal = true;
if (widget) {
bool makePinned = index >= m_tabBar->pinnedTabsCount();
makePinned = index >= m_tabBar->pinnedTabsCount();
QWidget* button = m_tabBar->tabButton(index, m_tabBar->iconButtonPosition());
m_tabBar->setTabButton(index, m_tabBar->iconButtonPosition(), 0);
@ -255,6 +256,10 @@ int TabStackedWidget::pinUnPinTab(int index, const QString &title)
// Restore current index
setCurrentWidget(currentWidget);
if (widget) {
emit pinStateChanged(newIndex, makePinned);
}
return newIndex;
}

View File

@ -63,6 +63,7 @@ public:
signals:
void currentChanged(int index);
void tabCloseRequested(int index);
void pinStateChanged(int index, bool pinned);
public slots:
void setCurrentIndex(int index);