Le 15/05/15 06:16, Uwe Stöhr a écrit :
Dear LyXers,

the attached patch makes it possible to choose a frame color and a
background color for boxes.

I see that this does not replace boxes with shaded background. Do we really need to have all these types of boxes now?

OK to go in?

A few comments on the patch follow.

JMarc

@@ -73,6 +76,60 @@ static QStringList boxGuiSpecialLengthNames()
 }


+static QList<ColorPair> colorData()
+{

#### Please use anonymous namespace rather than static in this case
#### (no, I cannot tell you why; but anways I think it is in our code
#### rules).

+       QList<ColorPair> colors;
+       colors << ColorPair(qt_("none"), Color_none);
+       colors << ColorPair(qt_("black"), Color_black);
+       colors << ColorPair(qt_("white"), Color_white);
+       colors << ColorPair(qt_("blue"), Color_blue);

Don't we have this information of match between enum and name in Color.cpp? What is the point of repeating it here?

+       colors << ColorPair(qt_("brown"), Color_brown);
+       colors << ColorPair(qt_("cyan"), Color_cyan);
+       colors << ColorPair(qt_("darkgray"), Color_darkgray);
+       colors << ColorPair(qt_("gray"), Color_gray);

[...]

+template<class P>
+static int findPos2nd(QList<P> const & vec, QString val)
+{
+       for (int i = 0; i != vec.size(); ++i)
+               if (vec[i].first == val)
+                       return i;
+       return 0;
+}

I see that this is from GuiCharacter.cpp. Rather than copying it, why not put it in qt_helpers.*?


Reply via email to