mirror of
https://github.com/odrling/Aegisub
synced 2025-04-11 22:56:02 +02:00
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
@ -558,7 +558,13 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, wxColour initial_color)
|
||||
|
||||
SetSizer(main_sizer);
|
||||
main_sizer->SetSizeHints(this);
|
||||
CenterOnParent();
|
||||
|
||||
// Position window
|
||||
if (lastx == -1 && lasty == -1) {
|
||||
CenterOnParent();
|
||||
} else {
|
||||
Move(lastx, lasty);
|
||||
}
|
||||
|
||||
// Fill the controls
|
||||
updating_controls = false;
|
||||
@ -573,6 +579,8 @@ DialogColorPicker::DialogColorPicker(wxWindow *parent, wxColour initial_color)
|
||||
// Destructor
|
||||
DialogColorPicker::~DialogColorPicker()
|
||||
{
|
||||
GetPosition(&lastx, &lasty);
|
||||
|
||||
delete rgb_spectrum[0];
|
||||
delete rgb_spectrum[1];
|
||||
delete rgb_spectrum[2];
|
||||
@ -1111,3 +1119,5 @@ void DialogColorPicker::OnRecentSelect(wxCommandEvent &evt)
|
||||
SetColor(color.GetWXColor());
|
||||
}
|
||||
|
||||
int DialogColorPicker::lastx = -1;
|
||||
int DialogColorPicker::lasty = -1;
|
@ -184,6 +184,8 @@ private:
|
||||
void OnSliderChange(wxCommandEvent &evt);
|
||||
void OnRecentSelect(wxCommandEvent &evt);
|
||||
|
||||
static int lastx, lasty;
|
||||
|
||||
public:
|
||||
DialogColorPicker(wxWindow *parent, wxColour initial_color);
|
||||
~DialogColorPicker();
|
||||
|
Loading…
x
Reference in New Issue
Block a user