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(); }
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; } }
void PasswordBarWidget::accepted() { hide(); emit requestedClose(); PasswordsManager::addPassword(m_password); }
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); } }
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); } } }
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); } }
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(); }
void PasswordBarWidget::rejected() { hide(); emit requestedClose(); }