Merge pull request #743 from 23rd/patch-15-scroll-tabs

Added scrolling over tabs with wheel to switch channels.
This commit is contained in:
pajlada 2018-10-06 12:32:37 +00:00 committed by GitHub
commit 099fd88098
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View file

@ -479,6 +479,15 @@ void NotebookTab::mouseMoveEvent(QMouseEvent *event)
Button::mouseMoveEvent(event);
}
void NotebookTab::wheelEvent(QWheelEvent *event)
{
if (event->delta() > 0) {
this->notebook_->selectPreviousTab();
} else {
this->notebook_->selectNextTab();
}
}
QRect NotebookTab::getXRect()
{
// if (!this->notebook->getAllowUserTabManagement()) {

View file

@ -61,6 +61,7 @@ protected:
virtual void dragEnterEvent(QDragEnterEvent *event) override;
virtual void mouseMoveEvent(QMouseEvent *event) override;
virtual void wheelEvent(QWheelEvent *event) override;
private:
bool hasXButton();