use UI file for shadowConfiguration
svn path=/trunk/KDE/kdebase/workspace/; revision=1042919
This commit is contained in:
parent
326407d993
commit
5d2b90f5d4
5 changed files with 117 additions and 101 deletions
|
@ -19,6 +19,7 @@ set(kwin_oxygen_config_PART_SRCS
|
|||
kde4_add_ui_files(kwin_oxygen_config_PART_SRCS
|
||||
oxygendetectwidget.ui
|
||||
oxygenexceptiondialog.ui
|
||||
oxygenshadowconfigurationui.ui
|
||||
)
|
||||
|
||||
kde4_add_plugin(kwin_oxygen_config ${kwin_oxygen_config_PART_SRCS})
|
||||
|
|
|
@ -151,12 +151,11 @@ namespace Oxygen
|
|||
|
||||
// save shadow configuration
|
||||
KConfigGroup configurationGroup( configuration_, ( (colorGroup == QPalette::Active) ? "ActiveShadow":"InactiveShadow" ) );
|
||||
configurationGroup.writeEntry( OxygenConfig::SHADOW_SIZE, ui.shadowSize->value() );
|
||||
configurationGroup.writeEntry( OxygenConfig::SHADOW_HOFFSET, 0.1*ui.horizontalOffset->value() );
|
||||
configurationGroup.writeEntry( OxygenConfig::SHADOW_VOFFSET, 0.1*ui.verticalOffset->value() );
|
||||
configurationGroup.writeEntry( OxygenConfig::SHADOW_INNER_COLOR, ui.innerColor->color() );
|
||||
configurationGroup.writeEntry( OxygenConfig::SHADOW_OUTER_COLOR, ui.outerColor->color() );
|
||||
configurationGroup.writeEntry( OxygenConfig::SHADOW_USE_OUTER_COLOR, ui.useOuterColor->isChecked() );
|
||||
configurationGroup.writeEntry( OxygenConfig::SHADOW_SIZE, ui.ui.shadowSize->value() );
|
||||
configurationGroup.writeEntry( OxygenConfig::SHADOW_VOFFSET, 0.1*ui.ui.verticalOffset->value() );
|
||||
configurationGroup.writeEntry( OxygenConfig::SHADOW_INNER_COLOR, ui.ui.innerColor->color() );
|
||||
configurationGroup.writeEntry( OxygenConfig::SHADOW_OUTER_COLOR, ui.ui.outerColor->color() );
|
||||
configurationGroup.writeEntry( OxygenConfig::SHADOW_USE_OUTER_COLOR, ui.ui.useOuterColor->isChecked() );
|
||||
|
||||
}
|
||||
|
||||
|
@ -200,12 +199,11 @@ namespace Oxygen
|
|||
{
|
||||
assert( colorGroup == QPalette::Active || colorGroup == QPalette::Inactive );
|
||||
OxygenShadowConfigurationUI* ui = userInterface_->shadowConfigurations[ (colorGroup == QPalette::Active) ? 0:1 ];
|
||||
ui->shadowSize->setValue( configuration.shadowSize() );
|
||||
ui->horizontalOffset->setValue( 10*configuration.horizontalOffset() );
|
||||
ui->verticalOffset->setValue( 10*configuration.verticalOffset() );
|
||||
ui->innerColor->setColor( configuration.innerColor() );
|
||||
ui->outerColor->setColor( configuration.outerColor() );
|
||||
ui->useOuterColor->setChecked( configuration.useOuterColor() );
|
||||
ui->ui.shadowSize->setValue( configuration.shadowSize() );
|
||||
ui->ui.verticalOffset->setValue( 10*configuration.verticalOffset() );
|
||||
ui->ui.innerColor->setColor( configuration.innerColor() );
|
||||
ui->ui.outerColor->setColor( configuration.outerColor() );
|
||||
ui->ui.useOuterColor->setChecked( configuration.useOuterColor() );
|
||||
}
|
||||
//_______________________________________________________________________
|
||||
void Config::aboutOxygen( void )
|
||||
|
|
|
@ -34,74 +34,23 @@ namespace Oxygen
|
|||
|
||||
//_________________________________________________________
|
||||
OxygenShadowConfigurationUI::OxygenShadowConfigurationUI( const QString& name, QWidget* parent ):
|
||||
QGroupBox( name, parent ),
|
||||
shadowSize(0),
|
||||
horizontalOffset(0),
|
||||
verticalOffset(0),
|
||||
innerColor(0),
|
||||
outerColor(0)
|
||||
{ setupUI(); }
|
||||
|
||||
//_________________________________________________________
|
||||
void OxygenShadowConfigurationUI::setupUI( void )
|
||||
QGroupBox( name, parent )
|
||||
{
|
||||
ui.setupUi( this );
|
||||
ui.label->setBuddy( ui.shadowSize );
|
||||
ui.label_2->setBuddy( ui.verticalOffset );
|
||||
ui.label_3->setBuddy( ui.innerColor );
|
||||
ui.label_4->setBuddy( ui.outerColor );
|
||||
|
||||
QGridLayout* mainLayout = new QGridLayout();
|
||||
setLayout( mainLayout );
|
||||
|
||||
// shadow size
|
||||
QLabel* label;
|
||||
mainLayout->addWidget( label = new QLabel( i18n( "Size:" ), this ), 0, 0, 1, 1 );
|
||||
mainLayout->addWidget( shadowSize = new KIntSpinBox( 0, 50, 1, 1, this ), 0, 1, 1, 1 );
|
||||
shadowSize->setObjectName(QString::fromUtf8("shadowSize"));
|
||||
label->setAlignment( Qt::AlignRight|Qt::AlignVCenter );
|
||||
label->setBuddy( shadowSize );
|
||||
|
||||
// horizontal offset
|
||||
// horizontal offset is foreseen in the configuration but is hidden for now
|
||||
// it might be removed in future releases
|
||||
//mainLayout->addWidget( label = new QLabel( i18n( "Horizontal Offset:" ), this ), 1, 0, 1, 1 );
|
||||
mainLayout->addWidget( horizontalOffset = new KIntSpinBox( -50, 50, 1, 1, this ), 1, 1, 1, 1 );
|
||||
horizontalOffset->setObjectName(QString::fromUtf8("horizontalOffset"));
|
||||
//label->setAlignment( Qt::AlignRight|Qt::AlignVCenter );
|
||||
//label->setBuddy( horizontalOffset );
|
||||
horizontalOffset->hide();
|
||||
|
||||
// vertical offset
|
||||
mainLayout->addWidget( label = new QLabel( i18n( "Vertical Offset:" ), this ), 2, 0, 1, 1 );
|
||||
mainLayout->addWidget( verticalOffset = new KIntSpinBox( -50, 50, 1, 1, this ), 2, 1, 1, 1 );
|
||||
verticalOffset->setObjectName(QString::fromUtf8("verticalOffset"));
|
||||
label->setAlignment( Qt::AlignRight|Qt::AlignVCenter );
|
||||
label->setBuddy( verticalOffset );
|
||||
|
||||
// first color
|
||||
mainLayout->addWidget( label = new QLabel( i18n( "Inner Color:" ), this ), 3, 0, 1, 1 );
|
||||
mainLayout->addWidget( innerColor = new KColorButton( Qt::white, this ), 3, 1, 1, 1 );
|
||||
innerColor->setObjectName(QString::fromUtf8( "innerColor"));
|
||||
label->setAlignment( Qt::AlignRight|Qt::AlignVCenter );
|
||||
label->setBuddy( innerColor );
|
||||
|
||||
// second color
|
||||
mainLayout->addWidget( label = new QLabel( i18n( "Outer Color:" ), this ), 4, 0, 1, 1 );
|
||||
mainLayout->addWidget( outerColor = new KColorButton( Qt::black, this ), 4, 1, 1, 1 );
|
||||
outerColor->setObjectName(QString::fromUtf8("outerColor"));
|
||||
label->setAlignment( Qt::AlignRight|Qt::AlignVCenter );
|
||||
label->setBuddy( outerColor );
|
||||
|
||||
// second color selection
|
||||
mainLayout->addWidget( useOuterColor = new QCheckBox( this ), 4, 2, 1, 1 );
|
||||
useOuterColor->setObjectName(QString::fromUtf8("useOuterColor"));
|
||||
connect( useOuterColor, SIGNAL( toggled( bool ) ), outerColor, SLOT( setEnabled( bool ) ) );
|
||||
outerColor->setEnabled( false );
|
||||
|
||||
QMetaObject::connectSlotsByName(this);
|
||||
connect( shadowSize, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) );
|
||||
connect( horizontalOffset, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) );
|
||||
connect( verticalOffset, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) );
|
||||
connect( innerColor, SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) );
|
||||
connect( outerColor, SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) );
|
||||
connect( useOuterColor, SIGNAL( toggled( bool ) ), SIGNAL( changed() ) );
|
||||
// connections
|
||||
ui.outerColor->setEnabled( false );
|
||||
connect( ui.useOuterColor, SIGNAL( toggled( bool ) ), ui.outerColor, SLOT( setEnabled( bool ) ) );
|
||||
|
||||
connect( ui.shadowSize, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) );
|
||||
connect( ui.verticalOffset, SIGNAL( valueChanged( int ) ), SIGNAL( changed() ) );
|
||||
connect( ui.innerColor, SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) );
|
||||
connect( ui.outerColor, SIGNAL( changed( const QColor& ) ), SIGNAL( changed() ) );
|
||||
connect( ui.useOuterColor, SIGNAL( toggled( bool ) ), SIGNAL( changed() ) );
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -27,9 +27,7 @@
|
|||
|
||||
#include <QtGui/QCheckBox>
|
||||
#include <QtGui/QGroupBox>
|
||||
#include <KIntSpinBox>
|
||||
#include <kcolorbutton.h>
|
||||
|
||||
#include <ui_oxygenshadowconfigurationui.h>
|
||||
namespace Oxygen
|
||||
{
|
||||
|
||||
|
@ -43,33 +41,14 @@ namespace Oxygen
|
|||
|
||||
//! constructor
|
||||
OxygenShadowConfigurationUI( const QString&, QWidget* );
|
||||
|
||||
//! ui
|
||||
void setupUI( void );
|
||||
|
||||
//! size spinbox
|
||||
KIntSpinBox *shadowSize;
|
||||
|
||||
//! horizontal offset
|
||||
KIntSpinBox *horizontalOffset;
|
||||
|
||||
//! vertical offset
|
||||
KIntSpinBox *verticalOffset;
|
||||
|
||||
//! first color
|
||||
KColorButton *innerColor;
|
||||
|
||||
//! second color
|
||||
KColorButton *outerColor;
|
||||
|
||||
//! second color checkbox
|
||||
QCheckBox *useOuterColor;
|
||||
Ui_ShadowConfiguraionUI ui;
|
||||
|
||||
signals:
|
||||
|
||||
//! emmitted when configuration is changed
|
||||
void changed( void );
|
||||
|
||||
|
||||
};
|
||||
|
||||
}
|
||||
|
|
89
clients/oxygen/config/oxygenshadowconfigurationui.ui
Normal file
89
clients/oxygen/config/oxygenshadowconfigurationui.ui
Normal file
|
@ -0,0 +1,89 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>ShadowConfiguraionUI</class>
|
||||
<widget class="QWidget" name="ShadowConfiguraionUI">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>200</width>
|
||||
<height>118</height>
|
||||
</rect>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="2" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Inner Color:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="1">
|
||||
<widget class="KColorButton" name="innerColor"/>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QLabel" name="label_4">
|
||||
<property name="text">
|
||||
<string>Outer Color:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="KColorButton" name="outerColor"/>
|
||||
</item>
|
||||
<item row="3" column="2">
|
||||
<widget class="QCheckBox" name="useOuterColor">
|
||||
<property name="text">
|
||||
<string/>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Vertical Offset:</string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label">
|
||||
<property name="text">
|
||||
<string>Size: </string>
|
||||
</property>
|
||||
<property name="alignment">
|
||||
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="KIntSpinBox" name="shadowSize"/>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="KIntSpinBox" name="verticalOffset"/>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<customwidgets>
|
||||
<customwidget>
|
||||
<class>KIntSpinBox</class>
|
||||
<extends>QSpinBox</extends>
|
||||
<header>knuminput.h</header>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>KColorButton</class>
|
||||
<extends>QPushButton</extends>
|
||||
<header>kcolorbutton.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
Loading…
Reference in a new issue