mirror of
https://github.com/aseprite/aseprite.git
synced 2025-01-30 06:32:42 +00:00
The color selector in color-buttons appears only when they are clicked.
This commit is contained in:
parent
5bea28659e
commit
74356cf8b7
@ -123,22 +123,33 @@ static bool colorbutton_msg_proc(JWidget widget, JMessage msg)
|
||||
return true;
|
||||
}
|
||||
|
||||
case JM_MOUSEENTER:
|
||||
colorbutton_open_tooltip(widget);
|
||||
break;
|
||||
|
||||
case JM_DRAW:
|
||||
colorbutton_draw(widget);
|
||||
return true;
|
||||
|
||||
case JM_SIGNAL:
|
||||
if (msg->signal.num == JI_SIGNAL_BUTTON_SELECT) {
|
||||
colorbutton_close_tooltip(widget);
|
||||
widget->captureMouse();
|
||||
// If the popup window was not created or shown yet..
|
||||
if (colorbutton->tooltip_window == NULL ||
|
||||
!jwidget_is_visible(colorbutton->tooltip_window)) {
|
||||
// Open it
|
||||
colorbutton_open_tooltip(widget);
|
||||
}
|
||||
else {
|
||||
// If it is visible, close it
|
||||
colorbutton_close_tooltip(widget);
|
||||
}
|
||||
// widget->captureMouse();
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
|
||||
#if 0 // Old behavior (MOUSEENTER popups color selector)
|
||||
|
||||
case JM_MOUSEENTER:
|
||||
colorbutton_open_tooltip(widget);
|
||||
break;
|
||||
|
||||
case JM_BUTTONPRESSED:
|
||||
if (widget->hasCapture()) {
|
||||
return true;
|
||||
@ -202,6 +213,7 @@ static bool colorbutton_msg_proc(JWidget widget, JMessage msg)
|
||||
return true;
|
||||
}
|
||||
break;
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user