void PaletteEditorAdvanced::onCentral( int item ) { QColor c; switch(selectedPalette) { case 0: default: c = editPalette.active().color( centralFromItem(item) ); break; case 1: c = editPalette.inactive().color( centralFromItem(item) ); break; case 2: c = editPalette.disabled().color( centralFromItem(item) ); break; } buttonCentral->setColor(c); }
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 ); }
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 PaletteEditor::buildPalette() { int i; QColorGroup cg; QColor btn = buttonMainColor->color(); QColor back = buttonMainColor2->color(); QPalette automake( btn, back ); for (i = 0; i<9; i++) cg.setColor( centralFromItem(i), automake.active().color( centralFromItem(i) ) ); editPalette.setActive( cg ); buildActiveEffect(); cg = editPalette.inactive(); QPalette temp( editPalette.active().color( QColorGroup::Button ), editPalette.active().color( QColorGroup::Background ) ); for (i = 0; i<9; i++) cg.setColor( centralFromItem(i), temp.inactive().color( centralFromItem(i) ) ); editPalette.setInactive( cg ); buildInactiveEffect(); cg = editPalette.disabled(); for (i = 0; i<9; i++) cg.setColor( centralFromItem(i), temp.disabled().color( centralFromItem(i) ) ); editPalette.setDisabled( cg ); buildDisabledEffect(); updateStyledButtons(); }
void PaletteEditorAdvanced::updateStyledButtons() { QColor central, effect; QPixmap *pm = 0; switch (selectedPalette) { case 0: default: central = editPalette.active().color( centralFromItem( comboCentral->currentItem() ) ); effect = editPalette.active().color( effectFromItem( comboEffect->currentItem() ) ); pm = editPalette.active().brush( centralFromItem( comboCentral->currentItem() ) ).pixmap(); break; case 1: central = editPalette.inactive().color( centralFromItem( comboCentral->currentItem() ) ); effect = editPalette.inactive().color( effectFromItem( comboEffect->currentItem() ) ); pm = editPalette.inactive().brush( centralFromItem( comboCentral->currentItem() ) ).pixmap(); break; case 2: central = editPalette.disabled().color( centralFromItem( comboCentral->currentItem() ) ); effect = editPalette.disabled().color( effectFromItem( comboEffect->currentItem() ) ); pm = editPalette.disabled().brush( centralFromItem( comboCentral->currentItem() ) ).pixmap(); break; } buttonCentral->setColor(central); buttonEffect->setColor(effect); if ( pm && !pm->isNull() ) buttonPixmap->setPixmap( *pm ); else buttonPixmap->setPixmap(QPixmap()); }
void PaletteEditorAdvanced::onCentral( int item ) { QPixmap* p = 0; QColor c; switch(selectedPalette) { case 0: default: c = editPalette.active().color( centralFromItem(item) ); p = editPalette.active().brush( centralFromItem(item) ).pixmap(); break; case 1: c = editPalette.inactive().color( centralFromItem(item) ); p = editPalette.inactive().brush( centralFromItem(item) ).pixmap(); break; case 2: c = editPalette.disabled().color( centralFromItem(item) ); p = editPalette.disabled().brush( centralFromItem(item) ).pixmap(); break; } buttonCentral->setColor(c); if (p) buttonPixmap->setPixmap( *p ); else buttonPixmap->setPixmap( QPixmap() ); }
void PaletteEditorAdvanced::updateColorButtons() { QColor central, effect; switch (selectedPalette) { case 0: default: central = editPalette.active().color( centralFromItem( comboCentral->currentItem() ) ); effect = editPalette.active().color( effectFromItem( comboEffect->currentItem() ) ); break; case 1: central = editPalette.inactive().color( centralFromItem( comboCentral->currentItem() ) ); effect = editPalette.inactive().color( effectFromItem( comboEffect->currentItem() ) ); break; case 2: central = editPalette.disabled().color( centralFromItem( comboCentral->currentItem() ) ); effect = editPalette.disabled().color( effectFromItem( comboEffect->currentItem() ) ); break; } buttonCentral->setColor(central); buttonEffect->setColor(effect); }
void PaletteEditorAdvanced::mapToActiveCentralRole( const QColor& c ) { QColorGroup cg = editPalette.active(); cg.setColor( centralFromItem(comboCentral->currentItem()), c ); editPalette.setActive( cg ); buildActiveEffect(); if(checkBuildInactive->isChecked()) buildInactive(); if(checkBuildDisabled->isChecked()) buildDisabled(); setPreviewPalette( editPalette ); }
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 ); }