X-Git-Url: https://git.cinelerra-gg.org/git/?a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fpreferencesthread.C;h=26c92c56e6bb37a0dc7cfb6df238a1f21554bfb1;hb=fe4662624d711faab6b406490a64c2382661997e;hp=b27342e0d15805923d85a7a47d4b428122ce243f;hpb=30bdb85eb33a8ee7ba675038a86c6be59c43d7bd;p=goodguy%2Fhistory.git diff --git a/cinelerra-5.1/cinelerra/preferencesthread.C b/cinelerra-5.1/cinelerra/preferencesthread.C index b27342e0..26c92c56 100644 --- a/cinelerra-5.1/cinelerra/preferencesthread.C +++ b/cinelerra-5.1/cinelerra/preferencesthread.C @@ -66,7 +66,7 @@ PreferencesMenuitem::PreferencesMenuitem(MWindow *mwindow) - : BC_MenuItem(_("Preferences..."), _("Shift+P"), 'P') + : BC_MenuItem(_("Preferences..."), _("Shift-P"), 'P') { this->mwindow = mwindow; @@ -127,10 +127,17 @@ BC_Window* PreferencesThread::new_gui() int scr_w = mwindow->gui->get_screen_w(0, -1); int scr_h = mwindow->gui->get_screen_h(0, -1); - int x = scr_x + scr_w / 2 - WIDTH / 2; - int y = scr_h / 2 - HEIGHT / 2; + int w = WIDTH, h = HEIGHT; + int min_w = mwindow->theme->preferencescategory_x; + for(int i = 0; i < CATEGORIES; i++) { + min_w += PreferencesButton::calculate_w(mwindow->gui, category_to_text(i)) - + mwindow->theme->preferences_category_overlap; + } + if( w < min_w ) w = min_w; + int x = scr_x + scr_w / 2 - w / 2; + int y = scr_h / 2 - h / 2; - window = new PreferencesWindow(mwindow, this, x, y); + window = new PreferencesWindow(mwindow, this, x, y, w, h); window->create_objects(); mwindow->gui->unlock_window(); @@ -211,9 +218,12 @@ int PreferencesThread::apply_settings() BC_Signals::set_catch_segv(mwindow->preferences->trap_sigsegv); BC_Signals::set_catch_intr(mwindow->preferences->trap_sigintr); + BC_WindowBase::get_resources()->popupmenu_btnup = mwindow->preferences->popupmenu_btnup; mwindow->reset_android_remote(); mwindow->gui->ffmpeg_toggle->update(mwindow->preferences->ffmpeg_early_probe); + mwindow->gui->ffmpeg_toggle->set_tooltip( mwindow->preferences->ffmpeg_early_probe ? + _("Try FFMpeg first") : _("Try FFMpeg last") ); mwindow->gui->mainshbtns->load(mwindow->preferences); double tc_position = mwindow->edl->session->get_frame_offset() / mwindow->edl->session->frame_rate; @@ -242,9 +252,9 @@ int PreferencesThread::apply_settings() - for(int i = 0; i < mwindow->vwindows.size(); i++) - { + for(int i = 0; i < mwindow->vwindows.size(); i++) { VWindow *vwindow = mwindow->vwindows.get(i); + if( !vwindow->is_running() ) continue; vwindow->gui->lock_window("PreferencesThread::apply_settings"); vwindow->gui->meters->change_format(edl->session->meter_format, edl->session->min_meter_db, @@ -354,19 +364,8 @@ SET_TRACE PreferencesWindow::PreferencesWindow(MWindow *mwindow, - PreferencesThread *thread, - int x, - int y) - : BC_Window(_(PROGRAM_NAME ": Preferences"), - x, - y, - WIDTH, - HEIGHT, - (int)BC_INFINITY, - (int)BC_INFINITY, - 0, - 0, - 1) + PreferencesThread *thread, int x, int y, int w, int h) + : BC_Window(_(PROGRAM_NAME ": Preferences"), x,y, w,h,w,h, 1) { this->mwindow = mwindow; this->thread = thread; @@ -524,6 +523,7 @@ int PreferencesWindow::set_current_dialog(int number) //printf("PreferencesWindow::set_current_dialog %d\n", __LINE__); dialog->create_objects(); //printf("PreferencesWindow::set_current_dialog %d\n", __LINE__); + dialog->lower_window(); dialog->show_window(0); } @@ -603,12 +603,16 @@ PreferencesApply::PreferencesApply(MWindow *mwindow, PreferencesThread *thread) this->mwindow = mwindow; this->thread = thread; } - int PreferencesApply::handle_event() { thread->apply_settings(); return 1; } +int PreferencesApply::resize_event(int w, int h) +{ + reposition_window(w/2 - get_w()/2, h-get_h()-10); + return 1; +} @@ -621,7 +625,6 @@ PreferencesOK::PreferencesOK(MWindow *mwindow, PreferencesThread *thread) this->mwindow = mwindow; this->thread = thread; } - int PreferencesOK::keypress_event() { if(get_keypress() == RETURN) @@ -636,6 +639,11 @@ int PreferencesOK::handle_event() thread->window->set_done(0); return 1; } +int PreferencesOK::resize_event(int w, int h) +{ + reposition_window(10, h-get_h()-10); + return 1; +} @@ -656,12 +664,16 @@ int PreferencesCancel::keypress_event() } return 0; } - int PreferencesCancel::handle_event() { thread->window->set_done(1); return 1; } +int PreferencesCancel::resize_event(int w, int h) +{ + reposition_window(w-get_w()-10, h-get_h()-10); + return 1; +}