void PaletteEditorAdvanced::updateColorButtons() { QPalette::ColorGroup colorGroup = groupFromIndex(selectedPalette); buttonCentral->setColor(editPalette.color(colorGroup, centralFromIndex(ui->comboCentral->currentIndex()))); buttonEffect->setColor(editPalette.color(colorGroup, effectFromIndex(ui->comboEffect->currentIndex()))); }
void MainWindow::setPreviewPalette(const QPalette &pal) { QPalette::ColorGroup colorGroup = groupFromIndex(ui->paletteCombo->currentIndex()); for (int i = 0; i < QPalette::NColorGroups; i++) { for (int j = 0; j < QPalette::NColorRoles; j++) { QPalette::ColorGroup targetGroup = QPalette::ColorGroup(i); QPalette::ColorRole targetRole = QPalette::ColorRole(j); previewPalette.setColor(targetGroup, targetRole, pal.color(colorGroup, targetRole)); } } ui->previewFrame->setPreviewPalette(previewPalette); }
void PaletteEditorAdvanced::onChooseEffectColor() { QPalette::ColorGroup group = groupFromIndex(selectedPalette); editPalette.setColor(group, effectFromIndex(ui->comboEffect->currentIndex()), buttonEffect->color()); if (group == QPalette::Active) { if(ui->checkBuildInactive->isChecked()) build(QPalette::Inactive); if(ui->checkBuildDisabled->isChecked()) build(QPalette::Disabled); } updateColorButtons(); }
void PaletteEditorAdvanced::onEffect(int item) { QColor c = editPalette.color(groupFromIndex(selectedPalette), effectFromIndex(item)); buttonEffect->setColor(c); }
void PaletteEditorAdvanced::onCentral(int item) { QColor c = editPalette.color(groupFromIndex(selectedPalette), centralFromIndex(item)); buttonCentral->setColor(c); }