X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fcolorpicker.C;h=72efa4a69fff306cda3519d97c647d7ad6e63f83;hb=134e3b2ef6322953b40f7ec2567e8b883eb42830;hp=927807b619e0462c3d8f115cc11001c0ae7094c5;hpb=1d4f5d708de0d8ec19300b417354a3374d00ed47;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/cinelerra/colorpicker.C b/cinelerra-5.1/cinelerra/colorpicker.C index 927807b6..72efa4a6 100644 --- a/cinelerra-5.1/cinelerra/colorpicker.C +++ b/cinelerra-5.1/cinelerra/colorpicker.C @@ -1237,6 +1237,13 @@ void ColorButton::close_picker() delete color_picker; color_picker = 0; } +void ColorButton::update_gui(int color, int alpha) +{ + if( color_picker ) + color_picker->update_gui(color, alpha); + update_gui(color | (~alpha<<24)); +} + void ColorButton::update_gui(int color) { set_color(color); @@ -1259,21 +1266,34 @@ void ColorButtonPicker::handle_done_event(int result) color_button->handle_done_event(result); } -int ColorButtonPicker::handle_new_color(int color, int alpha) +void ColorButtonPicker::update(int color, int alpha) { color_button->color = color; + color_button->alpha = alpha; color_button->color_thread->update_lock->unlock(); - color_button->handle_new_color(color, alpha); - return 1; +} + +int ColorButtonPicker::handle_new_color(int color, int alpha) +{ + color_button->lock_window("ColorButtonPicker::handle_new_color"); + color_button->update_gui(color, alpha); + color_button->unlock_window(); + return color_button->handle_new_color(color, alpha); } void ColorButtonPicker::update_gui() { color_button->lock_window("ColorButtonPicker::update_gui"); - color_button->update_gui(color_button->color); + color_button->update_gui(color_button->color, color_button->alpha); color_button->unlock_window(); } +void ColorButtonPicker::update_gui(int color, int alpha) +{ + ColorPicker::update_gui(color, alpha); + color_button->handle_new_color(color, alpha); +} + ColorButtonThread::ColorButtonThread(ColorButton *color_button) : Thread(1, 0, 0) { @@ -1337,7 +1357,7 @@ void ColorBoxButton::handle_done_event(int result) } void ColorBoxButton::create_objects() { - update_gui(color); + update_gui(color, alpha); } void ColorBoxButton::set_color(int color) @@ -1399,7 +1419,7 @@ void ColorCircleButton::handle_done_event(int result) } void ColorCircleButton::create_objects() { - update_gui(color); + update_gui(color, alpha); } void ColorCircleButton::set_color(int color)