}
-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);
connect(shadowsizeED, SIGNAL(textChanged(QString)), this, SIGNAL(changed()));
connect(shadowsizeUnitsLC, SIGNAL(selectionChanged(lyx::Length::UNIT)),
this, SIGNAL(changed()));
- connect(frameColorCO, SIGNAL(highlighted(QString)), this, SIGNAL(changed()));
- connect(backgroundColorCO, SIGNAL(highlighted(QString)), this, SIGNAL(changed()));
+ connect(backgroundColorCO, SIGNAL(currentIndexChanged(int)),
+ this, SIGNAL(changed()));
heightED->setValidator(unsignedLengthValidator(heightED));
widthED->setValidator(unsignedLengthValidator(widthED));
// the background can be uncolored while the frame cannot
color_codes_ = colors();
- sort(color_codes_.begin(), color_codes_.end(), ColorSorter());
+ qSort(color_codes_.begin(), color_codes_.end(), ColorSorter);
fillComboColor(backgroundColorCO, true);
fillComboColor(frameColorCO, false);
ialignCO->setEnabled(ibox);
setSpecial(ibox);
- // halign is only allowed if a width is used
- halignCO->setEnabled(widthCB->isChecked());
+ // halign is only allowed without inner box and if a width is used and if
+ // pagebreak is not used
+ halignCO->setEnabled(!pagebreakCB->isChecked() && widthCB->isChecked()
+ && ((!ibox && type == "Boxed") || inner_type == "makebox"));
// add the entry "Stretch" if the box is \makebox or \framebox and if not already there
if ((inner_type == "makebox" || (type == "Boxed" && inner_type == "none"))
&& halignCO->count() < 4)
widthED->setEnabled(false);
widthUnitsLC->setEnabled(false);
}
- // halign is only allowed if a width is used
- halignCO->setEnabled(widthCB->isChecked());
+ // halign is only allowed without inner box and if a width is used and if
+ // pagebreak is not used
+ halignCO->setEnabled(!pagebreakCB->isChecked() && widthCB->isChecked()
+ && ((!ibox && outer == "Boxed") || itype == "makebox"));
// add the entry "Stretch" if the box is \makebox or \framebox and if not already there
if ((itype == "makebox" || (outer == "Boxed" && itype == "none"))
&& halignCO->count() < 4)