]> git.lyx.org Git - features.git/commitdiff
GuiBox: sort colors
authorJuergen Spitzmueller <spitz@lyx.org>
Mon, 18 May 2015 11:11:34 +0000 (13:11 +0200)
committerJuergen Spitzmueller <spitz@lyx.org>
Mon, 18 May 2015 11:11:34 +0000 (13:11 +0200)
src/frontends/qt4/GuiBox.cpp

index 4334f7953ea56c5f8f44eb9f68e03f843ff626de..adc107e2151d460b42414648b98f9df983b1c89b 100644 (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);