Adjust TabBox::handleMouseEvent for only declarative views
Makes mouse wheel work again.
This commit is contained in:
parent
bd5ad8aa6b
commit
28dd3b1353
1 changed files with 7 additions and 27 deletions
|
@ -643,36 +643,16 @@ bool TabBox::handleMouseEvent(XEvent* e)
|
||||||
close(); // click outside closes tab
|
close(); // click outside closes tab
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
if (e->xbutton.button == Button5 || e->xbutton.button == Button4) {
|
||||||
if (m_tabBoxMode == TabBoxWindowsMode || m_tabBoxMode == TabBoxWindowsAlternativeMode) {
|
// mouse wheel event
|
||||||
// pass to declarative view
|
const QModelIndex index = m_tabBox->nextPrev(e->xbutton.button == Button5);
|
||||||
return false;
|
if (index.isValid()) {
|
||||||
}
|
setCurrentIndex(index);
|
||||||
|
|
||||||
// not declarative view
|
|
||||||
if (e->type != ButtonPress) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
QPoint pos(e->xbutton.x_root, e->xbutton.y_root);
|
|
||||||
QModelIndex index;
|
|
||||||
if (e->xbutton.button == Button1 || e->xbutton.button == Button2 || e->xbutton.button == Button3) {
|
|
||||||
index = m_tabBox->indexAt(pos);
|
|
||||||
if (e->xbutton.button == Button2 && index.isValid()) {
|
|
||||||
if (TabBoxClientImpl* client = static_cast< TabBoxClientImpl* >(m_tabBox->client(index))) {
|
|
||||||
if (Workspace::self()->hasClient(client->client())) {
|
|
||||||
client->client()->closeWindow();
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
} else {
|
|
||||||
// mouse wheel event
|
|
||||||
index = m_tabBox->nextPrev(e->xbutton.button == Button5);
|
|
||||||
}
|
}
|
||||||
|
return false;
|
||||||
if (index.isValid())
|
|
||||||
setCurrentIndex(index);
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void TabBox::grabbedKeyEvent(QKeyEvent* event)
|
void TabBox::grabbedKeyEvent(QKeyEvent* event)
|
||||||
|
|
Loading…
Reference in a new issue