Add an option to only display visual typesetting tools when the mouse is over the video.

Originally committed to SVN as r4257.
This commit is contained in:
Thomas Goyne 2010-05-01 01:45:10 +00:00
parent 61c141a714
commit 5cbabf2d35
5 changed files with 8 additions and 2 deletions

View file

@ -397,6 +397,9 @@ DialogOptions::DialogOptions(wxWindow *parent)
control = new wxCheckBox(videoPage,-1,_("Show keyframes in slider")); control = new wxCheckBox(videoPage,-1,_("Show keyframes in slider"));
Bind(control,_T("Show keyframes on video slider")); Bind(control,_T("Show keyframes on video slider"));
videoSizer3->Add(control,0,wxEXPAND); videoSizer3->Add(control,0,wxEXPAND);
control = new wxCheckBox(videoPage,-1,_("Always show visual tools"));
Bind(control,_T("Always show visual tools"));
videoSizer3->Add(control,0,wxEXPAND);
videoSizer3->AddGrowableCol(1,1); videoSizer3->AddGrowableCol(1,1);
// Second sizer // Second sizer

View file

@ -377,6 +377,7 @@ void OptionsManager::LoadDefaults(bool onlyDefaults,bool doOverride) {
SetInt(_T("Audio Sample Rate"),0); SetInt(_T("Audio Sample Rate"),0);
SetBool(_T("Video Visual Realtime"),true); SetBool(_T("Video Visual Realtime"),true);
SetBool(_T("Always show visual tools"),true);
SetBool(_T("Detached video"),false); SetBool(_T("Detached video"),false);
SetInt(_T("Detached video last x"),-1); SetInt(_T("Detached video last x"),-1);
SetInt(_T("Detached video last y"),-1); SetInt(_T("Detached video last y"),-1);

View file

@ -291,7 +291,9 @@ void VideoDisplay::Render() try {
DrawTVEffects(); DrawTVEffects();
if (visualMode == -1) SetVisualMode(0, false); if (visualMode == -1) SetVisualMode(0, false);
if (visual) visual->Draw(); if (visual && (visual->mouseX > INT_MIN || visual->mouseY > INT_MIN || Options.AsBool(L"Always show visual tools"))) {
visual->Draw();
}
glFinish(); glFinish();
SwapBuffers(); SwapBuffers();

View file

@ -80,6 +80,7 @@ void VisualToolClip::Update() {
/// @return /// @return
/// ///
void VisualToolClip::Draw() { void VisualToolClip::Draw() {
if (mouseX == -1 || mouseY == -1) return;
// Get current line // Get current line
AssDialogue *line = GetActiveDialogueLine(); AssDialogue *line = GetActiveDialogueLine();
if (!line) return; if (!line) return;

View file

@ -90,7 +90,6 @@ void VisualToolCross::Update() {
/// @brief Draw /// @brief Draw
/// ///
void VisualToolCross::Draw() { void VisualToolCross::Draw() {
// Is it outside?
if (mouseX == -1 || mouseY == -1) return; if (mouseX == -1 || mouseY == -1) return;
// Draw cross // Draw cross