20 ui =
new Ui::KisWdgIndexColors;
45 int rows = shadesLabels.length();
51 for(
int row = 0; row < rows; ++row)
53 QLabel* l =
new QLabel(shadesLabels[row],
ui->colorsBox);
54 ui->layoutColors->addWidget(l, row+1, 0);
65 for(
int row = 0; row < (rows-1); ++row)
67 QLabel* l0 =
new QLabel(shadesLabels[row+1]);
68 QLabel* l1 =
new QLabel(QString::fromUtf8(
"↔"));
69 QLabel* l2 =
new QLabel(shadesLabels[row]);
79 ui->layoutRowSteps->addWidget(l0, row, 0);
80 ui->layoutRowSteps->addWidget(l1, row, 1);
81 ui->layoutRowSteps->addWidget(l2, row, 2);
82 ui->layoutRowSteps->addWidget(s, row, 3);
85 for(
int y = 0; y < rows; ++y)
86 for(
int x = 0; x < columns; ++x)
89 QCheckBox* c =
new QCheckBox;
92 b->setMaximumWidth(50);
93 c->setMaximumWidth(21);
95 connect(c, SIGNAL(toggled(
bool)), b, SLOT(setEnabled(
bool)));
99 QHBoxLayout* cell =
new QHBoxLayout();
101 cell->setContentsMargins(0, 0, 0, 0);
104 ui->layoutColors->addLayout(cell, 1+y, 1+x);
118 for(
int y = 0; y < 4; ++y)
119 for(
int x = 0; x < 4; ++x)
125 for(
int y = 0; y < 3; ++y)
132 ui->colorCount->setText(QString::number(pal.
numColors()));
134 config->setProperty(
"paletteGen", palCfg.
toByteArray());
136 config->setProperty(
"LFactor",
ui->luminanceSlider->value() / 100.f);
137 config->setProperty(
"aFactor",
ui->aSlider->value() / 100.f);
138 config->setProperty(
"bFactor",
ui->bSlider->value() / 100.f);
140 config->setProperty(
"reduceColorsEnabled",
ui->colorLimitCheck->isChecked());
141 config->setProperty(
"colorLimit",
ui->colorLimit->value());
143 config->setProperty(
"alphaSteps",
ui->alphaStepsSpinBox->value());
150 palCfg.
fromByteArray(config->getProperty(
"paletteGen").toByteArray());
152 ui->luminanceSlider->setValue(config->getFloat(
"LFactor")*100);
153 ui->aSlider->setValue(config->getFloat(
"aFactor")*100);
154 ui->bSlider->setValue(config->getFloat(
"bFactor")*100);
155 ui->alphaStepsSpinBox->setValue(config->getInt(
"alphaSteps"));
156 ui->colorLimitCheck->setChecked(config->getBool(
"reduceColorsEnabled"));
157 ui->colorLimit->setEnabled(config->getBool(
"reduceColorsEnabled"));
158 ui->colorLimit->setValue(config->getInt(
"colorLimit"));
162 for(
int y = 0; y < 4; ++y)
163 for(
int x = 0; x < 4; ++x)
172 for(
int y = 0; y < 3; ++y)
176 ui->colorCount->setText(QString::number(pal.
numColors()));