X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fstatusbar.C;h=d27045b654bd2d654a231095dd137e910689f642;hp=4e86de5916f346b2926d6826cc33993d39dba551;hb=9b18af02dc4ccbf052ef9d70180a3d16c0f9848b;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1 diff --git a/cinelerra-5.1/cinelerra/statusbar.C b/cinelerra-5.1/cinelerra/statusbar.C index 4e86de59..d27045b6 100644 --- a/cinelerra-5.1/cinelerra/statusbar.C +++ b/cinelerra-5.1/cinelerra/statusbar.C @@ -49,7 +49,7 @@ StatusBar::~StatusBar() void StatusBar::create_objects() { //printf("StatusBar::create_objects 1\n"); - int x = 10; //int y = 5; + int x = xS(10); //int y = 5; //printf("StatusBar::create_objects 1\n"); draw_top_background(get_parent(), 0, 0, get_w(), get_h()); add_subwindow(status_text = new BC_Title(mwindow->theme->mstatus_message_x, @@ -57,7 +57,7 @@ void StatusBar::create_objects() "", MEDIUMFONT, mwindow->theme->message_normal)); - x = get_w() - 290; + x = get_w() - xS(290); // printf("StatusBar::create_objects %d: 0x%08x\n", // __LINE__, mwindow->theme->message_normal); add_subwindow(main_progress = @@ -65,7 +65,7 @@ void StatusBar::create_objects() mwindow->theme->mstatus_progress_y, mwindow->theme->mstatus_progress_w, mwindow->theme->mstatus_progress_w)); - x += main_progress->get_w() + 5; + x += main_progress->get_w() + xS(5); //printf("StatusBar::create_objects 1\n"); add_subwindow(main_progress_cancel = new StatusBarCancel(mwindow, @@ -78,9 +78,7 @@ void StatusBar::create_objects() void StatusBar::resize_event() { - int x = 10; //int y = 1; - - + int x = xS(10); //int y = 1; reposition_window(mwindow->theme->mstatus_x, mwindow->theme->mstatus_y, mwindow->theme->mstatus_w, @@ -92,23 +90,41 @@ void StatusBar::resize_event() status_text->reposition_window(mwindow->theme->mstatus_message_x, mwindow->theme->mstatus_message_y); - x = get_w() - 290; + x = get_w() - xS(290); main_progress->reposition_window(mwindow->theme->mstatus_progress_x, mwindow->theme->mstatus_progress_y); - x += main_progress->get_w() + 5; + x += main_progress->get_w() + xS(5); main_progress_cancel->reposition_window(mwindow->theme->mstatus_cancel_x, mwindow->theme->mstatus_cancel_y); flash(0); } -void StatusBar::show_message(const char *text, int color) +void StatusBar::show_message(const char *text, int msg_color, int box_color) { - if( color < 0 ) color = mwindow->theme->message_normal; - status_text->set_color(color); + int mx = mwindow->theme->mstatus_message_x; + int my = mwindow->theme->mstatus_message_y; + int tx = status_text->get_x(), th = status_text->get_h(); + if( box_color >= 0 ) { + set_color(box_color); + int bb = th/4, bh = th - bb*2; + draw_box(mx+bb,my+bb, bh,bh); + flash(mx,my, th,th); mx += xS(5); + if( (mx+=th) != tx ) + status_text->reposition_window(mx, my); + } + else if( tx != mx ) { + draw_top_background(get_parent(), mx,my, th,th); + flash(mx,my, th,th); + status_text->reposition_window(mx, my); + } + if( msg_color < 0 ) + msg_color = mwindow->theme->message_normal; + status_text->set_color(msg_color); status_text->update(text); } + void StatusBar::reset_default_message() { status_color = -1;