GuiBox: sort colors

This commit is contained in:
Juergen Spitzmueller 2015-05-18 13:11:34 +02:00
parent bca8f5a940
commit a98cfe1874

View File

@ -103,6 +103,19 @@ static QList<ColorCode> colors()
}
namespace {
struct ColorSorter
{
bool operator()(ColorCode lhs, ColorCode rhs) const {
return
support::compare_no_case(lcolor.getGUIName(lhs), lcolor.getGUIName(rhs)) < 0;
}
};
} // namespace anon
GuiBox::GuiBox(QWidget * parent) : InsetParamsWidget(parent)
{
setupUi(this);
@ -156,6 +169,7 @@ GuiBox::GuiBox(QWidget * parent) : InsetParamsWidget(parent)
// the background can be uncolored while the frame cannot
color_codes_ = colors();
sort(color_codes_.begin(), color_codes_.end(), ColorSorter());
fillComboColor(backgroundColorCO, true);
fillComboColor(frameColorCO, false);