Add picked colors to the recently used colors

This commit is contained in:
Thomas Goyne 2012-11-25 16:47:39 -08:00
parent 59e6a1bef7
commit 1d020b851e

View file

@ -247,7 +247,7 @@ public:
~DialogColorPicker(); ~DialogColorPicker();
void SetColor(agi::Color new_color); void SetColor(agi::Color new_color);
agi::Color GetColor(); void AddColorToRecent();
}; };
static const int spectrum_horz_vert_arrow_size = 4; static const int spectrum_horz_vert_arrow_size = 4;
@ -589,6 +589,8 @@ bool GetColorFromUser(wxWindow* parent, agi::Color original, std::function<void
bool ok = dialog.ShowModal() == wxID_OK; bool ok = dialog.ShowModal() == wxID_OK;
if (!ok) if (!ok)
callback(original); callback(original);
else
dialog.AddColorToRecent();
return ok; return ok;
} }
@ -805,12 +807,10 @@ void DialogColorPicker::SetColor(agi::Color new_color)
UpdateFromRGB(); UpdateFromRGB();
} }
/// @brief Get the currently selected color void DialogColorPicker::AddColorToRecent()
agi::Color DialogColorPicker::GetColor()
{ {
recent_box->AddColor(cur_color); recent_box->AddColor(cur_color);
OPT_SET("Tool/Colour Picker/Recent Colours")->SetListColor(recent_box->Save()); OPT_SET("Tool/Colour Picker/Recent Colours")->SetListColor(recent_box->Save());
return cur_color;
} }
static void change_value(wxSpinCtrl *ctrl, int value) static void change_value(wxSpinCtrl *ctrl, int value)