#include "GuiApplication.h"
#include "ColorCache.h"
+#include "ColorSet.h"
#include "LengthCombo.h"
#include "Length.h"
#include "qt_helpers.h"
}
// assure that the frame color is black for frameless boxes to
// provide the color "none"
- if (frameless && frameColorCO->currentText() != qt_("black"))
+ if (frameless && frameColorCO->currentIndex() != 0)
frameColorCO->setCurrentIndex(0);
changed();
}
void GuiBox::on_frameColorCO_currentIndexChanged(int /* index */)
{
- // if there is a special frme color the background canot be uncolored
- if (frameColorCO->currentText() != qt_("black")) {
- if (backgroundColorCO->currentText() == qt_("none"))
- backgroundColorCO->setCurrentIndex(findPos2nd(color, qt_("white")));
- if (backgroundColorCO->itemText(0) == qt_("none"))
+ // if there is a non-black frame color the background canot be uncolored
+ // therefore remove the entry "none" in this case
+ if (frameColorCO->currentIndex() != 0) {
+ if (backgroundColorCO->count() == color.count()) {
+ if (backgroundColorCO->currentIndex() == 0)
+ backgroundColorCO->setCurrentIndex(findPos2nd(color, qt_("white")));
backgroundColorCO->removeItem(0);
+ }
} else {
- if (backgroundColorCO->itemText(0) != qt_("none"))
+ if (backgroundColorCO->count() == color.count() - 1)
backgroundColorCO->insertItem(0, qt_("none"));
}
changed();
// LaTeX's default for \shadowsize is 4 pt
shadowsizeED->setText("4");
shadowsizeUnitsLC->setCurrentItem(Length::PT);
- // the default color is black and none
- frameColorCO->setCurrentIndex(findPos2nd(color, qt_("black")) - 1);
- backgroundColorCO->setCurrentIndex(findPos2nd(color, qt_("none")));
}
(params.shadowsize).asString(), default_unit);
// set color
frameColorCO->setCurrentIndex(findPos2nd(color, qt_(params.framecolor)) - 1);
- if (frameColorCO->currentText() != qt_("black"))
+ // only if the framecolor is black the backgroundcolor has the entry "none"
+ if (frameColorCO->currentIndex() != 0)
backgroundColorCO->setCurrentIndex(findPos2nd(color, qt_(params.backgroundcolor)) - 1);
else
backgroundColorCO->setCurrentIndex(findPos2nd(color, qt_(params.backgroundcolor)));
else
params.shadowsize = Length("4pt");
if (frameColorCO->isEnabled())
- params.framecolor = fromqstr(color[frameColorCO->currentIndex() + 1].first);
+ params.framecolor = lcolor.getLaTeXName(color[frameColorCO->currentIndex() + 1].second);
else
params.framecolor = "black";
if (backgroundColorCO->isEnabled()) {
// only if the framecolor is black the backgroundcolor has the entry "none"
- if (frameColorCO->currentText() != qt_("black"))
- params.backgroundcolor = fromqstr(color[backgroundColorCO->currentIndex() + 1].first);
+ if (frameColorCO->currentIndex() != 0)
+ params.backgroundcolor = lcolor.getLaTeXName(color[backgroundColorCO->currentIndex() + 1].second);
else
- params.backgroundcolor = fromqstr(color[backgroundColorCO->currentIndex()].first);
+ params.backgroundcolor = lcolor.getLaTeXName(color[backgroundColorCO->currentIndex()].second);
} else
params.backgroundcolor = "none";