tabulations.

This commit is contained in:
Hugo Pereira Da Costa 2011-07-18 07:55:17 +02:00
parent f75111622b
commit 92f9181db9
2 changed files with 109 additions and 109 deletions

View file

@ -37,113 +37,113 @@
namespace Oxygen
{
//_________________________________________________________
ConfigurationUi::ConfigurationUi( QWidget* parent ):
QWidget( parent ),
_expertMode( false )
//_________________________________________________________
ConfigurationUi::ConfigurationUi( QWidget* parent ):
QWidget( parent ),
_expertMode( false )
{
ui.setupUi( this );
ui.setupUi( this );
// basic configuration
ui.frameBorder->insertItems(0, QStringList()
<< Configuration::frameBorderName( Configuration::BorderNone, true )
<< Configuration::frameBorderName( Configuration::BorderNoSide, true )
<< Configuration::frameBorderName( Configuration::BorderTiny, true )
<< Configuration::frameBorderName( Configuration::BorderDefault, true )
<< Configuration::frameBorderName( Configuration::BorderLarge, true )
<< Configuration::frameBorderName( Configuration::BorderVeryLarge, true )
<< Configuration::frameBorderName( Configuration::BorderHuge, true )
<< Configuration::frameBorderName( Configuration::BorderVeryHuge, true )
<< Configuration::frameBorderName( Configuration::BorderOversized, true )
);
// basic configuration
ui.frameBorder->insertItems(0, QStringList()
<< Configuration::frameBorderName( Configuration::BorderNone, true )
<< Configuration::frameBorderName( Configuration::BorderNoSide, true )
<< Configuration::frameBorderName( Configuration::BorderTiny, true )
<< Configuration::frameBorderName( Configuration::BorderDefault, true )
<< Configuration::frameBorderName( Configuration::BorderLarge, true )
<< Configuration::frameBorderName( Configuration::BorderVeryLarge, true )
<< Configuration::frameBorderName( Configuration::BorderHuge, true )
<< Configuration::frameBorderName( Configuration::BorderVeryHuge, true )
<< Configuration::frameBorderName( Configuration::BorderOversized, true )
);
ui.titleAlignment->insertItems(0, QStringList()
<< Configuration::titleAlignmentName( Qt::AlignLeft, true )
<< Configuration::titleAlignmentName( Qt::AlignHCenter, true, false )
<< Configuration::titleAlignmentName( Qt::AlignHCenter, true, true )
<< Configuration::titleAlignmentName( Qt::AlignRight, true )
);
ui.titleAlignment->insertItems(0, QStringList()
<< Configuration::titleAlignmentName( Qt::AlignLeft, true )
<< Configuration::titleAlignmentName( Qt::AlignHCenter, true, false )
<< Configuration::titleAlignmentName( Qt::AlignHCenter, true, true )
<< Configuration::titleAlignmentName( Qt::AlignRight, true )
);
ui.buttonSize->insertItems(0, QStringList()
<< Configuration::buttonSizeName( Configuration::ButtonSmall, true )
<< Configuration::buttonSizeName( Configuration::ButtonDefault, true )
<< Configuration::buttonSizeName( Configuration::ButtonLarge, true )
<< Configuration::buttonSizeName( Configuration::ButtonVeryLarge, true )
<< Configuration::buttonSizeName( Configuration::ButtonHuge, true )
);
ui.buttonSize->insertItems(0, QStringList()
<< Configuration::buttonSizeName( Configuration::ButtonSmall, true )
<< Configuration::buttonSizeName( Configuration::ButtonDefault, true )
<< Configuration::buttonSizeName( Configuration::ButtonLarge, true )
<< Configuration::buttonSizeName( Configuration::ButtonVeryLarge, true )
<< Configuration::buttonSizeName( Configuration::ButtonHuge, true )
);
// advanced configuration
ui.blendColor->insertItems(0, QStringList()
<< Configuration::blendColorName( Configuration::NoBlending, true )
<< Configuration::blendColorName( Configuration::RadialBlending, true )
<< Configuration::blendColorName( Configuration::BlendFromStyle, true )
);
// advanced configuration
ui.blendColor->insertItems(0, QStringList()
<< Configuration::blendColorName( Configuration::NoBlending, true )
<< Configuration::blendColorName( Configuration::RadialBlending, true )
<< Configuration::blendColorName( Configuration::BlendFromStyle, true )
);
// draw size grip
ui.sizeGripMode->insertItems(0, QStringList()
<< Configuration::sizeGripModeName( Configuration::SizeGripNever, true )
<< Configuration::sizeGripModeName( Configuration::SizeGripWhenNeeded, true )
);
// draw size grip
ui.sizeGripMode->insertItems(0, QStringList()
<< Configuration::sizeGripModeName( Configuration::SizeGripNever, true )
<< Configuration::sizeGripModeName( Configuration::SizeGripWhenNeeded, true )
);
shadowConfigurations.push_back( ui.activeShadowConfiguration );
shadowConfigurations.push_back( ui.inactiveShadowConfiguration );
shadowConfigurations.push_back( ui.activeShadowConfiguration );
shadowConfigurations.push_back( ui.inactiveShadowConfiguration );
// connections
connect( ui.titleOutline, SIGNAL(toggled( bool )), ui.separatorMode, SLOT( setDisabled( bool ) ) );
// connections
connect( ui.titleOutline, SIGNAL(toggled( bool )), ui.separatorMode, SLOT( setDisabled( bool ) ) );
connect( shadowConfigurations[0], SIGNAL( changed() ), SIGNAL( changed() ) );
connect( shadowConfigurations[0], SIGNAL( toggled( bool ) ), SIGNAL( changed() ) );
connect( shadowConfigurations[0], SIGNAL( changed() ), SIGNAL( changed() ) );
connect( shadowConfigurations[0], SIGNAL( toggled( bool ) ), SIGNAL( changed() ) );
connect( shadowConfigurations[1], SIGNAL( changed() ), SIGNAL( changed() ) );
connect( shadowConfigurations[1], SIGNAL( toggled( bool ) ), SIGNAL( changed() ) );
connect( shadowConfigurations[1], SIGNAL( changed() ), SIGNAL( changed() ) );
connect( shadowConfigurations[1], SIGNAL( toggled( bool ) ), SIGNAL( changed() ) );
connect( ui.titleAlignment, SIGNAL(currentIndexChanged(int)), SIGNAL( changed() ) );
connect( ui.buttonSize, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()) );
connect( ui.frameBorder, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()) );
connect( ui.blendColor, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()) );
connect( ui.sizeGripMode, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()) );
connect( ui.titleAlignment, SIGNAL(currentIndexChanged(int)), SIGNAL( changed() ) );
connect( ui.buttonSize, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()) );
connect( ui.frameBorder, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()) );
connect( ui.blendColor, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()) );
connect( ui.sizeGripMode, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()) );
connect( ui.animationsEnabled, SIGNAL(clicked()), SIGNAL(changed()) );
connect( ui.narrowButtonSpacing, SIGNAL(clicked()), SIGNAL(changed()) );
connect( ui.separatorMode, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()) );
connect( ui.titleOutline, SIGNAL(clicked()), SIGNAL(changed()) );
connect( ui.exceptions, SIGNAL(changed()), SIGNAL(changed()) );
connect( ui.animationsEnabled, SIGNAL(clicked()), SIGNAL(changed()) );
connect( ui.narrowButtonSpacing, SIGNAL(clicked()), SIGNAL(changed()) );
connect( ui.separatorMode, SIGNAL(currentIndexChanged(int)), SIGNAL(changed()) );
connect( ui.titleOutline, SIGNAL(clicked()), SIGNAL(changed()) );
connect( ui.exceptions, SIGNAL(changed()), SIGNAL(changed()) );
connect( ui._expertModeButton, SIGNAL( pressed( void ) ), SLOT( toggleExpertModeInternal( void ) ) );
connect( ui._expertModeButton, SIGNAL( pressed( void ) ), SLOT( toggleExpertModeInternal( void ) ) );
ui._expertModeButton->setIcon( KIcon("configure") );
ui._expertModeButton->setIcon( KIcon("configure") );
toggleExpertModeInternal( false );
toggleExpertModeInternal( false );
}
}
//_________________________________________________________
void ConfigurationUi::toggleExpertMode( bool value )
{
ui._expertModeContainer->hide();
toggleExpertModeInternal( value );
}
//_________________________________________________________
void ConfigurationUi::toggleExpertMode( bool value )
{
ui._expertModeContainer->hide();
toggleExpertModeInternal( value );
}
//_________________________________________________________
void ConfigurationUi::toggleExpertModeInternal( bool value )
{
//_________________________________________________________
void ConfigurationUi::toggleExpertModeInternal( bool value )
{
// store value
_expertMode = value;
// store value
_expertMode = value;
// update button text
ui._expertModeButton->setText( _expertMode ? i18n( "Hide Advanced Configuration Options" ):i18n( "Show Advanced Configuration Options" ) );
// update button text
ui._expertModeButton->setText( _expertMode ? i18n( "Hide Advanced Configuration Options" ):i18n( "Show Advanced Configuration Options" ) );
ui.narrowButtonSpacing->setVisible( _expertMode );
ui.narrowButtonSpacing->setVisible( _expertMode );
// size grip mode
ui.sizeGripModeLabel->setVisible( _expertMode );
ui.sizeGripMode->setVisible( _expertMode );
// size grip mode
ui.sizeGripModeLabel->setVisible( _expertMode );
ui.sizeGripMode->setVisible( _expertMode );
if( _expertMode ) ui.shadowSpacer->changeSize(0,0, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
else ui.shadowSpacer->changeSize(0,0, QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
if( _expertMode ) ui.shadowSpacer->changeSize(0,0, QSizePolicy::MinimumExpanding, QSizePolicy::MinimumExpanding);
else ui.shadowSpacer->changeSize(0,0, QSizePolicy::MinimumExpanding, QSizePolicy::Fixed);
}
}
}

View file

@ -38,46 +38,46 @@
namespace Oxygen
{
//_____________________________________________
class ConfigurationUi: public QWidget
{
//_____________________________________________
class ConfigurationUi: public QWidget
{
Q_OBJECT
Q_OBJECT
public:
public:
//! constructor
ConfigurationUi( QWidget* );
//! constructor
ConfigurationUi( QWidget* );
//! ui
Ui_OxygenConfigurationUI ui;
//! ui
Ui_OxygenConfigurationUI ui;
//! shadow configuration
QVector<ShadowConfigurationUi*> shadowConfigurations;
//! shadow configuration
QVector<ShadowConfigurationUi*> shadowConfigurations;
//! toggle expert mode
void toggleExpertMode( bool );
//! toggle expert mode
void toggleExpertMode( bool );
protected slots:
protected slots:
//! toggle expert mode
void toggleExpertModeInternal( void )
{ toggleExpertModeInternal( !_expertMode ); }
//! toggle expert mode
void toggleExpertModeInternal( void )
{ toggleExpertModeInternal( !_expertMode ); }
//! toggle expert mode
void toggleExpertModeInternal( bool );
//! toggle expert mode
void toggleExpertModeInternal( bool );
signals:
signals:
//! emmited when changed
bool changed( void );
//! emmited when changed
bool changed( void );
private:
private:
//! expert mode
bool _expertMode;
//! expert mode
bool _expertMode;
};
};
}