| 87 | } |
| 88 | |
| 89 | void ColorPickerWidget::updateColorLabel(const QColor &color) |
| 90 | { |
| 91 | if (colorLabel == Q_NULLPTR) { |
| 92 | return; |
| 93 | } |
| 94 | |
| 95 | const QPalette widgetPalette = palette(); |
| 96 | const QColor activeColor = color.isValid() |
| 97 | ? color |
| 98 | : widgetPalette.color(QPalette::Active, QPalette::Window); |
| 99 | const QColor inactiveColor = color.isValid() |
| 100 | ? color |
| 101 | : widgetPalette.color(QPalette::Inactive, QPalette::Window); |
| 102 | const QColor disabledColor = mutedDisabledSwatchColor(color, widgetPalette); |
| 103 | |
| 104 | QPalette labelPalette = colorLabel->palette(); |
| 105 | labelPalette.setColor(QPalette::Active, colorLabel->backgroundRole(), activeColor); |
| 106 | labelPalette.setColor(QPalette::Inactive, colorLabel->backgroundRole(), inactiveColor); |
| 107 | labelPalette.setColor(QPalette::Disabled, colorLabel->backgroundRole(), disabledColor); |
| 108 | colorLabel->setPalette(labelPalette); |
| 109 | colorLabel->update(); |
| 110 | } |
| 111 | |
| 112 | #if 0 |
| 113 | void ColorPickerWidget::setUILanguage(int languageindex) |
nothing calls this directly
no test coverage detected