102 else |
102 else |
103 { |
103 { |
104 const ldraw::ColorTable::ColorDefinition& colordef = this->colorTable[this->selectedColor]; |
104 const ldraw::ColorTable::ColorDefinition& colordef = this->colorTable[this->selectedColor]; |
105 this->ui.selectedColorName->setText(colordef.displayName); |
105 this->ui.selectedColorName->setText(colordef.displayName); |
106 } |
106 } |
107 this->ui.selectedColorName->setStyleSheet(styleSheetForColor(ldraw::colorFace(this->selectedColor, this->colorTable))); |
107 const QColor colorFace = ldraw::colorFace(this->selectedColor, this->colorTable); |
|
108 this->ui.selectedColorName->setStyleSheet(styleSheetForColor(colorFace)); |
108 this->ui.colorIndex->setValue(this->selectedColor.index); |
109 this->ui.colorIndex->setValue(this->selectedColor.index); |
109 for (QPushButton* button : this->buttons) |
110 for (QPushButton* button : this->buttons) |
110 { |
111 { |
111 ldraw::Color buttonColor = colorFromButton(button); |
112 ldraw::Color buttonColor = colorFromButton(button); |
112 button->setChecked(buttonColor == this->selectedColor); |
113 button->setChecked(buttonColor == this->selectedColor); |