void PaletteEditorAdvanced::onChooseCentralColor() { switch(selectedPalette) { case 0: default: mapToActiveCentralRole( buttonCentral->color() ); break; case 1: mapToInactiveCentralRole( buttonCentral->color() ); break; case 2: mapToDisabledCentralRole( buttonCentral->color() ); break; } updateStyledButtons(); }
void PaletteEditorAdvanced::onChoosePixmap() { if (buttonPixmap->pixmap()) { switch(selectedPalette) { case 0: default: mapToActivePixmapRole( *buttonPixmap->pixmap() ); break; case 1: mapToInactivePixmapRole( *buttonPixmap->pixmap() ); break; case 2: mapToDisabledPixmapRole( *buttonPixmap->pixmap() ); break; } } updateStyledButtons(); }
void PaletteEditorAdvanced::paletteSelected(int p) { selectedPalette = p; if(p == 1) { // inactive groupCentral->setDisabled(checkBuildInactive->isChecked()); groupEffect->setDisabled(checkBuildInactive->isChecked()); } else if (p == 2) { // disabled groupCentral->setDisabled(checkBuildDisabled->isChecked()); groupEffect->setDisabled(checkBuildDisabled->isChecked()); } else { groupCentral->setEnabled(TRUE); groupEffect->setEnabled(TRUE); } updateStyledButtons(); }
void PaletteEditor::buildDisabledEffect() { QColorGroup cg = editPalette.disabled(); QColor light, midlight, mid, dark, shadow; QColor btn = cg.color( QColorGroup::Button ); light = btn.light(150); midlight = btn.light(115); mid = btn.dark(150); dark = btn.dark(); shadow = black; cg.setColor( QColorGroup::Light, light ); cg.setColor( QColorGroup::Midlight, midlight ); cg.setColor( QColorGroup::Mid, mid ); cg.setColor( QColorGroup::Dark, dark ); cg.setColor( QColorGroup::Shadow, shadow ); editPalette.setDisabled( cg ); setPreviewPalette( editPalette ); updateStyledButtons(); }
void PaletteEditor::setPal( const QPalette& pal ) { editPalette = pal; setPreviewPalette( pal ); updateStyledButtons(); }