mirror of
https://github.com/Chatterino/chatterino2.git
synced 2024-11-21 22:24:07 +01:00
Merge pull request #743 from 23rd/patch-15-scroll-tabs
Added scrolling over tabs with wheel to switch channels.
This commit is contained in:
commit
099fd88098
2 changed files with 10 additions and 0 deletions
|
@ -479,6 +479,15 @@ void NotebookTab::mouseMoveEvent(QMouseEvent *event)
|
||||||
Button::mouseMoveEvent(event);
|
Button::mouseMoveEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void NotebookTab::wheelEvent(QWheelEvent *event)
|
||||||
|
{
|
||||||
|
if (event->delta() > 0) {
|
||||||
|
this->notebook_->selectPreviousTab();
|
||||||
|
} else {
|
||||||
|
this->notebook_->selectNextTab();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QRect NotebookTab::getXRect()
|
QRect NotebookTab::getXRect()
|
||||||
{
|
{
|
||||||
// if (!this->notebook->getAllowUserTabManagement()) {
|
// if (!this->notebook->getAllowUserTabManagement()) {
|
||||||
|
|
|
@ -61,6 +61,7 @@ protected:
|
||||||
virtual void dragEnterEvent(QDragEnterEvent *event) override;
|
virtual void dragEnterEvent(QDragEnterEvent *event) override;
|
||||||
|
|
||||||
virtual void mouseMoveEvent(QMouseEvent *event) override;
|
virtual void mouseMoveEvent(QMouseEvent *event) override;
|
||||||
|
virtual void wheelEvent(QWheelEvent *event) override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool hasXButton();
|
bool hasXButton();
|
||||||
|
|
Loading…
Reference in a new issue