Added scrolling over tabs with wheel to switch channels.

This commit is contained in:
23rd
2018-10-01 03:32:20 +03:00
parent cd571a7e25
commit 7122e47817
2 changed files with 18 additions and 0 deletions
+14
View File
@@ -479,6 +479,20 @@ void NotebookTab::mouseMoveEvent(QMouseEvent *event)
Button::mouseMoveEvent(event);
}
void NotebookTab::wheelEvent(QWheelEvent *event)
{
float mouseMultiplier = getSettings()->mouseScrollMultiplier;
wheelValue += event->delta() * mouseMultiplier;
if (wheelValue > WHEEL_STEP) {
this->notebook_->selectNextTab();
wheelValue = 0;
} else if (wheelValue < -WHEEL_STEP) {
this->notebook_->selectPreviousTab();
wheelValue = 0;
}
}
QRect NotebookTab::getXRect()
{
// if (!this->notebook->getAllowUserTabManagement()) {