From c6a143f0f3e245d79881da50e61e6f35c556d88d Mon Sep 17 00:00:00 2001 From: Good Guy Date: Sun, 16 Dec 2018 16:46:21 -0700 Subject: [PATCH 1/1] switch to solid color for edit title bar --- cinelerra-5.1/cinelerra/resourcepixmap.C | 30 ++++++++---------------- cinelerra-5.1/cinelerra/resourcepixmap.h | 3 +-- 2 files changed, 11 insertions(+), 22 deletions(-) diff --git a/cinelerra-5.1/cinelerra/resourcepixmap.C b/cinelerra-5.1/cinelerra/resourcepixmap.C index e70c5fcd..eb276561 100644 --- a/cinelerra-5.1/cinelerra/resourcepixmap.C +++ b/cinelerra-5.1/cinelerra/resourcepixmap.C @@ -243,26 +243,21 @@ SET_TRACE } -VFrame *ResourcePixmap::change_title_color(VFrame *title_bg, int color, int bg_color) +VFrame *ResourcePixmap::change_title_color(VFrame *title_bg, int color) { - if( color < 0 || color == bg_color ) return title_bg; + if( color < 0 ) return title_bg; int colormodel = title_bg->get_color_model(); int bpp = BC_CModels::calculate_pixelsize(colormodel); int tw = title_bg->get_w(), th = title_bg->get_h(); VFrame *title_bar = new VFrame(tw, th, colormodel); - uint8_t br = (bg_color>>16), cr = (color>>16); - uint8_t bg = (bg_color>>8), cg = (color>>8); - uint8_t bb = (bg_color>>0), cb = (color>>0); - int dr = cr-br, dg = cg-bg, db = cb-bb; + uint8_t cr = (color>>16), cg = (color>>8), cb = (color>>0); uint8_t **bar_rows = title_bar->get_rows(); - uint8_t **rows = title_bg->get_rows(); for( int y=0; y 3 ) *cp++ = *bp++; + cp[0] = cr; cp[1] = cg; cp[2] = cb; + if( bpp > 3 ) cp[3] = 0xff; + cp += bpp; } } return title_bar; @@ -281,14 +276,9 @@ void ResourcePixmap::draw_title(TrackCanvas *canvas, if( w > pixmap_w ) w -= w - pixmap_w; VFrame *title_bg = mwindow->theme->get_image("title_bg_data"); - VFrame *title_bar = title_bg; - int color = mwindow->get_title_color(edit), bg_color = -1; - if( color >= 0 ) { - bg_color = mwindow->theme->get_color_title_bg(); - if( bg_color == color ) color = -1; - } - if( color >= 0 && color != bg_color ) - title_bar = change_title_color(title_bg, color, bg_color); + int color = mwindow->get_title_color(edit); + VFrame *title_bar = color < 0 ? title_bg : + change_title_color(title_bg, color); canvas->draw_3segmenth(x, 0, w, total_x, total_w, title_bar, this); if( title_bar != title_bg ) delete title_bar; diff --git a/cinelerra-5.1/cinelerra/resourcepixmap.h b/cinelerra-5.1/cinelerra/resourcepixmap.h index 40bb3b56..931877fe 100644 --- a/cinelerra-5.1/cinelerra/resourcepixmap.h +++ b/cinelerra-5.1/cinelerra/resourcepixmap.h @@ -60,8 +60,7 @@ public: // Called by ResourceThread to update pixmap void draw_wave(TrackCanvas *canvas, int x, double high, double low); - VFrame *change_title_color(VFrame *title_bg, - int color, int bg_color); + VFrame *change_title_color(VFrame *title_bg, int color); void draw_title(TrackCanvas *canvas, Edit *edit, int64_t edit_x, int64_t edit_w, int64_t pixmap_x, int64_t pixmap_w); -- 2.26.2