The color selector in color-buttons appears only when they are clicked.

This commit is contained in:
David Capello 2010-04-25 23:21:10 -03:00
parent 5bea28659e
commit 74356cf8b7

View File

@ -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
}