|
|
|
@ -25,12 +25,15 @@
|
|
|
|
|
#include <tqpixmap.h>
|
|
|
|
|
#include <tqwidget.h>
|
|
|
|
|
#include <tqtimer.h>
|
|
|
|
|
#include <tqvaluelist.h>
|
|
|
|
|
|
|
|
|
|
#include "objkstheme.h"
|
|
|
|
|
#include "themeengine.h"
|
|
|
|
|
#include "themelegacy.h"
|
|
|
|
|
#include "themelegacy.moc"
|
|
|
|
|
|
|
|
|
|
const int MAX_STATES=8;
|
|
|
|
|
|
|
|
|
|
DefaultConfig::DefaultConfig( TQWidget *parent, TDEConfig *config )
|
|
|
|
|
:ThemeEngineConfig( parent, config )
|
|
|
|
|
{
|
|
|
|
@ -59,6 +62,8 @@ ThemeDefault::ThemeDefault( TQWidget *parent, const char *name, const TQStringLi
|
|
|
|
|
|
|
|
|
|
mActivePixmap = mInactivePixmap = 0L;
|
|
|
|
|
mState = 0;
|
|
|
|
|
for (int i=0; i<MAX_ICONS; ++i)
|
|
|
|
|
mIconOffsets[i]=0;
|
|
|
|
|
|
|
|
|
|
_readSettings();
|
|
|
|
|
_initUi();
|
|
|
|
@ -209,6 +214,14 @@ void ThemeDefault::_readSettings()
|
|
|
|
|
mIconsFlashing = cfg->readBoolEntry( "Icons Flashing", true );
|
|
|
|
|
TQColor df(Qt::white);
|
|
|
|
|
mLabelForeground = cfg->readColorEntry( "Label Foreground", &df );
|
|
|
|
|
TQValueList<int> io_list=cfg->readIntListEntry("Icon Offsets");
|
|
|
|
|
if (io_list.size() == MAX_ICONS)
|
|
|
|
|
{
|
|
|
|
|
TQValueList<int>::iterator io_it;
|
|
|
|
|
int i=0;
|
|
|
|
|
for (io_it = io_list.begin(); io_it != io_list.end(); ++io_it, ++i)
|
|
|
|
|
mIconOffsets[i]=*io_it;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
@ -219,8 +232,8 @@ void ThemeDefault::_readSettings()
|
|
|
|
|
*/
|
|
|
|
|
void ThemeDefault::slotUpdateState()
|
|
|
|
|
{
|
|
|
|
|
if( mState > 8 )
|
|
|
|
|
mState = 8;
|
|
|
|
|
if (mState >= MAX_STATES)
|
|
|
|
|
mState = MAX_STATES-1;
|
|
|
|
|
|
|
|
|
|
if( mIconsFlashing )
|
|
|
|
|
{
|
|
|
|
@ -230,7 +243,7 @@ void ThemeDefault::slotUpdateState()
|
|
|
|
|
mBarLabel->setPixmap(*mFlashPixmap2);
|
|
|
|
|
mFlashTimer->stop();
|
|
|
|
|
|
|
|
|
|
if( mState < 8 )
|
|
|
|
|
if( mState < MAX_STATES )
|
|
|
|
|
mFlashTimer->start(400);
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
@ -252,8 +265,6 @@ TQPixmap ThemeDefault::updateBarPixmap( int state )
|
|
|
|
|
TQPixmap x;
|
|
|
|
|
if( !mActivePixmap ) return( x );
|
|
|
|
|
#if BIDI
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( TQApplication::reverseLayout() )
|
|
|
|
|
{
|
|
|
|
|
if ( state > 7 )
|
|
|
|
@ -262,10 +273,8 @@ TQPixmap ThemeDefault::updateBarPixmap( int state )
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
offs = state*58;
|
|
|
|
|
if (state == 3)
|
|
|
|
|
offs += 8;
|
|
|
|
|
else if (state == 6)
|
|
|
|
|
offs -= 8;
|
|
|
|
|
if (state>=0 && state<MAX_ICONS)
|
|
|
|
|
offs += mIconOffsets[state];
|
|
|
|
|
|
|
|
|
|
TQPixmap tmp(*mActivePixmap);
|
|
|
|
|
TQPainter p(&tmp);
|
|
|
|
|