PaletteEditorAdvanced::PaletteEditorAdvanced( QWidget * parent, const char * name, bool modal, WFlags f ) : PaletteEditorAdvancedBase( parent, name, modal, f ), selectedPalette(0) { editPalette = QApplication::palette(); setPreviewPalette( editPalette ); }
void PaletteEditorAdvanced::mapToDisabledEffectRole( const QColor& c ) { QColorGroup cg = editPalette.disabled(); cg.setColor( effectFromItem(comboEffect->currentItem()), c ); editPalette.setDisabled( cg ); setPreviewPalette( editPalette ); }
void PaletteEditorAdvanced::mapToInactiveEffectRole( const QColor& c ) { QColorGroup cg = editPalette.inactive(); cg.setColor( effectFromItem(comboEffect->currentItem()), c ); editPalette.setInactive( cg ); setPreviewPalette( editPalette ); }
void PaletteEditor::onTune() { bool ok; QPalette pal = PaletteEditorAdvanced::getPalette( &ok, editPalette, backgroundMode, this, "tune_palette", formWindow); if (!ok) return; editPalette = pal; setPreviewPalette( editPalette ); }
void PaletteEditorAdvanced::mapToDisabledCentralRole( const QColor& c ) { QColorGroup cg = editPalette.disabled(); cg.setColor( centralFromItem(comboCentral->currentItem()), c ); editPalette.setDisabled( cg ); buildDisabledEffect(); setPreviewPalette( editPalette ); }
void PaletteEditorAdvanced::mapToInactiveCentralRole( const QColor& c ) { QColorGroup cg = editPalette.inactive(); cg.setColor( centralFromItem(comboCentral->currentItem()), c ); editPalette.setInactive( cg ); buildInactiveEffect(); setPreviewPalette( editPalette ); }
PaletteEditor::PaletteEditor( FormWindow *fw, QWidget * parent, const char * name, bool modal, WFlags f ) : PaletteEditorBase( parent, name, modal, f ), formWindow( fw ) { connect( buttonHelp, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) ); editPalette = QApplication::palette(); setPreviewPalette( editPalette ); buttonMainColor->setColor( editPalette.active().color( QColorGroup::Button ) ); buttonMainColor2->setColor( editPalette.active().color( QColorGroup::Background ) ); }
void PaletteEditorAdvanced::buildInactive() { editPalette.setInactive( editPalette.active() ); if ( checkBuildEffect->isChecked() ) buildInactiveEffect(); else { setPreviewPalette( editPalette ); updateColorButtons(); } }
void MainWindow::buildPalette() { QPalette temp(ui->buttonMainColor->color(), ui->buttonWindowColor->color()); for (int i = 0; i < QPalette::NColorGroups; i++) temp = PaletteEditorAdvanced::buildEffect(QPalette::ColorGroup(i), temp); editPalette = temp; setPreviewPalette(editPalette); updateColorButtons(); setModified(true); }
void MainWindow::tunePalette() { bool ok; QPalette pal = PaletteEditorAdvanced::getPalette(&ok, editPalette, backgroundRole(), this); if (!ok) return; editPalette = pal; setPreviewPalette(editPalette); setModified(true); }
void PaletteEditorAdvanced::mapToInactivePixmapRole( const QPixmap& pm ) { QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem()); QColorGroup cg = editPalette.inactive(); if ( !pm.isNull() ) cg.setBrush( role, QBrush( cg.color( role ), pm ) ); else cg.setBrush( role, QBrush( cg.color( role ) ) ); editPalette.setInactive( cg ); setPreviewPalette( editPalette ); }
void PaletteEditorAdvanced::mapToActiveEffectRole( const QColor& c ) { QColorGroup cg = editPalette.active(); cg.setColor( effectFromItem(comboEffect->currentItem()), c ); editPalette.setActive( cg ); if(checkBuildInactive->isChecked()) buildInactive(); if(checkBuildDisabled->isChecked()) buildDisabled(); setPreviewPalette( editPalette ); }
QT_BEGIN_NAMESPACE PaletteEditorAdvanced::PaletteEditorAdvanced( QWidget * parent, const char * name, bool modal, Qt::WindowFlags f ) : PaletteEditorAdvancedBase( parent, name, modal, f ), selectedPalette(0) { // work around buggy ui file comboEffect->setEnabled(false); buttonEffect->setEnabled(false); onToggleBuildEffects(true); editPalette = QApplication::palette(); setPreviewPalette( editPalette ); }
void PaletteEditorAdvanced::buildActiveEffect() { QColorGroup cg = editPalette.active(); QColor btn = cg.color( QColorGroup::Button ); QPalette temp( btn, btn ); for (int i = 0; i<5; i++) cg.setColor( effectFromItem(i), temp.active().color( effectFromItem(i) ) ); editPalette.setActive( cg ); setPreviewPalette( editPalette ); updateColorButtons(); }
void PaletteEditorAdvanced::buildDisabled() { QColorGroup cg = editPalette.active(); cg.setColor( QColorGroup::ButtonText, darkGray ); cg.setColor( QColorGroup::Foreground, darkGray ); cg.setColor( QColorGroup::Text, darkGray ); cg.setColor( QColorGroup::HighlightedText, darkGray ); editPalette.setDisabled( cg ); if ( checkBuildEffect->isChecked() ) buildDisabledEffect(); else { setPreviewPalette( editPalette ); updateColorButtons(); } }
PaletteEditorAdvanced::PaletteEditorAdvanced( FormWindow *fw, QWidget * parent, const char * name, bool modal, WFlags f ) : PaletteEditorAdvancedBase( parent, name, modal, f ), formWindow( fw ), selectedPalette(0) { connect( buttonHelp, SIGNAL( clicked() ), MainWindow::self, SLOT( showDialogHelp() ) ); buttonPixmap->setEditor( StyledButton::PixmapEditor ); editPalette = QApplication::palette(); setPreviewPalette( editPalette ); buttonPixmap->setFormWindow( formWindow ); // force toggle event checkBuildEffect->setChecked(FALSE); checkBuildEffect->setChecked(TRUE); }
void PaletteEditorAdvanced::mapToActivePixmapRole( const QPixmap& pm ) { QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem()); QColorGroup cg = editPalette.active(); if ( !pm.isNull() ) cg.setBrush( role, QBrush( cg.color( role ), pm ) ); else cg.setBrush( role, QBrush( cg.color( role ) ) ); editPalette.setActive( cg ); buildActiveEffect(); if(checkBuildInactive->isChecked()) buildInactive(); if(checkBuildDisabled->isChecked()) buildDisabled(); setPreviewPalette( editPalette ); }
void PaletteEditorAdvanced::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 ); updateColorButtons(); }
void PaletteEditor::buildInactiveEffect() { QColorGroup cg = editPalette.inactive(); 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.setInactive( cg ); setPreviewPalette( editPalette ); updateStyledButtons(); }
void MainWindow::paletteSelected(int) { setPreviewPalette(editPalette); }
void PaletteEditor::setPal( const QPalette& pal ) { editPalette = pal; setPreviewPalette( pal ); updateStyledButtons(); }
void PaletteEditor::paletteSelected(int) { setPreviewPalette(editPalette); }
void PaletteEditorAdvanced::setPal( const QPalette& pal ) { editPalette = pal; setPreviewPalette( pal ); updateColorButtons(); }