X-Git-Url: https://git.cinelerra-gg.org/git/?p=goodguy%2Fcinelerra.git;a=blobdiff_plain;f=cinelerra-5.1%2Fcinelerra%2Fappearanceprefs.C;h=0fb0ba3f82a0273dc444d5c5825fb48ed2a5750a;hp=766cf6ce2c9fd3f61e4ec48a1ee4cd6bc945b0a7;hb=2287a1f9b45c690c3604b93a05bff0543ea4fee8;hpb=7fd85fb66168f6b518c5f2d73e04036e87faa0e1 diff --git a/cinelerra-5.1/cinelerra/appearanceprefs.C b/cinelerra-5.1/cinelerra/appearanceprefs.C index 766cf6ce..0fb0ba3f 100644 --- a/cinelerra-5.1/cinelerra/appearanceprefs.C +++ b/cinelerra-5.1/cinelerra/appearanceprefs.C @@ -43,6 +43,7 @@ AppearancePrefs::AppearancePrefs(MWindow *mwindow, PreferencesWindow *pwindow) hex = 0; feet = 0; thumbnails = 0; + thumbnail_size = 0; } AppearancePrefs::~AppearancePrefs() @@ -54,6 +55,7 @@ AppearancePrefs::~AppearancePrefs() delete hex; delete feet; delete thumbnails; + delete thumbnail_size; } @@ -69,6 +71,7 @@ void AppearancePrefs::create_objects() add_subwindow(new BC_Title(x, y, _("Layout:"), LARGEFONT, resources->text_default)); y += 35; + int y1 = y; ViewTheme *theme; add_subwindow(new BC_Title(x, y, _("Theme:"))); @@ -81,7 +84,24 @@ void AppearancePrefs::create_objects() add_subwindow(new BC_Title(x, y, _("Plugin Icons:"))); add_subwindow(plugin_icons = new ViewPluginIcons(x1, y, pwindow)); plugin_icons->create_objects(); - y += plugin_icons->get_h() + 5; + y += plugin_icons->get_h() + 15; + x1 = get_w()/2; + + int x2 = x1 + 160, y2 = y; + y = y1; + add_subwindow(new BC_Title(x1, y, _("View thumbnail size:"))); + thumbnail_size = new ViewThumbnailSize(pwindow, this, x2, y); + thumbnail_size->create_objects(); + y += thumbnail_size->get_h() + 5; + add_subwindow(new BC_Title(x1, y, _("Vicon memory size:"))); + vicon_size = new ViewViconSize(pwindow, this, x2, y); + vicon_size->create_objects(); + y += vicon_size->get_h() + 5; + add_subwindow(new BC_Title(x1, y, _("Vicon color mode:"))); + add_subwindow(vicon_color_mode = new ViewViconColorMode(pwindow, x2, y)); + vicon_color_mode->create_objects(); + y += vicon_color_mode->get_h() + 5; + y = bmax(y, y2); y += 10; add_subwindow(new BC_Bar(5, y, get_w() - 10)); @@ -90,13 +110,12 @@ void AppearancePrefs::create_objects() add_subwindow(new BC_Title(x, y, _("Time Format:"), LARGEFONT, resources->text_default)); - x1 = get_w()/2; add_subwindow(new BC_Title(x1, y, _("Flags:"), LARGEFONT, resources->text_default)); y += get_text_height(LARGEFONT) + 5; y += 10; - int y1 = y; + y1 = y; add_subwindow(hms = new TimeFormatHMS(pwindow, this, pwindow->thread->edl->session->time_format == TIME_HMS, @@ -165,6 +184,9 @@ void AppearancePrefs::create_objects() UseTipWindow *tip_win = new UseTipWindow(pwindow, x1, y1); add_subwindow(tip_win); y1 += tip_win->get_h() + 5; + AutocolorAssets *autocolor_assets = new AutocolorAssets(pwindow, x1, y1); + add_subwindow(autocolor_assets); + y1 += autocolor_assets->get_h() + 5; UseWarnIndecies *idx_win = new UseWarnIndecies(pwindow, x1, y1); add_subwindow(idx_win); y1 += idx_win->get_h() + 5; @@ -194,6 +216,9 @@ void AppearancePrefs::create_objects() PerpetualSession *perpetual = new PerpetualSession(x1, y1, pwindow); add_subwindow(perpetual); y1 += perpetual->get_h() + 5; + CtrlToggle *ctrl_toggle = new CtrlToggle(x1, y1, pwindow); + add_subwindow(ctrl_toggle); + y1 += ctrl_toggle->get_h() + 5; if( y < y1 ) y = y1; } @@ -400,6 +425,87 @@ int ViewThumbnails::handle_event() } +ViewThumbnailSize::ViewThumbnailSize(PreferencesWindow *pwindow, + AppearancePrefs *aprefs, int x, int y) + : BC_TumbleTextBox(aprefs, + pwindow->thread->preferences->awindow_picon_h, + 16, 512, x, y, 80) + +{ + this->pwindow = pwindow; + this->aprefs = aprefs; +} + +int ViewThumbnailSize::handle_event() +{ + int v = atoi(get_text()); + bclamp(v, 16,512); + pwindow->thread->preferences->awindow_picon_h = v; + return 1; +} + +ViewViconSize::ViewViconSize(PreferencesWindow *pwindow, + AppearancePrefs *aprefs, int x, int y) + : BC_TumbleTextBox(aprefs, + pwindow->thread->preferences->vicon_size, + 16, 512, x, y, 80) + +{ + this->pwindow = pwindow; + this->aprefs = aprefs; +} + +int ViewViconSize::handle_event() +{ + int v = atoi(get_text()); + bclamp(v, 16,512); + pwindow->thread->preferences->vicon_size = v; + return 1; +} + +ViewViconColorMode::ViewViconColorMode(PreferencesWindow *pwindow, int x, int y) + : BC_PopupMenu(x, y, 100, + _(vicon_color_modes[pwindow->thread->preferences->vicon_color_mode]), 1) +{ + this->pwindow = pwindow; +} +ViewViconColorMode::~ViewViconColorMode() +{ +} + +const char *ViewViconColorMode::vicon_color_modes[] = { + N_("Low"), + N_("Med"), + N_("High"), +}; + +void ViewViconColorMode::create_objects() +{ + for( int id=0,nid=sizeof(vicon_color_modes)/sizeof(vicon_color_modes[0]); idthread->preferences->vicon_color_mode])); + return 1; +} + +ViewViconColorModeItem::ViewViconColorModeItem(ViewViconColorMode *popup, const char *text, int id) + : BC_MenuItem(text) +{ + this->popup = popup; + this->id = id; +} + +int ViewViconColorModeItem::handle_event() +{ + popup->set_text(get_text()); + popup->pwindow->thread->preferences->vicon_color_mode = id; + return popup->handle_event(); +} + UseTipWindow::UseTipWindow(PreferencesWindow *pwindow, int x, int y) : BC_CheckBox(x, @@ -526,6 +632,19 @@ int ForwardRenderDisplacement::handle_event() return 1; } +AutocolorAssets::AutocolorAssets(PreferencesWindow *pwindow, int x, int y) + : BC_CheckBox(x, y, pwindow->thread->preferences->autocolor_assets, + _("Autocolor assets")) +{ + this->pwindow = pwindow; +} + +int AutocolorAssets::handle_event() +{ + pwindow->thread->preferences->autocolor_assets = get_value(); + return 1; +} + HighlightInverseColor::HighlightInverseColor(PreferencesWindow *pwindow, int x, int y, const char *hex) : BC_TextBox(x, y, 80, 1, hex) { @@ -571,7 +690,7 @@ void YuvColorSpace::create_objects() int YuvColorSpace::handle_event() { - set_text(color_space[pwindow->thread->preferences->yuv_color_space]); + set_text(_(color_space[pwindow->thread->preferences->yuv_color_space])); return 1; } @@ -645,3 +764,16 @@ int PerpetualSession::handle_event() return 1; } +CtrlToggle::CtrlToggle(int x, int y, PreferencesWindow *pwindow) + : BC_CheckBox(x, y, + pwindow->thread->preferences->ctrl_toggle, _("Clears before toggle")) +{ + this->pwindow = pwindow; +} + +int CtrlToggle::handle_event() +{ + pwindow->thread->preferences->ctrl_toggle = get_value(); + return 1; +} +