- Use KColorCombo for choosing colors.
- Color config is now properly loaded/saved/used svn path=/trunk/KDE/kdebase/workspace/; revision=740985
This commit is contained in:
parent
eb02256303
commit
7b3bdb5be7
4 changed files with 14 additions and 6 deletions
|
@ -43,6 +43,7 @@ MouseMarkEffect::MouseMarkEffect()
|
|||
|
||||
KConfigGroup conf = EffectsHandler::effectConfig("MouseMark");
|
||||
width = conf.readEntry( "LineWidth", 3 );
|
||||
color = conf.readEntry( "Color", QColor( Qt::red ));
|
||||
}
|
||||
|
||||
void MouseMarkEffect::paintScreen( int mask, QRegion region, ScreenPaintData& data )
|
||||
|
@ -51,7 +52,7 @@ void MouseMarkEffect::paintScreen( int mask, QRegion region, ScreenPaintData& da
|
|||
if( marks.isEmpty() && drawing.isEmpty())
|
||||
return;
|
||||
glPushAttrib( GL_ENABLE_BIT | GL_CURRENT_BIT | GL_LINE_BIT );
|
||||
glColor4f( 1, 0, 0, 1 ); // red
|
||||
glColor4f( color.redF(), color.greenF(), color.blueF(), 1 );
|
||||
glEnable( GL_LINE_SMOOTH );
|
||||
glLineWidth( width );
|
||||
foreach( const Mark& mark, marks )
|
||||
|
|
|
@ -33,6 +33,7 @@ class MouseMarkEffect
|
|||
QVector< Mark > marks;
|
||||
Mark drawing;
|
||||
int width;
|
||||
QColor color;
|
||||
};
|
||||
|
||||
} // namespace
|
||||
|
|
|
@ -48,6 +48,7 @@ MouseMarkEffectConfig::MouseMarkEffectConfig(QWidget* parent, const QVariantList
|
|||
|
||||
connect(m_ui->editor, SIGNAL(keyChange()), this, SLOT(changed()));
|
||||
connect(m_ui->spinWidth, SIGNAL(valueChanged(int)), this, SLOT(changed()));
|
||||
connect(m_ui->comboColors, SIGNAL(currentIndexChanged(int)), this, SLOT(changed()));
|
||||
|
||||
// Shortcut config
|
||||
KGlobalAccel::self()->overrideMainComponentData(componentData());
|
||||
|
@ -69,9 +70,9 @@ void MouseMarkEffectConfig::load()
|
|||
KConfigGroup conf = EffectsHandler::effectConfig("MouseMark");
|
||||
|
||||
int width = conf.readEntry("LineWidth", 3);
|
||||
QColor color = conf.readEntry("Color", QColor(255, 0, 0));
|
||||
QColor color = conf.readEntry("Color", QColor(Qt::red));
|
||||
m_ui->spinWidth->setValue(width);
|
||||
//m_ui->spinHeight->setValue(height);
|
||||
m_ui->comboColors->setColor(color);
|
||||
|
||||
emit changed(false);
|
||||
}
|
||||
|
@ -84,7 +85,7 @@ void MouseMarkEffectConfig::save()
|
|||
KConfigGroup conf = EffectsHandler::effectConfig("MouseMark");
|
||||
|
||||
conf.writeEntry("LineWidth", m_ui->spinWidth->value());
|
||||
//conf.writeEntry("Color", m_ui->spinHeight->value());
|
||||
conf.writeEntry("Color", m_ui->comboColors->color());
|
||||
|
||||
conf.sync();
|
||||
|
||||
|
@ -96,7 +97,7 @@ void MouseMarkEffectConfig::defaults()
|
|||
{
|
||||
kDebug() ;
|
||||
m_ui->spinWidth->setValue(3);
|
||||
//m_ui->spinHeight->setValue(200);
|
||||
m_ui->comboColors->setColor(Qt::red);
|
||||
emit changed(true);
|
||||
}
|
||||
|
||||
|
|
|
@ -53,7 +53,7 @@
|
|||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" >
|
||||
<widget class="QComboBox" name="comboColors" />
|
||||
<widget class="KColorCombo" name="comboColors" />
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
|
@ -80,6 +80,11 @@
|
|||
<header location="global" >kwineffects.h</header>
|
||||
<container>1</container>
|
||||
</customwidget>
|
||||
<customwidget>
|
||||
<class>KColorCombo</class>
|
||||
<extends>QComboBox</extends>
|
||||
<header location="global" >kcolorcombo.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources/>
|
||||
<connections/>
|
||||
|
|
Loading…
Reference in a new issue