mirror of
https://github.com/aseprite/aseprite.git
synced 2024-12-28 15:20:15 +00:00
Tabs: disable mouse wheel when we are dragging tabs
This commit is contained in:
parent
c63ccf914f
commit
eb60a4c3e7
@ -420,22 +420,24 @@ bool Tabs::onProcessMessage(Message* msg)
|
||||
}
|
||||
return true;
|
||||
|
||||
case kMouseWheelMessage: {
|
||||
int dz =
|
||||
(static_cast<MouseMessage*>(msg)->wheelDelta().x +
|
||||
static_cast<MouseMessage*>(msg)->wheelDelta().y);
|
||||
case kMouseWheelMessage:
|
||||
if (!m_isDragging) {
|
||||
int dz =
|
||||
(static_cast<MouseMessage*>(msg)->wheelDelta().x +
|
||||
static_cast<MouseMessage*>(msg)->wheelDelta().y);
|
||||
|
||||
auto it = std::find(m_list.begin(), m_list.end(), m_selected);
|
||||
if (it != m_list.end()) {
|
||||
int index = (it - m_list.begin());
|
||||
int newIndex = index + dz;
|
||||
newIndex = MID(0, newIndex, int(m_list.size())-1);
|
||||
if (newIndex != index) {
|
||||
selectTabInternal(m_list[newIndex]);
|
||||
auto it = std::find(m_list.begin(), m_list.end(), m_selected);
|
||||
if (it != m_list.end()) {
|
||||
int index = (it - m_list.begin());
|
||||
int newIndex = index + dz;
|
||||
newIndex = MID(0, newIndex, int(m_list.size())-1);
|
||||
if (newIndex != index) {
|
||||
selectTabInternal(m_list[newIndex]);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
case kKeyDownMessage:
|
||||
case kKeyUpMessage: {
|
||||
|
Loading…
Reference in New Issue
Block a user