summaryrefslogtreecommitdiffstats
path: root/tools/qtconfig
diff options
context:
space:
mode:
authorBoris Moiseev <cyberbobs@gmail.com>2010-10-06 13:51:32 (GMT)
committerBenjamin Poulain <benjamin.poulain@nokia.com>2010-10-06 13:51:32 (GMT)
commit10c33f225c65517a481610c3373ecd16f0f6dcdf (patch)
treeb7fd61b76ca35449d5c96d9a12d79e6e617bf1c0 /tools/qtconfig
parent24ea581ffff713a591157b6ca3d4749824020a0a (diff)
downloadQt-10c33f225c65517a481610c3373ecd16f0f6dcdf.zip
Qt-10c33f225c65517a481610c3373ecd16f0f6dcdf.tar.gz
Qt-10c33f225c65517a481610c3373ecd16f0f6dcdf.tar.bz2
Refactored PaletteEditorAdvanced in qtconfig
The widget was redrawn and now makes use of QDialogButtonBox. The ColorButton's are created more correctly for now. Also, all of the Qt4 ColorRoles are now supported. All the legacy code was dropped so it must not depend of qt3support. Some refactoring job also was done and much of unused code was removed. Merge-request: 2286 Reviewed-by: Benjamin Poulain <benjamin.poulain@nokia.com>
Diffstat (limited to 'tools/qtconfig')
-rw-r--r--tools/qtconfig/mainwindow.cpp5
-rw-r--r--tools/qtconfig/paletteeditoradvanced.cpp541
-rw-r--r--tools/qtconfig/paletteeditoradvanced.h60
-rw-r--r--tools/qtconfig/paletteeditoradvanced.ui416
-rw-r--r--tools/qtconfig/paletteeditoradvancedbase.cpp144
-rw-r--r--tools/qtconfig/paletteeditoradvancedbase.h78
-rw-r--r--tools/qtconfig/paletteeditoradvancedbase.ui617
-rw-r--r--tools/qtconfig/qtconfig.pro6
8 files changed, 623 insertions, 1244 deletions
diff --git a/tools/qtconfig/mainwindow.cpp b/tools/qtconfig/mainwindow.cpp
index 9675f99..3895418 100644
--- a/tools/qtconfig/mainwindow.cpp
+++ b/tools/qtconfig/mainwindow.cpp
@@ -753,9 +753,8 @@ void MainWindow::updateColorButtons()
void MainWindow::tunePalette()
{
bool ok;
- QPalette pal = PaletteEditorAdvanced::getPalette(&ok, editPalette,
- backgroundMode(), this);
- if (! ok)
+ QPalette pal = PaletteEditorAdvanced::getPalette(&ok, editPalette, backgroundRole(), this);
+ if (!ok)
return;
editPalette = pal;
diff --git a/tools/qtconfig/paletteeditoradvanced.cpp b/tools/qtconfig/paletteeditoradvanced.cpp
index 2728557..fa108e7 100644
--- a/tools/qtconfig/paletteeditoradvanced.cpp
+++ b/tools/qtconfig/paletteeditoradvanced.cpp
@@ -42,26 +42,41 @@
#include "paletteeditoradvanced.h"
#include "colorbutton.h"
-#include <QCheckBox>
-#include <QComboBox>
-#include <QApplication>
-#include <QPushButton>
-#include <QPainter>
-#include <QGroupBox>
-
QT_BEGIN_NAMESPACE
-PaletteEditorAdvanced::PaletteEditorAdvanced( QWidget * parent,
- const char * name, bool modal, Qt::WindowFlags f )
- : PaletteEditorAdvancedBase( parent, name, modal, f ), selectedPalette(0)
+PaletteEditorAdvanced::PaletteEditorAdvanced(QWidget *parent)
+ : QDialog(parent), selectedPalette(0)
{
- // work around buggy UI file
- comboEffect->setEnabled(false);
+ setupUi(this);
+
+ // create a ColorButton's
+ buttonCentral = new ColorButton(groupCentral);
+ buttonCentral->setToolTip(tr("Choose a color"));
+ buttonCentral->setWhatsThis(tr("Choose a color for the selected central color role."));
+ layoutCentral->addWidget(buttonCentral);
+ labelCentral->setBuddy(buttonCentral);
+
+ buttonEffect = new ColorButton(groupEffect);
+ buttonEffect->setToolTip(tr("Choose a color"));
+ buttonEffect->setWhatsThis(tr("Choose a color for the selected effect color role."));
buttonEffect->setEnabled(false);
+ layoutEffect->addWidget(buttonEffect);
+ labelEffect->setBuddy(buttonEffect);
+
+ // signals and slots connections
+ connect(paletteCombo, SIGNAL(activated(int)), SLOT(paletteSelected(int)));
+ connect(comboCentral, SIGNAL(activated(int)), SLOT(onCentral(int)));
+ connect(buttonCentral, SIGNAL(clicked()), SLOT(onChooseCentralColor()));
+ connect(buttonEffect, SIGNAL(clicked()), SLOT(onChooseEffectColor()));
+ connect(comboEffect, SIGNAL(activated(int)), SLOT(onEffect(int)));
+ connect(checkBuildEffect, SIGNAL(toggled(bool)), SLOT(onToggleBuildEffects(bool)));
+ connect(checkBuildEffect, SIGNAL(toggled(bool)), buttonEffect, SLOT(setDisabled(bool)));
+ connect(checkBuildInactive, SIGNAL(toggled(bool)), SLOT(onToggleBuildInactive(bool)));
+ connect(checkBuildDisabled, SIGNAL(toggled(bool)), SLOT(onToggleBuildDisabled(bool)));
+
onToggleBuildEffects(true);
editPalette = QApplication::palette();
- setPreviewPalette( editPalette );
}
PaletteEditorAdvanced::~PaletteEditorAdvanced()
@@ -76,12 +91,12 @@ void PaletteEditorAdvanced::onToggleBuildInactive( bool v )
}
if (v) {
- buildInactive();
+ build(QPalette::Inactive);
updateColorButtons();
}
}
-void PaletteEditorAdvanced::onToggleBuildDisabled( bool v )
+void PaletteEditorAdvanced::onToggleBuildDisabled(bool v)
{
if (selectedPalette == 2) {
groupCentral->setDisabled(v);
@@ -89,7 +104,7 @@ void PaletteEditorAdvanced::onToggleBuildDisabled( bool v )
}
if (v) {
- buildDisabled();
+ build(QPalette::Disabled);
updateColorButtons();
}
}
@@ -115,385 +130,192 @@ void PaletteEditorAdvanced::paletteSelected(int p)
void PaletteEditorAdvanced::onChooseCentralColor()
{
- switch(selectedPalette) {
- case 0:
- default:
- mapToActiveCentralRole( buttonCentral->color() );
- break;
- case 1:
- mapToInactiveCentralRole( buttonCentral->color() );
- break;
- case 2:
- mapToDisabledCentralRole( buttonCentral->color() );
- break;
+ QPalette::ColorGroup group = groupFromIndex(selectedPalette);
+ editPalette.setColor(group, centralFromIndex(comboCentral->currentIndex()),
+ buttonCentral->color());
+
+ buildEffect(group);
+ if (group == QPalette::Active) {
+ if(checkBuildInactive->isChecked())
+ build(QPalette::Inactive);
+ if(checkBuildDisabled->isChecked())
+ build(QPalette::Disabled);
}
+
updateColorButtons();
}
void PaletteEditorAdvanced::onChooseEffectColor()
{
- switch(selectedPalette) {
- case 0:
- default:
- mapToActiveEffectRole( buttonEffect->color() );
- break;
- case 1:
- mapToInactiveEffectRole( buttonEffect->color() );
- break;
- case 2:
- mapToDisabledEffectRole( buttonEffect->color() );
- break;
+ QPalette::ColorGroup group = groupFromIndex(selectedPalette);
+ editPalette.setColor(group, effectFromIndex(comboEffect->currentIndex()),
+ buttonEffect->color());
+
+ if (group == QPalette::Active) {
+ if(checkBuildInactive->isChecked())
+ build(QPalette::Inactive);
+ if(checkBuildDisabled->isChecked())
+ build(QPalette::Disabled);
}
+
updateColorButtons();
}
-void PaletteEditorAdvanced::onToggleBuildEffects( bool on )
+void PaletteEditorAdvanced::onToggleBuildEffects(bool on)
{
- if (!on) return;
- buildActiveEffect();
- buildInactiveEffect();
- buildDisabledEffect();
+ if (on) {
+ for (int i = 0; i < QPalette::NColorGroups; i++)
+ buildEffect(QPalette::ColorGroup(i));
+ }
}
-QColorGroup::ColorRole PaletteEditorAdvanced::centralFromItem( int item )
+QPalette::ColorGroup PaletteEditorAdvanced::groupFromIndex(int item)
{
switch( item ) {
- case 0:
- return QColorGroup::Window;
- case 1:
- return QColorGroup::WindowText;
- case 2:
- return QColorGroup::Button;
- case 3:
- return QColorGroup::Base;
- case 4:
- return QColorGroup::Text;
- case 5:
- return QColorGroup::BrightText;
- case 6:
- return QColorGroup::ButtonText;
- case 7:
- return QColorGroup::Highlight;
- case 8:
- return QColorGroup::HighlightedText;
- default:
- return QColorGroup::NColorRoles;
+ case 0:
+ default:
+ return QPalette::Active;
+ case 1:
+ return QPalette::Inactive;
+ case 2:
+ return QPalette::Disabled;
}
}
-QColorGroup::ColorRole PaletteEditorAdvanced::effectFromItem( int item )
+
+QPalette::ColorRole PaletteEditorAdvanced::centralFromIndex(int item)
{
switch( item ) {
case 0:
- return QColorGroup::Light;
+ return QPalette::Window;
case 1:
- return QColorGroup::Midlight;
+ return QPalette::WindowText;
case 2:
- return QColorGroup::Mid;
+ return QPalette::Base;
case 3:
- return QColorGroup::Dark;
+ return QPalette::AlternateBase;
case 4:
- return QColorGroup::Shadow;
+ return QPalette::ToolTipBase;
+ case 5:
+ return QPalette::ToolTipText;
+ case 6:
+ return QPalette::Text;
+ case 7:
+ return QPalette::Button;
+ case 8:
+ return QPalette::ButtonText;
+ case 9:
+ return QPalette::BrightText;
+ case 10:
+ return QPalette::Highlight;
+ case 11:
+ return QPalette::HighlightedText;
+ case 12:
+ return QPalette::Link;
+ case 13:
+ return QPalette::LinkVisited;
default:
- return QColorGroup::NColorRoles;
+ return QPalette::NoRole;
}
}
-void PaletteEditorAdvanced::onCentral( int item )
+QPalette::ColorRole PaletteEditorAdvanced::effectFromIndex(int item)
{
- QColor c;
-
- switch(selectedPalette) {
+ switch( item ) {
case 0:
- default:
- c = editPalette.active().color( centralFromItem(item) );
- break;
+ return QPalette::Light;
case 1:
- c = editPalette.inactive().color( centralFromItem(item) );
- break;
+ return QPalette::Midlight;
case 2:
- c = editPalette.disabled().color( centralFromItem(item) );
- break;
- }
-
- buttonCentral->setColor(c);
-}
-
-void PaletteEditorAdvanced::onEffect( int item )
-{
- QColor c;
- switch(selectedPalette) {
- case 0:
+ return QPalette::Mid;
+ case 3:
+ return QPalette::Dark;
+ case 4:
+ return QPalette::Shadow;
default:
- c = editPalette.active().color( effectFromItem(item) );
- break;
- case 1:
- editPalette.inactive().color( effectFromItem(item) );
- break;
- case 2:
- editPalette.disabled().color( effectFromItem(item) );
- break;
+ return QPalette::NoRole;
}
- buttonEffect->setColor(c);
-}
-
-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::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 );
-}
-
-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::mapToInactiveCentralRole( const QColor& c )
-{
- QColorGroup cg = editPalette.inactive();
- cg.setColor( centralFromItem(comboCentral->currentItem()), c );
- editPalette.setInactive( cg );
-
- buildInactiveEffect();
-
- setPreviewPalette( editPalette );
}
-void PaletteEditorAdvanced::mapToInactiveEffectRole( const QColor& c )
+void PaletteEditorAdvanced::onCentral(int item)
{
- QColorGroup cg = editPalette.inactive();
- cg.setColor( effectFromItem(comboEffect->currentItem()), c );
- editPalette.setInactive( cg );
-
- 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 PaletteEditorAdvanced::mapToDisabledCentralRole( const QColor& c )
-{
- QColorGroup cg = editPalette.disabled();
- cg.setColor( centralFromItem(comboCentral->currentItem()), c );
- editPalette.setDisabled( cg );
-
- buildDisabledEffect();
-
- setPreviewPalette( editPalette );
-}
-
-void PaletteEditorAdvanced::mapToDisabledEffectRole( const QColor& c )
-{
- QColorGroup cg = editPalette.disabled();
- cg.setColor( effectFromItem(comboEffect->currentItem()), c );
- editPalette.setDisabled( cg );
-
- setPreviewPalette( editPalette );
+ QColor c = editPalette.color(groupFromIndex(selectedPalette), centralFromIndex(item));
+ buttonCentral->setColor(c);
}
-void PaletteEditorAdvanced::mapToDisabledPixmapRole( const QPixmap& pm )
+void PaletteEditorAdvanced::onEffect(int item)
{
- QColorGroup::ColorRole role = centralFromItem(comboCentral->currentItem());
- QColorGroup cg = editPalette.disabled();
- if ( !pm.isNull() )
- cg.setBrush( role, QBrush( cg.color( role ), pm ) );
- else
- cg.setBrush( role, QBrush( cg.color( role ) ) );
-
- editPalette.setDisabled( cg );
-
- setPreviewPalette( editPalette );
+ QColor c = editPalette.color(groupFromIndex(selectedPalette), effectFromIndex(item));
+ buttonEffect->setColor(c);
}
-void PaletteEditorAdvanced::buildActiveEffect()
+QPalette PaletteEditorAdvanced::buildEffect(QPalette::ColorGroup colorGroup,
+ const QPalette &basePalette)
{
- QColorGroup cg = editPalette.active();
- QColor btn = cg.color( QColorGroup::Button );
+ QPalette result(basePalette);
- QPalette temp( btn, btn );
+ if (colorGroup == QPalette::Active) {
+ QPalette calculatedPalette(basePalette.color(colorGroup, QPalette::Button),
+ basePalette.color(colorGroup, QPalette::Window));
- for (int i = 0; i<5; i++)
- cg.setColor( effectFromItem(i), temp.active().color( effectFromItem(i) ) );
-
- editPalette.setActive( cg );
- setPreviewPalette( editPalette );
-
- updateColorButtons();
-}
-
-void PaletteEditorAdvanced::buildInactive()
-{
- editPalette.setInactive( editPalette.active() );
- if ( checkBuildEffect->isChecked() )
- buildInactiveEffect();
+ for (int i = 0; i < 5; i++) {
+ QPalette::ColorRole effectRole = effectFromIndex(i);
+ result.setColor(colorGroup, effectRole,
+ calculatedPalette.color(colorGroup, effectRole));
+ }
+ }
else {
- setPreviewPalette( editPalette );
- updateColorButtons();
+ QColor btn = basePalette.color(colorGroup, QPalette::Button);
+
+ result.setColor(colorGroup, QPalette::Light, btn.lighter());
+ result.setColor(colorGroup, QPalette::Midlight, btn.lighter(115));
+ result.setColor(colorGroup, QPalette::Mid, btn.darker(150));
+ result.setColor(colorGroup, QPalette::Dark, btn.darker());
+ result.setColor(colorGroup, QPalette::Shadow, Qt::black);
}
+ return result;
}
-void PaletteEditorAdvanced::buildInactiveEffect()
+void PaletteEditorAdvanced::buildEffect(QPalette::ColorGroup colorGroup)
{
- 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 = Qt::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 );
+ editPalette = buildEffect(colorGroup, editPalette);
updateColorButtons();
}
-void PaletteEditorAdvanced::buildDisabled()
+void PaletteEditorAdvanced::build(QPalette::ColorGroup colorGroup)
{
- QColorGroup cg = editPalette.active();
- cg.setColor( QColorGroup::ButtonText, Qt::darkGray );
- cg.setColor( QColorGroup::WindowText, Qt::darkGray );
- cg.setColor( QColorGroup::Text, Qt::darkGray );
- cg.setColor( QColorGroup::HighlightedText, Qt::darkGray );
- editPalette.setDisabled( cg );
-
- if ( checkBuildEffect->isChecked() )
- buildDisabledEffect();
- else {
- setPreviewPalette( editPalette );
- updateColorButtons();
- }
-}
-
-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 = Qt::black;
+ if (colorGroup != QPalette::Active) {
+ for (int i = 0; i < QPalette::NColorRoles; i++)
+ editPalette.setColor(colorGroup, QPalette::ColorRole(i),
+ editPalette.color(QPalette::Active, QPalette::ColorRole(i)));
- 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 );
+ if (colorGroup == QPalette::Disabled) {
+ editPalette.setColor(colorGroup, QPalette::ButtonText, Qt::darkGray);
+ editPalette.setColor(colorGroup, QPalette::WindowText, Qt::darkGray);
+ editPalette.setColor(colorGroup, QPalette::Text, Qt::darkGray);
+ editPalette.setColor(colorGroup, QPalette::HighlightedText, Qt::darkGray);
+ }
- editPalette.setDisabled( cg );
- setPreviewPalette( editPalette );
- updateColorButtons();
-}
-
-void PaletteEditorAdvanced::setPreviewPalette( const QPalette& pal )
-{
- QColorGroup cg;
-
- switch (selectedPalette) {
- case 0:
- default:
- cg = pal.active();
- break;
- case 1:
- cg = pal.inactive();
- break;
- case 2:
- cg = pal.disabled();
- break;
+ if (checkBuildEffect->isChecked())
+ buildEffect(colorGroup);
+ else
+ updateColorButtons();
}
- previewPalette.setActive( cg );
- previewPalette.setInactive( cg );
- previewPalette.setDisabled( cg );
}
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);
+ QPalette::ColorGroup colorGroup = groupFromIndex(selectedPalette);
+ buttonCentral->setColor(editPalette.color(colorGroup,
+ centralFromIndex(comboCentral->currentIndex())));
+ buttonEffect->setColor(editPalette.color(colorGroup,
+ effectFromIndex(comboEffect->currentIndex())));
}
-void PaletteEditorAdvanced::setPal( const QPalette& pal )
+void PaletteEditorAdvanced::setPal(const QPalette &pal)
{
editPalette = pal;
- setPreviewPalette( pal );
updateColorButtons();
}
@@ -502,51 +324,51 @@ QPalette PaletteEditorAdvanced::pal() const
return editPalette;
}
-void PaletteEditorAdvanced::setupBackgroundMode( Qt::BackgroundMode mode )
+void PaletteEditorAdvanced::setupBackgroundRole(QPalette::ColorRole role)
{
int initRole = 0;
- switch( mode ) {
- case Qt::PaletteBackground:
+ switch(role) {
+ case QPalette::Window:
initRole = 0;
break;
- case Qt::PaletteForeground:
+ case QPalette::WindowText:
initRole = 1;
break;
- case Qt::PaletteButton:
+ case QPalette::Base:
initRole = 2;
break;
- case Qt::PaletteBase:
+ case QPalette::AlternateBase:
initRole = 3;
break;
- case Qt::PaletteText:
+ case QPalette::ToolTipBase:
initRole = 4;
break;
- case Qt::PaletteBrightText:
+ case QPalette::ToolTipText:
initRole = 5;
break;
- case Qt::PaletteButtonText:
+ case QPalette::Text:
initRole = 6;
break;
- case Qt::PaletteHighlight:
+ case QPalette::Button:
initRole = 7;
break;
- case Qt::PaletteHighlightedText:
+ case QPalette::ButtonText:
initRole = 8;
break;
- case Qt::PaletteLight:
+ case QPalette::BrightText:
initRole = 9;
break;
- case Qt::PaletteMidlight:
+ case QPalette::Highlight:
initRole = 10;
break;
- case Qt::PaletteDark:
+ case QPalette::HighlightedText:
initRole = 11;
break;
- case Qt::PaletteMid:
+ case QPalette::Link:
initRole = 12;
break;
- case Qt::PaletteShadow:
+ case QPalette::LinkVisited:
initRole = 13;
break;
default:
@@ -554,36 +376,27 @@ void PaletteEditorAdvanced::setupBackgroundMode( Qt::BackgroundMode mode )
break;
}
- if ( initRole <= -1 ) return;
-
- if (initRole > 8 ) {
- comboEffect->setCurrentItem( initRole - 9 );
- }
- else {
- comboCentral->setCurrentItem( initRole );
- }
+ if (initRole != -1)
+ comboCentral->setCurrentIndex(initRole);
}
-QPalette PaletteEditorAdvanced::getPalette( bool *ok, const QPalette &init,
- Qt::BackgroundMode mode, QWidget* parent,
- const char* name )
+QPalette PaletteEditorAdvanced::getPalette(bool *ok, const QPalette &init,
+ QPalette::ColorRole backgroundRole, QWidget *parent)
{
- PaletteEditorAdvanced* dlg = new PaletteEditorAdvanced( parent, name, true );
- dlg->setupBackgroundMode( mode );
+ PaletteEditorAdvanced *dlg = new PaletteEditorAdvanced(parent);
+ dlg->setupBackgroundRole(backgroundRole);
if ( init != QPalette() )
dlg->setPal( init );
int resultCode = dlg->exec();
QPalette result = init;
- if ( resultCode == QDialog::Accepted ) {
- if ( ok )
- *ok = true;
+ if (resultCode == QDialog::Accepted)
result = dlg->pal();
- } else {
- if ( ok )
- *ok = false;
- }
+
+ if (ok)
+ *ok = resultCode;
+
delete dlg;
return result;
}
diff --git a/tools/qtconfig/paletteeditoradvanced.h b/tools/qtconfig/paletteeditoradvanced.h
index a1eb8e7..f70648b 100644
--- a/tools/qtconfig/paletteeditoradvanced.h
+++ b/tools/qtconfig/paletteeditoradvanced.h
@@ -42,69 +42,59 @@
#ifndef PALETTEEDITORADVANCED_H
#define PALETTEEDITORADVANCED_H
-#include "paletteeditoradvancedbase.h"
+#include "ui_paletteeditoradvanced.h"
QT_BEGIN_NAMESPACE
-class PaletteEditorAdvanced : public PaletteEditorAdvancedBase
+class ColorButton;
+
+class PaletteEditorAdvanced : public QDialog, public Ui::PaletteEditorAdvanced
{
Q_OBJECT
public:
- PaletteEditorAdvanced( QWidget * parent=0, const char * name=0,
- bool modal=false, Qt::WindowFlags f=0 );
+ PaletteEditorAdvanced(QWidget *parent = 0);
~PaletteEditorAdvanced();
- static QPalette getPalette( bool *ok, const QPalette &pal, Qt::BackgroundMode mode = Qt::PaletteBackground,
- QWidget* parent = 0, const char* name = 0 );
+ static QPalette getPalette( bool *ok, const QPalette &pal,
+ QPalette::ColorRole backgroundRole = QPalette::Window,
+ QWidget *parent = 0 );
+
+ static QPalette buildEffect(QPalette::ColorGroup colorGroup, const QPalette &basePalette);
protected slots:
void paletteSelected(int);
- void onCentral( int );
- void onEffect( int );
+ void onCentral(int);
+ void onEffect(int);
void onChooseCentralColor();
void onChooseEffectColor();
- void onToggleBuildEffects( bool );
- void onToggleBuildInactive( bool );
- void onToggleBuildDisabled( bool );
+ void onToggleBuildEffects(bool);
+ void onToggleBuildInactive(bool);
+ void onToggleBuildDisabled(bool);
protected:
- void mapToActiveCentralRole( const QColor& );
- void mapToActiveEffectRole( const QColor& );
- void mapToActivePixmapRole( const QPixmap& );
- void mapToInactiveCentralRole( const QColor& );
- void mapToInactiveEffectRole( const QColor& );
- void mapToInactivePixmapRole( const QPixmap& );
- void mapToDisabledCentralRole( const QColor& );
- void mapToDisabledEffectRole( const QColor& );
- void mapToDisabledPixmapRole( const QPixmap& );
-
-
- void buildPalette();
- void buildActiveEffect();
- void buildInactive();
- void buildInactiveEffect();
- void buildDisabled();
- void buildDisabledEffect();
+ void buildEffect(QPalette::ColorGroup);
+ void build(QPalette::ColorGroup);
private:
- void setPreviewPalette( const QPalette& );
void updateColorButtons();
- void setupBackgroundMode( Qt::BackgroundMode );
+ void setupBackgroundRole(QPalette::ColorRole);
QPalette pal() const;
- void setPal( const QPalette& );
+ void setPal(const QPalette &);
- QColorGroup::ColorRole centralFromItem( int );
- QColorGroup::ColorRole effectFromItem( int );
+ static QPalette::ColorGroup groupFromIndex(int);
+ static QPalette::ColorRole centralFromIndex(int);
+ static QPalette::ColorRole effectFromIndex(int);
QPalette editPalette;
- QPalette previewPalette;
int selectedPalette;
+ ColorButton *buttonCentral;
+ ColorButton *buttonEffect;
};
QT_END_NAMESPACE
-#endif
+#endif // PALETTEEDITORADVANCED_H
diff --git a/tools/qtconfig/paletteeditoradvanced.ui b/tools/qtconfig/paletteeditoradvanced.ui
new file mode 100644
index 0000000..b1d6b95
--- /dev/null
+++ b/tools/qtconfig/paletteeditoradvanced.ui
@@ -0,0 +1,416 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <comment>*********************************************************************
+**
+** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
+** All rights reserved.
+** Contact: Nokia Corporation (qt-info@nokia.com)
+**
+** This file is part of the tools applications of the Qt Toolkit.
+**
+** $QT_BEGIN_LICENSE:LGPL$
+** No Commercial Usage
+** This file contains pre-release code and may not be distributed.
+** You may use this file in accordance with the terms and conditions
+** contained in the Technology Preview License Agreement accompanying
+** this package.
+**
+** GNU Lesser General Public License Usage
+** Alternatively, this file may be used under the terms of the GNU Lesser
+** General Public License version 2.1 as published by the Free Software
+** Foundation and appearing in the file LICENSE.LGPL included in the
+** packaging of this file. Please review the following information to
+** ensure the GNU Lesser General Public License version 2.1 requirements
+** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
+**
+** In addition, as a special exception, Nokia gives you certain additional
+** rights. These rights are described in the Nokia Qt LGPL Exception
+** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
+**
+** If you have questions regarding the use of this file, please contact
+** Nokia at qt-info@nokia.com.
+**
+**
+**
+**
+**
+**
+**
+**
+** $QT_END_LICENSE$
+**
+*********************************************************************</comment>
+ <class>PaletteEditorAdvanced</class>
+ <widget class="QDialog" name="PaletteEditorAdvanced">
+ <property name="geometry">
+ <rect>
+ <x>0</x>
+ <y>0</y>
+ <width>239</width>
+ <height>344</height>
+ </rect>
+ </property>
+ <property name="windowTitle">
+ <string>Tune Palette</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_4">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout">
+ <item>
+ <widget class="QLabel" name="paletteComboLabel">
+ <property name="text">
+ <string>Select &amp;Palette:</string>
+ </property>
+ <property name="buddy">
+ <cstring>paletteCombo</cstring>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="paletteCombo">
+ <item>
+ <property name="text">
+ <string>Active Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Inactive Palette</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Disabled Palette</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="autoGroupBox">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Maximum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="title">
+ <string>Auto</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout">
+ <item>
+ <widget class="QCheckBox" name="checkBuildInactive">
+ <property name="text">
+ <string>Build inactive palette from active</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QCheckBox" name="checkBuildDisabled">
+ <property name="text">
+ <string>Build disabled palette from active</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupCentral">
+ <property name="title">
+ <string>Central color &amp;roles</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_2">
+ <item>
+ <widget class="QComboBox" name="comboCentral">
+ <property name="toolTip">
+ <string>Choose central color role</string>
+ </property>
+ <property name="whatsThis">
+ <string>&lt;b&gt;Select a color role.&lt;/b&gt;&lt;p&gt;Available central roles are: &lt;ul&gt; &lt;li&gt;Window - general background color.&lt;/li&gt; &lt;li&gt;WindowText - general foreground color. &lt;/li&gt; &lt;li&gt;Base - used as background color for e.g. text entry widgets, usually white or another light color. &lt;/li&gt; &lt;li&gt;Text - the foreground color used with Base. Usually this is the same as WindowText, in what case it must provide good contrast both with Window and Base. &lt;/li&gt; &lt;li&gt;Button - general button background color, where buttons need a background different from Window, as in the Macintosh style. &lt;/li&gt; &lt;li&gt;ButtonText - a foreground color used with the Button color. &lt;/li&gt; &lt;li&gt;Highlight - a color to indicate a selected or highlighted item. &lt;/li&gt; &lt;li&gt;HighlightedText - a text color that contrasts to Highlight. &lt;/li&gt; &lt;li&gt;BrightText - a text color that is very different from WindowText and contrasts well with e.g. black. &lt;/li&gt; &lt;/ul&gt; &lt;/p&gt;</string>
+ </property>
+ <item>
+ <property name="text">
+ <string>Window</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>WindowText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Base</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>AlternateBase</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ToolTipBase</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ToolTipText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Text</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Button</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>ButtonText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>BrightText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Highlight</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>HighlightedText</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Link</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>LinkVisited</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="layoutCentral">
+ <item>
+ <spacer name="horizontalSpacer">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelCentral">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>&amp;Select Color:</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QGroupBox" name="groupEffect">
+ <property name="title">
+ <string>3-D shadow &amp;effects</string>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_3">
+ <item>
+ <layout class="QHBoxLayout" name="horizontalLayout_2">
+ <item>
+ <widget class="QCheckBox" name="checkBuildEffect">
+ <property name="toolTip">
+ <string>Generate shadings</string>
+ </property>
+ <property name="whatsThis">
+ <string>Check to let 3D-effect colors be calculated from button-color.</string>
+ </property>
+ <property name="text">
+ <string>Build &amp;from button color</string>
+ </property>
+ <property name="checked">
+ <bool>true</bool>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QComboBox" name="comboEffect">
+ <property name="enabled">
+ <bool>false</bool>
+ </property>
+ <property name="toolTip">
+ <string>Choose 3D-effect color role</string>
+ </property>
+ <property name="whatsThis">
+ <string>&lt;b&gt;Select a color role.&lt;/b&gt;&lt;p&gt;Available effect roles are: &lt;ul&gt; &lt;li&gt;Light - lighter than Button color. &lt;/li&gt; &lt;li&gt;Midlight - between Button and Light. &lt;/li&gt; &lt;li&gt;Mid - between Button and Dark. &lt;/li&gt; &lt;li&gt;Dark - darker than Button. &lt;/li&gt; &lt;li&gt;Shadow - a very dark color. &lt;/li&gt; &lt;/ul&gt;</string>
+ </property>
+ <item>
+ <property name="text">
+ <string>Light</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Midlight</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Mid</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Dark</string>
+ </property>
+ </item>
+ <item>
+ <property name="text">
+ <string>Shadow</string>
+ </property>
+ </item>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ <item>
+ <layout class="QHBoxLayout" name="layoutEffect">
+ <item>
+ <spacer name="horizontalSpacer_2">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="sizeHint" stdset="0">
+ <size>
+ <width>40</width>
+ <height>20</height>
+ </size>
+ </property>
+ </spacer>
+ </item>
+ <item>
+ <widget class="QLabel" name="labelEffect">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Minimum" vsizetype="Minimum">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="minimumSize">
+ <size>
+ <width>0</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="text">
+ <string>Select Co&amp;lor:</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
+ <widget class="QDialogButtonBox" name="buttonBox">
+ <property name="orientation">
+ <enum>Qt::Horizontal</enum>
+ </property>
+ <property name="standardButtons">
+ <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <resources/>
+ <connections>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>accepted()</signal>
+ <receiver>PaletteEditorAdvanced</receiver>
+ <slot>accept()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>238</x>
+ <y>384</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>157</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>buttonBox</sender>
+ <signal>rejected()</signal>
+ <receiver>PaletteEditorAdvanced</receiver>
+ <slot>reject()</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>306</x>
+ <y>390</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>286</x>
+ <y>274</y>
+ </hint>
+ </hints>
+ </connection>
+ <connection>
+ <sender>checkBuildEffect</sender>
+ <signal>toggled(bool)</signal>
+ <receiver>comboEffect</receiver>
+ <slot>setDisabled(bool)</slot>
+ <hints>
+ <hint type="sourcelabel">
+ <x>82</x>
+ <y>262</y>
+ </hint>
+ <hint type="destinationlabel">
+ <x>190</x>
+ <y>262</y>
+ </hint>
+ </hints>
+ </connection>
+ </connections>
+</ui>
diff --git a/tools/qtconfig/paletteeditoradvancedbase.cpp b/tools/qtconfig/paletteeditoradvancedbase.cpp
deleted file mode 100644
index 708c834..0000000
--- a/tools/qtconfig/paletteeditoradvancedbase.cpp
+++ /dev/null
@@ -1,144 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#include "paletteeditoradvancedbase.h"
-#include "colorbutton.h"
-
-#include <QVariant>
-
-QT_BEGIN_NAMESPACE
-
-/*
- * Constructs a PaletteEditorAdvancedBase as a child of 'parent', with the
- * name 'name' and widget flags set to 'f'.
- *
- * The dialog will by default be modeless, unless you set 'modal' to
- * true to construct a modal dialog.
- */
-PaletteEditorAdvancedBase::PaletteEditorAdvancedBase(QWidget* parent, const char* name, bool modal, Qt::WindowFlags fl)
- : QDialog(parent, name, modal, fl)
-{
- setupUi(this);
-
-
- // signals and slots connections
- connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
- connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
- connect(paletteCombo, SIGNAL(activated(int)), this, SLOT(paletteSelected(int)));
- connect(comboCentral, SIGNAL(activated(int)), this, SLOT(onCentral(int)));
- connect(buttonCentral, SIGNAL(clicked()), this, SLOT(onChooseCentralColor()));
- connect(buttonEffect, SIGNAL(clicked()), this, SLOT(onChooseEffectColor()));
- connect(comboEffect, SIGNAL(activated(int)), this, SLOT(onEffect(int)));
- connect(checkBuildEffect, SIGNAL(toggled(bool)), this, SLOT(onToggleBuildEffects(bool)));
- connect(checkBuildEffect, SIGNAL(toggled(bool)), comboEffect, SLOT(setDisabled(bool)));
- connect(checkBuildEffect, SIGNAL(toggled(bool)), buttonEffect, SLOT(setDisabled(bool)));
- connect(checkBuildInactive, SIGNAL(toggled(bool)), this, SLOT(onToggleBuildInactive(bool)));
- connect(checkBuildDisabled, SIGNAL(toggled(bool)), this, SLOT(onToggleBuildDisabled(bool)));
- init();
-}
-
-/*
- * Destroys the object and frees any allocated resources
- */
-PaletteEditorAdvancedBase::~PaletteEditorAdvancedBase()
-{
- destroy();
- // no need to delete child widgets, Qt does it all for us
-}
-
-/*
- * Sets the strings of the subwidgets using the current
- * language.
- */
-void PaletteEditorAdvancedBase::languageChange()
-{
- retranslateUi(this);
-}
-
-void PaletteEditorAdvancedBase::init()
-{
-}
-
-void PaletteEditorAdvancedBase::destroy()
-{
-}
-
-void PaletteEditorAdvancedBase::onCentral(int)
-{
- qWarning("PaletteEditorAdvancedBase::onCentral(int): Not implemented yet");
-}
-
-void PaletteEditorAdvancedBase::onChooseCentralColor()
-{
- qWarning("PaletteEditorAdvancedBase::onChooseCentralColor(): Not implemented yet");
-}
-
-void PaletteEditorAdvancedBase::onChooseEffectColor()
-{
- qWarning("PaletteEditorAdvancedBase::onChooseEffectColor(): Not implemented yet");
-}
-
-void PaletteEditorAdvancedBase::onEffect(int)
-{
- qWarning("PaletteEditorAdvancedBase::onEffect(int): Not implemented yet");
-}
-
-void PaletteEditorAdvancedBase::onToggleBuildDisabled(bool)
-{
- qWarning("PaletteEditorAdvancedBase::onToggleBuildDisabled(bool): Not implemented yet");
-}
-
-void PaletteEditorAdvancedBase::onToggleBuildEffects(bool)
-{
- qWarning("PaletteEditorAdvancedBase::onToggleBuildEffects(bool): Not implemented yet");
-}
-
-void PaletteEditorAdvancedBase::onToggleBuildInactive(bool)
-{
- qWarning("PaletteEditorAdvancedBase::onToggleBuildInactive(bool): Not implemented yet");
-}
-
-void PaletteEditorAdvancedBase::paletteSelected(int)
-{
- qWarning("PaletteEditorAdvancedBase::paletteSelected(int): Not implemented yet");
-}
-
-QT_END_NAMESPACE
diff --git a/tools/qtconfig/paletteeditoradvancedbase.h b/tools/qtconfig/paletteeditoradvancedbase.h
deleted file mode 100644
index ee14a26..0000000
--- a/tools/qtconfig/paletteeditoradvancedbase.h
+++ /dev/null
@@ -1,78 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-
-#ifndef PALETTEEDITORADVANCEDBASE_H
-#define PALETTEEDITORADVANCEDBASE_H
-
-#include "ui_paletteeditoradvancedbase.h"
-#include <QVariant>
-
-QT_BEGIN_NAMESPACE
-
-class ColorButton;
-
-class PaletteEditorAdvancedBase : public QDialog, public Ui::PaletteEditorAdvancedBase
-{
- Q_OBJECT
-
-public:
- PaletteEditorAdvancedBase(QWidget* parent = 0, const char* name = 0, bool modal = false, Qt::WindowFlags fl = 0);
- ~PaletteEditorAdvancedBase();
-
-protected slots:
- virtual void languageChange();
-
- virtual void init();
- virtual void destroy();
- virtual void onCentral(int);
- virtual void onChooseCentralColor();
- virtual void onChooseEffectColor();
- virtual void onEffect(int);
- virtual void onToggleBuildDisabled(bool);
- virtual void onToggleBuildEffects(bool);
- virtual void onToggleBuildInactive(bool);
- virtual void paletteSelected(int);
-
-};
-
-QT_END_NAMESPACE
-
-#endif // PALETTEEDITORADVANCEDBASE_H
diff --git a/tools/qtconfig/paletteeditoradvancedbase.ui b/tools/qtconfig/paletteeditoradvancedbase.ui
deleted file mode 100644
index 12c5a7d..0000000
--- a/tools/qtconfig/paletteeditoradvancedbase.ui
+++ /dev/null
@@ -1,617 +0,0 @@
-<ui version="4.0" stdsetdef="1" >
- <author></author>
- <comment>*********************************************************************
-**
-** Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies).
-** All rights reserved.
-** Contact: Nokia Corporation (qt-info@nokia.com)
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:LGPL$
-** No Commercial Usage
-** This file contains pre-release code and may not be distributed.
-** You may use this file in accordance with the terms and conditions
-** contained in the Technology Preview License Agreement accompanying
-** this package.
-**
-** GNU Lesser General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU Lesser
-** General Public License version 2.1 as published by the Free Software
-** Foundation and appearing in the file LICENSE.LGPL included in the
-** packaging of this file. Please review the following information to
-** ensure the GNU Lesser General Public License version 2.1 requirements
-** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
-**
-** In addition, as a special exception, Nokia gives you certain additional
-** rights. These rights are described in the Nokia Qt LGPL Exception
-** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
-**
-** If you have questions regarding the use of this file, please contact
-** Nokia at qt-info@nokia.com.
-**
-**
-**
-**
-**
-**
-**
-**
-** $QT_END_LICENSE$
-**
-*********************************************************************</comment>
- <exportmacro></exportmacro>
- <class>PaletteEditorAdvancedBase</class>
- <widget class="QDialog" name="PaletteEditorAdvancedBase" >
- <property name="objectName" >
- <string notr="true" >PaletteEditorAdvancedBase</string>
- </property>
- <property name="enabled" >
- <bool>true</bool>
- </property>
- <property name="geometry" >
- <rect>
- <x>0</x>
- <y>0</y>
- <width>295</width>
- <height>346</height>
- </rect>
- </property>
- <property name="windowTitle" >
- <string>Tune Palette</string>
- </property>
- <property name="sizeGripEnabled" >
- <bool>true</bool>
- </property>
- <property name="whatsThis" stdset="0" >
- <string>&lt;b>Edit Palette&lt;/b>&lt;p>Change the palette of the current widget or form.&lt;/p>&lt;p>Use a generated palette or select colors for each color group and each color role.&lt;/p>&lt;p>The palette can be tested with different widget layouts in the preview section.&lt;/p></string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>11</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <layout class="QHBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QLabel" name="TextLabel1" >
- <property name="objectName" >
- <string notr="true" >TextLabel1</string>
- </property>
- <property name="text" >
- <string>Select &amp;Palette:</string>
- </property>
- <property name="buddy" stdset="0" >
- <cstring>paletteCombo</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="paletteCombo" >
- <property name="objectName" >
- <string notr="true" >paletteCombo</string>
- </property>
- <item>
- <property name="text" >
- <string>Active Palette</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Inactive Palette</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Disabled Palette</string>
- </property>
- </item>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <widget class="Q3ButtonGroup" name="ButtonGroup1" >
- <property name="objectName" >
- <string notr="true" >ButtonGroup1</string>
- </property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>5</hsizetype>
- <vsizetype>4</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="title" >
- <string>Auto</string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>11</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QCheckBox" name="checkBuildInactive" >
- <property name="objectName" >
- <string notr="true" >checkBuildInactive</string>
- </property>
- <property name="text" >
- <string>Build inactive palette from active</string>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QCheckBox" name="checkBuildDisabled" >
- <property name="objectName" >
- <string notr="true" >checkBuildDisabled</string>
- </property>
- <property name="text" >
- <string>Build disabled palette from active</string>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- </widget>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="Q3GroupBox" name="groupCentral" >
- <property name="objectName" >
- <string notr="true" >groupCentral</string>
- </property>
- <property name="title" >
- <string>Central color &amp;roles</string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>11</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QComboBox" name="comboCentral" >
- <property name="objectName" >
- <string notr="true" >comboCentral</string>
- </property>
- <property name="toolTip" stdset="0" >
- <string>Choose central color role</string>
- </property>
- <property name="whatsThis" stdset="0" >
- <string>&lt;b>Select a color role.&lt;/b>&lt;p>Available central roles are: &lt;ul> &lt;li>Window - general background color.&lt;/li> &lt;li>WindowText - general foreground color. &lt;/li> &lt;li>Base - used as background color for e.g. text entry widgets, usually white or another light color. &lt;/li> &lt;li>Text - the foreground color used with Base. Usually this is the same as WindowText, in what case it must provide good contrast both with Window and Base. &lt;/li> &lt;li>Button - general button background color, where buttons need a background different from Window, as in the Macintosh style. &lt;/li> &lt;li>ButtonText - a foreground color used with the Button color. &lt;/li> &lt;li>Highlight - a color to indicate a selected or highlighted item. &lt;/li> &lt;li>HighlightedText - a text color that contrasts to Highlight. &lt;/li> &lt;li>BrightText - a text color that is very different from WindowText and contrasts well with e.g. black. &lt;/li> &lt;/ul> &lt;/p></string>
- </property>
- <item>
- <property name="text" >
- <string>Window</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>WindowText</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Button</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Base</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Text</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>BrightText</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>ButtonText</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Highlight</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>HighlightedText</string>
- </property>
- </item>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <spacer name="Horizontal_Spacing1" >
- <property name="sizeHint" >
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- <property name="sizeType" >
- <enum>Expanding</enum>
- </property>
- <property name="orientation" >
- <enum>Horizontal</enum>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QLabel" name="labelCentral" >
- <property name="objectName" >
- <string notr="true" >labelCentral</string>
- </property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>1</hsizetype>
- <vsizetype>1</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize" >
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="text" >
- <string>&amp;Select Color:</string>
- </property>
- <property name="buddy" stdset="0" >
- <cstring>buttonCentral</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="ColorButton" name="buttonCentral" >
- <property name="objectName" >
- <string notr="true" >buttonCentral</string>
- </property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="focusPolicy" >
- <enum>Qt::TabFocus</enum>
- </property>
- <property name="toolTip" stdset="0" >
- <string>Choose a color</string>
- </property>
- <property name="whatsThis" stdset="0" >
- <string>Choose a color for the selected central color role.</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <widget class="Q3GroupBox" name="groupEffect" >
- <property name="objectName" >
- <string notr="true" >groupEffect</string>
- </property>
- <property name="title" >
- <string>3-D shadow &amp;effects</string>
- </property>
- <layout class="QVBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>11</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <layout class="QHBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <widget class="QCheckBox" name="checkBuildEffect" >
- <property name="objectName" >
- <string notr="true" >checkBuildEffect</string>
- </property>
- <property name="text" >
- <string>Build &amp;from button color</string>
- </property>
- <property name="checked" >
- <bool>true</bool>
- </property>
- <property name="toolTip" stdset="0" >
- <string>Generate shadings</string>
- </property>
- <property name="whatsThis" stdset="0" >
- <string>Check to let 3D-effect colors be calculated from button-color.</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QComboBox" name="comboEffect" >
- <property name="objectName" >
- <string notr="true" >comboEffect</string>
- </property>
- <property name="toolTip" stdset="0" >
- <string>Choose 3D-effect color role</string>
- </property>
- <property name="whatsThis" stdset="0" >
- <string>&lt;b>Select a color role.&lt;/b>&lt;p>Available effect roles are: &lt;ul> &lt;li>Light - lighter than Button color. &lt;/li> &lt;li>Midlight - between Button and Light. &lt;/li> &lt;li>Mid - between Button and Dark. &lt;/li> &lt;li>Dark - darker than Button. &lt;/li> &lt;li>Shadow - a very dark color. &lt;/li> &lt;/ul></string>
- </property>
- <item>
- <property name="text" >
- <string>Light</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Midlight</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Mid</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Dark</string>
- </property>
- </item>
- <item>
- <property name="text" >
- <string>Shadow</string>
- </property>
- </item>
- </widget>
- </item>
- </layout>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <spacer name="Horizontal_Spacing3" >
- <property name="sizeHint" >
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- <property name="sizeType" >
- <enum>Expanding</enum>
- </property>
- <property name="orientation" >
- <enum>Horizontal</enum>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QLabel" name="labelEffect" >
- <property name="objectName" >
- <string notr="true" >labelEffect</string>
- </property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>1</hsizetype>
- <vsizetype>1</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="minimumSize" >
- <size>
- <width>0</width>
- <height>0</height>
- </size>
- </property>
- <property name="text" >
- <string>Select Co&amp;lor:</string>
- </property>
- <property name="buddy" stdset="0" >
- <cstring>buttonEffect</cstring>
- </property>
- </widget>
- </item>
- <item>
- <widget class="ColorButton" name="buttonEffect" >
- <property name="objectName" >
- <string notr="true" >buttonEffect</string>
- </property>
- <property name="sizePolicy" >
- <sizepolicy>
- <hsizetype>0</hsizetype>
- <vsizetype>0</vsizetype>
- <horstretch>0</horstretch>
- <verstretch>0</verstretch>
- </sizepolicy>
- </property>
- <property name="focusPolicy" >
- <enum>Qt::TabFocus</enum>
- </property>
- <property name="toolTip" stdset="0" >
- <string>Choose a color</string>
- </property>
- <property name="whatsThis" stdset="0" >
- <string>Choose a color for the selected effect color role.</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- </item>
- <item>
- <layout class="QHBoxLayout" >
- <property name="objectName" >
- <string notr="true" >unnamed</string>
- </property>
- <property name="margin" >
- <number>0</number>
- </property>
- <property name="spacing" >
- <number>6</number>
- </property>
- <item>
- <spacer name="Horizontal_Spacing2" >
- <property name="sizeHint" >
- <size>
- <width>20</width>
- <height>20</height>
- </size>
- </property>
- <property name="sizeType" >
- <enum>Expanding</enum>
- </property>
- <property name="orientation" >
- <enum>Horizontal</enum>
- </property>
- </spacer>
- </item>
- <item>
- <widget class="QPushButton" name="buttonOk" >
- <property name="objectName" >
- <string notr="true" >buttonOk</string>
- </property>
- <property name="text" >
- <string>OK</string>
- </property>
- <property name="autoDefault" >
- <bool>true</bool>
- </property>
- <property name="default" >
- <bool>true</bool>
- </property>
- <property name="whatsThis" stdset="0" >
- <string>Close dialog and apply all changes.</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QPushButton" name="buttonCancel" >
- <property name="objectName" >
- <string notr="true" >buttonCancel</string>
- </property>
- <property name="text" >
- <string>Cancel</string>
- </property>
- <property name="autoDefault" >
- <bool>true</bool>
- </property>
- <property name="whatsThis" stdset="0" >
- <string>Close dialog and discard all changes.</string>
- </property>
- </widget>
- </item>
- </layout>
- </item>
- </layout>
- </widget>
- <pixmapfunction></pixmapfunction>
- <customwidgets>
- <customwidget>
- <class>ColorButton</class>
- <extends></extends>
- <header location="local" >colorbutton.h</header>
- <sizehint>
- <width>40</width>
- <height>25</height>
- </sizehint>
- <container>0</container>
- <sizepolicy>
- <hordata>5</hordata>
- <verdata>5</verdata>
- </sizepolicy>
- <pixmap>image0</pixmap>
- <properties>
- <property type="Color" >color</property>
- <property type="Pixmap" >pixmap</property>
- </properties>
- </customwidget>
- </customwidgets>
- <tabstops>
- <tabstop>buttonOk</tabstop>
- <tabstop>buttonCancel</tabstop>
- <tabstop>paletteCombo</tabstop>
- <tabstop>checkBuildInactive</tabstop>
- <tabstop>checkBuildDisabled</tabstop>
- <tabstop>comboCentral</tabstop>
- <tabstop>buttonCentral</tabstop>
- <tabstop>checkBuildEffect</tabstop>
- <tabstop>comboEffect</tabstop>
- <tabstop>buttonEffect</tabstop>
- </tabstops>
- <images>
- <image name="image0" >
- <data format="XPM.GZ" length="646" >789c6dd2c10ac2300c00d07bbf2234b7229d1be245fc04c5a3201e4615f430059d0711ff5ddb2e6bb236ec90eed134cb5a19d8ef36602af5ecdbfeeac05dda0798d3abebde87e3faa374d3807fa0d633a52d38d8de6f679fe33fc776e196f53cd010188256a3600a292882096246517815ca99884606e18044a3a40d91824820924265a7923a2e8bcd05f33db1173e002913175f2a6be6d3294871a2d95fa00e8a94ee017b69d339d90df1e77c57ea072ede6758</data>
- </image>
- </images>
-</ui>
diff --git a/tools/qtconfig/qtconfig.pro b/tools/qtconfig/qtconfig.pro
index b0f2563..f4ddebe 100644
--- a/tools/qtconfig/qtconfig.pro
+++ b/tools/qtconfig/qtconfig.pro
@@ -14,11 +14,11 @@ contains(QT_CONFIG, phonon) {
DEFINES += HAVE_PHONON
}
SOURCES += colorbutton.cpp main.cpp previewframe.cpp previewwidget.cpp mainwindow.cpp paletteeditoradvanced.cpp \
- mainwindowbase.cpp paletteeditoradvancedbase.cpp
+ mainwindowbase.cpp
HEADERS += colorbutton.h previewframe.h previewwidget.h mainwindow.h paletteeditoradvanced.h \
- mainwindowbase.h paletteeditoradvancedbase.h
+ mainwindowbase.h
-FORMS = mainwindowbase.ui paletteeditoradvancedbase.ui previewwidget.ui
+FORMS = mainwindowbase.ui paletteeditoradvanced.ui previewwidget.ui
RESOURCES = qtconfig.qrc
PROJECTNAME = Qt Configuration