Ejemplo n.º 1
0
void TabBarWidget::mousePressEvent(QMouseEvent *event)
{
	if (event->button() == Qt::LeftButton && event->modifiers().testFlag(Qt::ShiftModifier))
	{
		const int tab = tabAt(event->pos());

		if (tab >= 0)
		{
			emit requestedClose(tab);

			return;
		}
	}

	QTabBar::mousePressEvent(event);

	if (event->button() == Qt::MiddleButton)
	{
		const int tab = tabAt(event->pos());

		if (tab < 0)
		{
			ActionsManager::triggerAction(ActionsManager::NewTabAction, this);
		}
		else if (SettingsManager::getValue(QLatin1String("TabBar/CloseOnMiddleClick")).toBool())
		{
			emit requestedClose(tab);
		}
	}

	hidePreview();
}
Ejemplo n.º 2
0
void TabBarWidget::mouseReleaseEvent(QMouseEvent *event)
{
	QTabBar::mouseReleaseEvent(event);

	if (event->button() == Qt::MidButton && SettingsManager::getValue(QLatin1String("TabBar/CloseOnMiddleClick")).toBool())
	{
		const int tab = tabAt(event->pos());

		if (tab >= 0)
		{
			emit requestedClose(tab);
		}
	}

	if (m_previewWidget && m_previewWidget->isVisible())
	{
		m_previewWidget->hide();
	}

	if (m_previewTimer > 0)
	{
		killTimer(m_previewTimer);

		m_previewTimer = 0;
	}
}
Ejemplo n.º 3
0
void PasswordBarWidget::accepted()
{
	hide();

	emit requestedClose();

	PasswordsManager::addPassword(m_password);
}
Ejemplo n.º 4
0
void TabBarWidget::mouseDoubleClickEvent(QMouseEvent *event)
{
	const int tab = tabAt(event->pos());

	if (tab < 0)
	{
		ActionsManager::triggerAction(QLatin1String("NewTab"));
	}
	else if (SettingsManager::getValue(QLatin1String("Tabs/CloseOnDoubleClick")).toBool())
	{
		emit requestedClose(tab);
	}
}
Ejemplo n.º 5
0
void TabBarWidget::mouseReleaseEvent(QMouseEvent *event)
{
	QTabBar::mouseReleaseEvent(event);

	if (event->button() == Qt::MidButton && SettingsManager::getValue(QLatin1String("Tabs/CloseOnMiddleClick")).toBool())
	{
		const int tab = tabAt(event->pos());

		if (tab >= 0)
		{
			emit requestedClose(tab);
		}
	}
}
Ejemplo n.º 6
0
void TabBarWidget::mouseDoubleClickEvent(QMouseEvent *event)
{
	if (event->button() != Qt::LeftButton)
	{
		return;
	}

	const int tab = tabAt(event->pos());

	if (tab >= 0 && SettingsManager::getValue(QLatin1String("TabBar/CloseOnDoubleClick")).toBool())
	{
		emit requestedClose(tab);
	}
}
Ejemplo n.º 7
0
void TabBarWidget::mouseReleaseEvent(QMouseEvent *event)
{
	QTabBar::mouseReleaseEvent(event);

	if (event->button() == Qt::MidButton)
	{
		const int tab = tabAt(event->pos());

		if (tab < 0)
		{
			ActionsManager::triggerAction(QLatin1String("NewTab"), this);
		}
		else if (SettingsManager::getValue(QLatin1String("TabBar/CloseOnMiddleClick")).toBool())
		{
			emit requestedClose(tab);
		}
	}

	hidePreview();
}
Ejemplo n.º 8
0
void PasswordBarWidget::rejected()
{
	hide();

	emit requestedClose();
}