mirror of https://github.com/odrling/Aegisub
Made detached video window remember its last position/maximized state - #492
Originally committed to SVN as r1692.
This commit is contained in:
parent
30fc5aa32f
commit
8a6f04512b
|
@ -55,6 +55,12 @@ DialogDetachedVideo::DialogDetachedVideo(FrameMain *par)
|
||||||
// Set parent
|
// Set parent
|
||||||
parent = par;
|
parent = par;
|
||||||
|
|
||||||
|
// Set up window
|
||||||
|
int x = Options.AsInt(_T("Detached video last x"));
|
||||||
|
int y = Options.AsInt(_T("Detached video last y"));
|
||||||
|
if (x != -1 && y != -1) SetPosition(wxPoint(x,y));
|
||||||
|
if (Options.AsBool(_T("Detached video maximized"))) Maximize();
|
||||||
|
|
||||||
// Set obscure stuff
|
// Set obscure stuff
|
||||||
SetExtraStyle(GetExtraStyle() & (~wxWS_EX_BLOCK_EVENTS) | wxWS_EX_PROCESS_UI_UPDATES);
|
SetExtraStyle(GetExtraStyle() & (~wxWS_EX_BLOCK_EVENTS) | wxWS_EX_PROCESS_UI_UPDATES);
|
||||||
|
|
||||||
|
@ -85,6 +91,8 @@ DialogDetachedVideo::DialogDetachedVideo(FrameMain *par)
|
||||||
/////////////
|
/////////////
|
||||||
// Destructor
|
// Destructor
|
||||||
DialogDetachedVideo::~DialogDetachedVideo() {
|
DialogDetachedVideo::~DialogDetachedVideo() {
|
||||||
|
Options.SetBool(_T("Detached video maximized"),IsMaximized());
|
||||||
|
Options.Save();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -93,6 +101,7 @@ DialogDetachedVideo::~DialogDetachedVideo() {
|
||||||
BEGIN_EVENT_TABLE(DialogDetachedVideo,wxDialog)
|
BEGIN_EVENT_TABLE(DialogDetachedVideo,wxDialog)
|
||||||
EVT_KEY_DOWN(DialogDetachedVideo::OnKey)
|
EVT_KEY_DOWN(DialogDetachedVideo::OnKey)
|
||||||
EVT_CLOSE(DialogDetachedVideo::OnClose)
|
EVT_CLOSE(DialogDetachedVideo::OnClose)
|
||||||
|
EVT_MOVE(DialogDetachedVideo::OnMove)
|
||||||
END_EVENT_TABLE()
|
END_EVENT_TABLE()
|
||||||
|
|
||||||
|
|
||||||
|
@ -109,9 +118,17 @@ void DialogDetachedVideo::OnKey(wxKeyEvent &event) {
|
||||||
// Close window
|
// Close window
|
||||||
void DialogDetachedVideo::OnClose(wxCloseEvent &event) {
|
void DialogDetachedVideo::OnClose(wxCloseEvent &event) {
|
||||||
FrameMain *par = parent;
|
FrameMain *par = parent;
|
||||||
|
Options.SetBool(_T("Detached video"),false);
|
||||||
Destroy();
|
Destroy();
|
||||||
par->detachedVideo = NULL;
|
par->detachedVideo = NULL;
|
||||||
par->SetDisplayMode(-1,-1);
|
par->SetDisplayMode(-1,-1);
|
||||||
Options.SetBool(_T("Detached video"),false);
|
}
|
||||||
Options.Save();
|
|
||||||
|
|
||||||
|
///////////////
|
||||||
|
// Move window
|
||||||
|
void DialogDetachedVideo::OnMove(wxMoveEvent &event) {
|
||||||
|
wxPoint pos = event.GetPosition();
|
||||||
|
Options.SetInt(_T("Detached video last x"),pos.x);
|
||||||
|
Options.SetInt(_T("Detached video last y"),pos.y);
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,6 +55,7 @@ private:
|
||||||
|
|
||||||
void OnKey(wxKeyEvent &event);
|
void OnKey(wxKeyEvent &event);
|
||||||
void OnClose(wxCloseEvent &event);
|
void OnClose(wxCloseEvent &event);
|
||||||
|
void OnMove(wxMoveEvent &event);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DialogDetachedVideo(FrameMain *parent);
|
DialogDetachedVideo(FrameMain *parent);
|
||||||
|
|
|
@ -148,7 +148,6 @@ void OptionsManager::LoadDefaults(bool onlyDefaults) {
|
||||||
SetModificationType(MOD_VIDEO);
|
SetModificationType(MOD_VIDEO);
|
||||||
SetBool(_T("Show keyframes on video slider"),true);
|
SetBool(_T("Show keyframes on video slider"),true);
|
||||||
SetBool(_T("Show overscan mask"),false);
|
SetBool(_T("Show overscan mask"),false);
|
||||||
SetBool(_T("Detached video"),false);
|
|
||||||
|
|
||||||
// Video Provider (Advanced)
|
// Video Provider (Advanced)
|
||||||
SetModificationType(MOD_VIDEO_RELOAD);
|
SetModificationType(MOD_VIDEO_RELOAD);
|
||||||
|
@ -333,6 +332,10 @@ void OptionsManager::LoadDefaults(bool onlyDefaults) {
|
||||||
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("Detached video"),false);
|
||||||
|
SetInt(_T("Detached video last x"),-1);
|
||||||
|
SetInt(_T("Detached video last y"),-1);
|
||||||
|
SetBool(_T("Detached video maximized"),false);
|
||||||
|
|
||||||
SetInt(_T("Timing processor key start before thres"),5);
|
SetInt(_T("Timing processor key start before thres"),5);
|
||||||
SetInt(_T("Timing processor key start after thres"),4);
|
SetInt(_T("Timing processor key start after thres"),4);
|
||||||
|
|
Loading…
Reference in New Issue