mirror of
https://github.com/aseprite/aseprite.git
synced 2024-11-20 14:21:45 +00:00
Now you can press a mouse button in a IntEntry and drag the mouse to the slider (issue 339)
This commit is contained in:
parent
bb32f1fbf2
commit
7251f4b70a
@ -12,6 +12,7 @@
|
||||
|
||||
#include "gfx/rect.h"
|
||||
#include "gfx/region.h"
|
||||
#include "ui/manager.h"
|
||||
#include "ui/message.h"
|
||||
#include "ui/popup_window.h"
|
||||
#include "ui/slider.h"
|
||||
@ -75,6 +76,21 @@ bool IntEntry::onProcessMessage(Message* msg)
|
||||
openPopup();
|
||||
break;
|
||||
|
||||
case kMouseMoveMessage:
|
||||
if (hasCapture()) {
|
||||
MouseMessage* mouseMsg = static_cast<MouseMessage*>(msg);
|
||||
Widget* pick = getManager()->pick(mouseMsg->position());
|
||||
if (pick == m_slider) {
|
||||
releaseMouse();
|
||||
|
||||
MouseMessage mouseMsg(kMouseDownMessage,
|
||||
mouseMsg->buttons(),
|
||||
mouseMsg->position());
|
||||
m_slider->sendMessage(&mouseMsg);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case kMouseWheelMessage:
|
||||
if (isEnabled()) {
|
||||
int oldValue = getValue();
|
||||
|
@ -657,7 +657,8 @@ void Manager::setMouse(Widget* widget)
|
||||
else
|
||||
it = widget_parents.begin();
|
||||
|
||||
Message* msg = new Message(kMouseEnterMessage);
|
||||
Message* msg = newMouseMessage(kMouseEnterMessage, NULL,
|
||||
currentMouseButtons(0));
|
||||
|
||||
for (; it != widget_parents.end(); ++it) {
|
||||
(*it)->flags |= JI_HASMOUSE;
|
||||
|
Loading…
Reference in New Issue
Block a user