- if( send ) gui->plugin->send_configure_change();
-}
-
-CriKeyColorButton::CriKeyColorButton(CriKeyWindow *gui, int x, int y)
- : BC_GenericButton(x, y, _("Color"))
-{
- this->gui = gui;
-}
-int CriKeyColorButton::handle_event()
-{
- gui->start_color_thread();
- return 1;
-}
-
-CriKeyColorPicker::CriKeyColorPicker(CriKeyColorButton *color_button)
- : ColorPicker(0, _("Color"))
-{
- this->color_button = color_button;
-}
-
-void CriKeyColorPicker::start(int color)
-{
- orig_color = this->color = color;
- start_window(color, 0, 1);
-}
-
-void CriKeyColorPicker::handle_done_event(int result)
-{
- if( result ) color = orig_color;
- CriKeyWindow *gui = color_button->gui;
- gui->lock_window("CriKeyColorPicker::handle_done_event");
- gui->update_color(color);
- gui->plugin->config.color = color;
- gui->plugin->send_configure_change();
- gui->unlock_window();
-}
-
-int CriKeyColorPicker::handle_new_color(int color, int alpha)
-{
- CriKeyWindow *gui = color_button->gui;
- gui->lock_window("CriKeyColorPicker::handle_new_color");
- gui->update_color(this->color = color);
- gui->flush();
- gui->plugin->config.color = color;
- gui->plugin->send_configure_change();
- gui->unlock_window();
- return 1;
-}
-
-
-void CriKeyWindow::start_color_thread()
-{
- unlock_window();
- delete color_picker;
- color_picker = new CriKeyColorPicker(color_button);
- color_picker->start(plugin->config.color);
- lock_window("CriKeyWindow::start_color_thread");