X-Git-Url: https://cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fplugins%2Ftitler%2Ftitlerwindow.C;h=21cfdea22d811bce2411196a15b84fc8806a9685;hb=9fed7535470aa37781733db836068da3b4c17a0d;hp=a0c7882630a2d197af121ec077dfc2db267bbd6a;hpb=824ab396d0db646c64d57a75b08e80fbc0b5de8e;p=goodguy%2Fcinelerra.git diff --git a/cinelerra-5.1/plugins/titler/titlerwindow.C b/cinelerra-5.1/plugins/titler/titlerwindow.C index a0c78826..21cfdea2 100644 --- a/cinelerra-5.1/plugins/titler/titlerwindow.C +++ b/cinelerra-5.1/plugins/titler/titlerwindow.C @@ -118,6 +118,8 @@ TitleWindow::TitleWindow(TitleMain *client) void TitleWindow::done_event(int result) { + color_button->close_picker(); + outline_button->close_picker(); drag->drag_deactivate(); delete color_popup; color_popup = 0; delete png_popup; png_popup = 0; @@ -365,10 +367,16 @@ void TitleWindow::create_objects() stroker->create_objects(); x += stroker->get_w() + margin; #endif - y += outline_title->get_h() + margin; - add_tool(timecode = new TitleTimecode(client, this, x1=x, y)); - x += timecode->get_w() + margin; - add_tool(timecode_format = new TitleTimecodeFormat(client, this, x, y, + add_tool(timecode = new TitleTimecode(client, this, x, y)); + y += timecode->get_h() + margin; + int tw = 0; + for( int i=0; iconfig.timecode_format, string))); timecode_format->create_objects(); y += timecode_format->get_h() + margin; @@ -403,7 +411,7 @@ void TitleWindow::create_objects() png_popup = new TitlePngPopup(client, this); show_window(1); - update(); + update_gui(); } int TitleWindow::resize_event(int w, int h) @@ -554,7 +562,7 @@ void TitleWindow::update_stats() text_chars->update(client->config.wlen); } -void TitleWindow::update() +void TitleWindow::update_gui() { title_x->update((int64_t)client->config.title_x); title_y->update((int64_t)client->config.title_y); @@ -780,7 +788,9 @@ void TitleColorButton::handle_done_event(int result) { if( result ) { handle_new_color(orig_color, orig_alpha); + window->lock_window("TitleColorButton::handle_done_event"); update_gui(orig_color); + window->unlock_window(); } } @@ -802,7 +812,9 @@ void TitleOutlineColorButton::handle_done_event(int result) { if( result ) { handle_new_color(orig_color, orig_alpha); + window->lock_window("TitleColorButton::handle_done_event"); update_gui(orig_color); + window->unlock_window(); } } @@ -848,8 +860,8 @@ int TitleTimecode::handle_event() } TitleTimecodeFormat::TitleTimecodeFormat(TitleMain *client, TitleWindow *window, - int x, int y, const char *text) - : BC_PopupMenu(x, y, 100, text, 1) + int x, int y, int tw, const char *text) + : BC_PopupMenu(x, y, BC_PopupMenu::calculate_w(tw)+10, text, 1) { this->client = client; this->window = window; @@ -1220,7 +1232,8 @@ TitleDrag::TitleDrag(TitleMain *client, TitleWindow *window, int x, int y) Track *TitleDrag::get_drag_track() { - return client->server->plugin->track; + return !client->server->plugin ? 0 : + client->server->plugin->track; } int64_t TitleDrag::get_drag_position() {