Exemplo n.º 1
0
void TabBarWidget::removeTab(int index)
{
	if (underMouse())
	{
		const QSize size = tabSizeHint(count() - 1);

		m_tabSize = size.width();
	}

	Window *window = getWindow(index);

	if (window)
	{
		window->deleteLater();
	}

	QTabBar::removeTab(index);

	if (window && window->isPinned())
	{
		isPinnedChanged();
		updateGeometry();
		adjustSize();
	}

	if (underMouse() && tabAt(mapFromGlobal(QCursor::pos())) < 0)
	{
		m_tabSize = 0;

		updateGeometry();
		adjustSize();
	}
}
Exemplo n.º 2
0
void Window::setPinned(bool pinned)
{
	if (pinned != m_isPinned)
	{
		m_isPinned = pinned;

		emit isPinnedChanged(pinned);
	}
}
Exemplo n.º 3
0
void TabBarWidget::addTab(int index, Window *window)
{
	insertTab(index, window->getTitle());
	setTabData(index, window->getIdentifier());

	connect(window, SIGNAL(iconChanged(QIcon)), this, SLOT(updateTabs()));
	connect(window, SIGNAL(loadingStateChanged(WindowLoadingState)), this, SLOT(updateTabs()));
	connect(window, SIGNAL(isPinnedChanged(bool)), this, SLOT(isPinnedChanged()));

	if (window->isPinned())
	{
		isPinnedChanged(window);
	}

	updateTabs(index);
}