コード例 #1
0
ファイル: TabBarWidget.cpp プロジェクト: aurhat/otter-browser
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();
}
コード例 #2
0
ファイル: TabBarWidget.cpp プロジェクト: Decme/otter
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;
	}
}
コード例 #3
0
void PasswordBarWidget::accepted()
{
	hide();

	emit requestedClose();

	PasswordsManager::addPassword(m_password);
}
コード例 #4
0
ファイル: TabBarWidget.cpp プロジェクト: wanarek/otter
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);
	}
}
コード例 #5
0
ファイル: TabBarWidget.cpp プロジェクト: wanarek/otter
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);
		}
	}
}
コード例 #6
0
ファイル: TabBarWidget.cpp プロジェクト: aurhat/otter-browser
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);
	}
}
コード例 #7
0
ファイル: TabBarWidget.cpp プロジェクト: NYAMNYAM3/otter
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();
}
コード例 #8
0
void PasswordBarWidget::rejected()
{
	hide();

	emit requestedClose();
}