Port away from deprecated Qt::MidButton

master
Laurent Montel 2020-09-01 07:14:58 +02:00
parent afdd5b84c7
commit 87ff6e4b44
7 changed files with 8 additions and 8 deletions

View File

@ -2380,7 +2380,7 @@ bool AbstractClient::processDecorationButtonPress(QMouseEvent *event, bool ignor
if (event->button() == Qt::LeftButton)
com = active ? options->commandActiveTitlebar1() : options->commandInactiveTitlebar1();
else if (event->button() == Qt::MidButton)
else if (event->button() == Qt::MiddleButton)
com = active ? options->commandActiveTitlebar2() : options->commandInactiveTitlebar2();
else if (event->button() == Qt::RightButton)
com = active ? options->commandActiveTitlebar3() : options->commandInactiveTitlebar3();

View File

@ -851,7 +851,7 @@ void CoverSwitchEffect::windowInputMouseEvent(QEvent* e)
break;
case Qt::LeftButton:
case Qt::RightButton:
case Qt::MidButton:
case Qt::MiddleButton:
default:
QPoint pos = event->pos();

View File

@ -576,7 +576,7 @@ void DesktopGridEffect::windowInputMouseEvent(QEvent* e)
windowMove = w;
effects->setElevatedWindow(windowMove, true);
}
} else if ((me->buttons() == Qt::MidButton || me->buttons() == Qt::RightButton) && windowMove == nullptr) {
} else if ((me->buttons() == Qt::MiddleButton || me->buttons() == Qt::RightButton) && windowMove == nullptr) {
EffectWindow* w = windowAt(me->pos());
if (w && w->isDesktop()) {
w = nullptr;

View File

@ -953,7 +953,7 @@ void FlipSwitchEffect::windowInputMouseEvent(QEvent* e)
break;
case Qt::LeftButton:
case Qt::RightButton:
case Qt::MidButton:
case Qt::MiddleButton:
default:
// TODO: Change window on mouse button click
break;

View File

@ -602,7 +602,7 @@ void PresentWindowsEffect::inputEventUpdate(const QPoint &pos, QEvent::Type type
mouseActionDesktop(m_leftButtonDesktop);
}
}
if (button == Qt::MidButton) {
if (button == Qt::MiddleButton) {
if (hovering) {
// mouse is hovering above a window - use MouseActionsWindow
mouseActionWindow(m_middleButtonWindow);

View File

@ -1064,7 +1064,7 @@ double Options::animationTimeFactor() const
Options::WindowOperation Options::operationMaxButtonClick(Qt::MouseButtons button) const
{
return button == Qt::RightButton ? opMaxButtonRightClick :
button == Qt::MidButton ? opMaxButtonMiddleClick :
button == Qt::MiddleButton ? opMaxButtonMiddleClick :
opMaxButtonLeftClick;
}

View File

@ -149,7 +149,7 @@ Qt::MouseButton x11ToQtMouseButton(int button)
if (button == XCB_BUTTON_INDEX_1)
return Qt::LeftButton;
if (button == XCB_BUTTON_INDEX_2)
return Qt::MidButton;
return Qt::MiddleButton;
if (button == XCB_BUTTON_INDEX_3)
return Qt::RightButton;
if (button == XCB_BUTTON_INDEX_4)
@ -165,7 +165,7 @@ Qt::MouseButtons x11ToQtMouseButtons(int state)
if (state & XCB_KEY_BUT_MASK_BUTTON_1)
ret |= Qt::LeftButton;
if (state & XCB_KEY_BUT_MASK_BUTTON_2)
ret |= Qt::MidButton;
ret |= Qt::MiddleButton;
if (state & XCB_KEY_BUT_MASK_BUTTON_3)
ret |= Qt::RightButton;
if (state & XCB_KEY_BUT_MASK_BUTTON_4)