forked from mia/Aegisub
Colour picker now remembers its last position within the session
Originally committed to SVN as r1052.
This commit is contained in:
parent
425e8748ea
commit
d4e99d152c
2 changed files with 13 additions and 1 deletions
|
@ -558,7 +558,13 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, wxColour initial_color)
|
||||||
|
|
||||||
SetSizer(main_sizer);
|
SetSizer(main_sizer);
|
||||||
main_sizer->SetSizeHints(this);
|
main_sizer->SetSizeHints(this);
|
||||||
CenterOnParent();
|
|
||||||
|
// Position window
|
||||||
|
if (lastx == -1 && lasty == -1) {
|
||||||
|
CenterOnParent();
|
||||||
|
} else {
|
||||||
|
Move(lastx, lasty);
|
||||||
|
}
|
||||||
|
|
||||||
// Fill the controls
|
// Fill the controls
|
||||||
updating_controls = false;
|
updating_controls = false;
|
||||||
|
@ -573,6 +579,8 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, wxColour initial_color)
|
||||||
// Destructor
|
// Destructor
|
||||||
DialogColorPicker::~DialogColorPicker()
|
DialogColorPicker::~DialogColorPicker()
|
||||||
{
|
{
|
||||||
|
GetPosition(&lastx, &lasty);
|
||||||
|
|
||||||
delete rgb_spectrum[0];
|
delete rgb_spectrum[0];
|
||||||
delete rgb_spectrum[1];
|
delete rgb_spectrum[1];
|
||||||
delete rgb_spectrum[2];
|
delete rgb_spectrum[2];
|
||||||
|
@ -1111,3 +1119,5 @@ void DialogColorPicker::OnRecentSelect(wxCommandEvent &evt)
|
||||||
SetColor(color.GetWXColor());
|
SetColor(color.GetWXColor());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int DialogColorPicker::lastx = -1;
|
||||||
|
int DialogColorPicker::lasty = -1;
|
|
@ -184,6 +184,8 @@ private:
|
||||||
void OnSliderChange(wxCommandEvent &evt);
|
void OnSliderChange(wxCommandEvent &evt);
|
||||||
void OnRecentSelect(wxCommandEvent &evt);
|
void OnRecentSelect(wxCommandEvent &evt);
|
||||||
|
|
||||||
|
static int lastx, lasty;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
DialogColorPicker(wxWindow *parent, wxColour initial_color);
|
DialogColorPicker(wxWindow *parent, wxColour initial_color);
|
||||||
~DialogColorPicker();
|
~DialogColorPicker();
|
||||||
|
|
Loading…
Reference in a new issue