mirror of
https://invent.kde.org/network/falkon.git
synced 2024-11-13 10:32:11 +01:00
TabStackedWidget: Emit signal on change of pin state.
This commit is contained in:
parent
9301a5a2a8
commit
598ad6f13c
|
@ -235,11 +235,12 @@ int TabStackedWidget::pinUnPinTab(int index, const QString &title)
|
||||||
int newIndex = -1;
|
int newIndex = -1;
|
||||||
QWidget* widget = m_stack->widget(index);
|
QWidget* widget = m_stack->widget(index);
|
||||||
QWidget* currentWidget = m_stack->currentWidget();
|
QWidget* currentWidget = m_stack->currentWidget();
|
||||||
|
bool makePinned = false;
|
||||||
|
|
||||||
m_tabBar->m_blockCurrentChangedSignal = true;
|
m_tabBar->m_blockCurrentChangedSignal = true;
|
||||||
|
|
||||||
if (widget) {
|
if (widget) {
|
||||||
bool makePinned = index >= m_tabBar->pinnedTabsCount();
|
makePinned = index >= m_tabBar->pinnedTabsCount();
|
||||||
QWidget* button = m_tabBar->tabButton(index, m_tabBar->iconButtonPosition());
|
QWidget* button = m_tabBar->tabButton(index, m_tabBar->iconButtonPosition());
|
||||||
|
|
||||||
m_tabBar->setTabButton(index, m_tabBar->iconButtonPosition(), 0);
|
m_tabBar->setTabButton(index, m_tabBar->iconButtonPosition(), 0);
|
||||||
|
@ -255,6 +256,10 @@ int TabStackedWidget::pinUnPinTab(int index, const QString &title)
|
||||||
// Restore current index
|
// Restore current index
|
||||||
setCurrentWidget(currentWidget);
|
setCurrentWidget(currentWidget);
|
||||||
|
|
||||||
|
if (widget) {
|
||||||
|
emit pinStateChanged(newIndex, makePinned);
|
||||||
|
}
|
||||||
|
|
||||||
return newIndex;
|
return newIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -63,6 +63,7 @@ public:
|
||||||
signals:
|
signals:
|
||||||
void currentChanged(int index);
|
void currentChanged(int index);
|
||||||
void tabCloseRequested(int index);
|
void tabCloseRequested(int index);
|
||||||
|
void pinStateChanged(int index, bool pinned);
|
||||||
|
|
||||||
public slots:
|
public slots:
|
||||||
void setCurrentIndex(int index);
|
void setCurrentIndex(int index);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user