mirror of https://github.com/odrling/Aegisub
In PersistLocation get the new location of the dialog directly from the dialog rather than from the event as the data in the event is wrong
Originally committed to SVN as r6411.
This commit is contained in:
parent
04cc422391
commit
7bd0691bd7
|
@ -35,6 +35,7 @@ PersistLocation::PersistLocation(wxDialog *dialog, std::string options_prefix)
|
||||||
: x_opt(OPT_SET(options_prefix + "/Last/X"))
|
: x_opt(OPT_SET(options_prefix + "/Last/X"))
|
||||||
, y_opt(OPT_SET(options_prefix + "/Last/Y"))
|
, y_opt(OPT_SET(options_prefix + "/Last/Y"))
|
||||||
, maximize_opt(OPT_SET(options_prefix + "/Maximized"))
|
, maximize_opt(OPT_SET(options_prefix + "/Maximized"))
|
||||||
|
, dialog(dialog)
|
||||||
{
|
{
|
||||||
dialog->Bind(wxEVT_MOVE, &PersistLocation::OnMove, this);
|
dialog->Bind(wxEVT_MOVE, &PersistLocation::OnMove, this);
|
||||||
dialog->Bind(wxEVT_ICONIZE, &PersistLocation::OnMinimize, this);
|
dialog->Bind(wxEVT_ICONIZE, &PersistLocation::OnMinimize, this);
|
||||||
|
@ -78,8 +79,8 @@ PersistLocation::PersistLocation(wxDialog *dialog, std::string options_prefix)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void PersistLocation::OnMove(wxMoveEvent &evt) {
|
void PersistLocation::OnMove(wxMoveEvent &) {
|
||||||
wxPoint pos = evt.GetPosition();
|
wxPoint pos = dialog->GetPosition();
|
||||||
x_opt->SetInt(pos.x);
|
x_opt->SetInt(pos.x);
|
||||||
y_opt->SetInt(pos.y);
|
y_opt->SetInt(pos.y);
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,8 +40,9 @@ class PersistLocation {
|
||||||
agi::OptionValue *x_opt;
|
agi::OptionValue *x_opt;
|
||||||
agi::OptionValue *y_opt;
|
agi::OptionValue *y_opt;
|
||||||
agi::OptionValue *maximize_opt;
|
agi::OptionValue *maximize_opt;
|
||||||
|
class wxDialog *dialog;
|
||||||
|
|
||||||
void OnMove(wxMoveEvent &evt);
|
void OnMove(wxMoveEvent &);
|
||||||
void OnMinimize(wxIconizeEvent &evt);
|
void OnMinimize(wxIconizeEvent &evt);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
Loading…
Reference in New Issue