From: Good Guy Date: Tue, 31 Dec 2019 01:46:14 +0000 (-0700) Subject: fix default color btn in set title bar color, fix bar color fast path, tweaks to... X-Git-Tag: 2019-12~1 X-Git-Url: https://cinelerra-gg.org/git/?a=commitdiff_plain;h=052becff04e4f4a4240a87c6b2f2f4023b65d247;p=goodguy%2Fcinelerra.git fix default color btn in set title bar color, fix bar color fast path, tweaks to sketcher alias popup menu --- diff --git a/cinelerra-5.1/cinelerra/colorpicker.C b/cinelerra-5.1/cinelerra/colorpicker.C index 26451d70..7c0a38d0 100644 --- a/cinelerra-5.1/cinelerra/colorpicker.C +++ b/cinelerra-5.1/cinelerra/colorpicker.C @@ -86,6 +86,7 @@ BC_Window* ColorPicker::new_gui() if( x < 0 ) x = 0; if( y < 0 ) y = 0; ColorWindow *window = new ColorWindow(this, x, y, w, h, window_title); + window->create_objects(); window->start_selection(color, !do_alpha ? -1 : alpha, ok_cancel); return window; } @@ -114,6 +115,13 @@ ColorWindow::~ColorWindow() { } +void ColorWindow::create_objects() +{ + BC_WindowBase::create_objects(); + ColorGUI::create_objects(); + thread->create_objects(this); +} + void ColorWindow::update_gui(int color, int alpha) { lock_window("ColorWindow::update_gui"); diff --git a/cinelerra-5.1/cinelerra/colorpicker.h b/cinelerra-5.1/cinelerra/colorpicker.h index 706b2792..9116e0d6 100644 --- a/cinelerra-5.1/cinelerra/colorpicker.h +++ b/cinelerra-5.1/cinelerra/colorpicker.h @@ -45,6 +45,7 @@ public: ColorPicker(int do_alpha = 0, const char *title = 0); ~ColorPicker(); void start_window(int color, int alpha, int ok_cancel=0); + virtual void create_objects(ColorWindow *window) {} virtual void update_gui(int color, int alpha); virtual int handle_new_color(int color, int alpha); BC_Window* new_gui(); @@ -142,6 +143,7 @@ public: void update_gui(int color, int alpha); int handle_new_color(int color, int alpha); + void create_objects(); int close_event() { return close_gui(); } int cursor_motion_event() { return cursor_motion_gui(); } diff --git a/cinelerra-5.1/cinelerra/resourcepixmap.C b/cinelerra-5.1/cinelerra/resourcepixmap.C index 9ed12d93..b0bc49b7 100644 --- a/cinelerra-5.1/cinelerra/resourcepixmap.C +++ b/cinelerra-5.1/cinelerra/resourcepixmap.C @@ -238,6 +238,8 @@ VFrame *ResourcePixmap::change_title_color(VFrame *title_bg, int color) VFrame *title_bar = new VFrame(tw, th, colormodel); uint8_t **bar_rows = title_bar->get_rows(); const uint8_t gap_grey = 0x4a; + union { unsigned rgba; struct { uint8_t r,g,b,a; }; } c; + c.r = color>>16; c.g = color>>8; c.b = color>>0; c.a = 0xff; if( BC_CModels::has_alpha(colormodel) && // fast path BC_CModels::calculate_pixelsize(colormodel) == sizeof(unsigned) ) { const unsigned gap_rgba = (0xff<<24) | @@ -246,16 +248,14 @@ VFrame *ResourcePixmap::change_title_color(VFrame *title_bg, int color) unsigned *bp = (unsigned *)bar_rows[0]; for( int i=tw; --i>=0; ) *bp++ = gap_rgba; } - unsigned rgba = (0xff<<24) | (color & 0xffffff); for( int y=1; y 0 ) *bp++ = gap_rgba; - for( int i=tw1; --i>0; ++bp ) *bp = rgba; + for( int i=tw1; --i>0; ++bp ) *bp = c.rgba; if( tw > 1 ) *bp = gap_rgba; } } else { - uint8_t cr = (color>>16), cg = (color>>8), cb = (color>>0); if( th > 0 ) { uint8_t *cp = bar_rows[0]; for( int x=0; x 3 ) cp[3] = 0xff; cp += bpp; } diff --git a/cinelerra-5.1/cinelerra/trackpopup.C b/cinelerra-5.1/cinelerra/trackpopup.C index 224343b4..c00c023d 100644 --- a/cinelerra-5.1/cinelerra/trackpopup.C +++ b/cinelerra-5.1/cinelerra/trackpopup.C @@ -454,10 +454,12 @@ TrackTitleColorPicker::~TrackTitleColorPicker() } void TrackTitleColorPicker::create_objects(ColorWindow *gui) { + gui->lock_window("TrackTitleColorPicker::create_objects"); int y = gui->get_h() - BC_CancelButton::calculate_h() + yS(10); int x = gui->get_w() - BC_CancelButton::calculate_w() - xS(10); x -= BC_GenericButton::calculate_w(gui, _("default")) + xS(15); gui->add_subwindow(new TrackTitleColorDefault(this, x, y)); + gui->unlock_window(); } int TrackTitleColorPicker::handle_new_color(int color, int alpha) diff --git a/cinelerra-5.1/plugins/sketcher/sketcherwindow.C b/cinelerra-5.1/plugins/sketcher/sketcherwindow.C index 5a38b4b8..dfb7e956 100644 --- a/cinelerra-5.1/plugins/sketcher/sketcherwindow.C +++ b/cinelerra-5.1/plugins/sketcher/sketcherwindow.C @@ -278,6 +278,7 @@ SketcherAliasing::SketcherAliasing(SketcherWindow *gui, Sketcher *plugin, { this->gui = gui; this->plugin = plugin; + set_tooltip(_("Anti-Aliasing")); } SketcherAliasing::~SketcherAliasing() { @@ -293,7 +294,7 @@ void SketcherAliasing::create_objects() const char *SketcherAliasing::alias_to_text(int alias) { if( alias < 0 ) return _("Off"); - if( alias > 0 ) return _("Dbl"); + if( alias > 0 ) return _("Double"); return _("On"); }