From a98cfe1874ba8d774843fe731c3107c7aba3c0b3 Mon Sep 17 00:00:00 2001 From: Juergen Spitzmueller Date: Mon, 18 May 2015 13:11:34 +0200 Subject: [PATCH] GuiBox: sort colors --- src/frontends/qt4/GuiBox.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/frontends/qt4/GuiBox.cpp b/src/frontends/qt4/GuiBox.cpp index 4334f7953e..adc107e215 100644 --- a/src/frontends/qt4/GuiBox.cpp +++ b/src/frontends/qt4/GuiBox.cpp @@ -103,6 +103,19 @@ static QList 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); -- 2.39.2