2 #include "splashscreen.h" 3 #include "splashscreen.moc" 10 #include <tdelocale.h> 11 #include <tdeglobalsettings.h> 13 KDevSplashScreen::KDevSplashScreen(
const TQPixmap& pixmap, WFlags f) : TQSplashScreen(pixmap, f)
15 TQTimer *timer =
new TQTimer(
this );
16 TQObject::connect(timer, TQT_SIGNAL(timeout()),
this, TQT_SLOT(animate()));
20 progress_bar_size = 3;
24 KDevSplashScreen::~KDevSplashScreen()
29 void KDevSplashScreen::animate()
31 state = ((state + 1) % (2*progress_bar_size-1));
36 void KDevSplashScreen::message(
const TQString &str,
int flags,
const TQColor &color)
38 TQSplashScreen::message(str,flags,color);
44 void KDevSplashScreen::drawContents (TQPainter* painter)
47 TQColor base_color (201,229,165);
50 painter->setPen(NoPen);
51 painter->setBrush(TQColor(215,234,181));
52 painter->drawEllipse(51,7,9,9);
53 painter->drawEllipse(62,7,9,9);
54 painter->drawEllipse(73,7,9,9);
59 for (
int i=0; i < progress_bar_size; i++)
61 position = (state+i)%(2*progress_bar_size-1);
62 painter->setBrush(TQColor(base_color.red()-18*i,
63 base_color.green()-10*i,
64 base_color.blue()-28*i));
66 if (position < 3) painter->drawEllipse(51+position*11,7,9,9);
69 painter->setPen(TQColor(74,112,18));
70 TQFont fnt(TDEGlobalSettings::generalFont());
72 painter->setFont(fnt);
76 r.setRect(r.x() + 5, r.y() + 5, r.width() - 10, r.height() - 10);
77 painter->drawText(r, TQt::AlignRight, i18n(
"Version %1").arg( VERSION ));
81 if (m_string.length() > 40) {m_string.truncate(39); m_string +=
"...";}
82 painter->drawText (90, 16, m_string, 42);