From: Juergen Spitzmueller Date: Mon, 18 May 2015 11:11:34 +0000 (+0200) Subject: GuiBox: sort colors X-Git-Tag: 2.2.0alpha1~767 X-Git-Url: https://git.lyx.org/gitweb/?a=commitdiff_plain;h=a98cfe1874ba8d774843fe731c3107c7aba3c0b3;p=features.git GuiBox: sort colors --- 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);