• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • KDevelop Generic Shell
 

KDevelop Generic Shell

  • src
splashscreen.cpp
1 
2 #include "splashscreen.h"
3 #include "splashscreen.moc"
4 
5 #include <config.h>
6 
7 #include <tqtimer.h>
8 #include <tqfont.h>
9 
10 #include <tdelocale.h>
11 #include <tdeglobalsettings.h>
12 
13 KDevSplashScreen::KDevSplashScreen(const TQPixmap& pixmap, WFlags f) : TQSplashScreen(pixmap, f)
14 {
15  TQTimer *timer = new TQTimer( this );
16  TQObject::connect(timer, TQT_SIGNAL(timeout()), this, TQT_SLOT(animate()));
17  timer->start(150);
18 
19  state = 0;
20  progress_bar_size = 3;
21 }
22 
23 
24 KDevSplashScreen::~KDevSplashScreen()
25 {
26 }
27 
28 
29 void KDevSplashScreen::animate()
30 {
31  state = ((state + 1) % (2*progress_bar_size-1));
32  repaint();
33 }
34 
35 
36 void KDevSplashScreen::message( const TQString &str, int flags, const TQColor &color)
37 {
38  TQSplashScreen::message(str,flags,color);
39  animate();
40  m_string = str;
41 }
42 
43 
44 void KDevSplashScreen::drawContents (TQPainter* painter)
45 {
46  int position;
47  TQColor base_color (201,229,165); // Base green color
48 
49  // Draw background circles
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);
55 
56  // Draw animated circles, increments are chosen
57  // to get close to background's color
58  // (didn't work well with TQColor::light function)
59  for (int i=0; i < progress_bar_size; i++)
60  {
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));
65 
66  if (position < 3) painter->drawEllipse(51+position*11,7,9,9);
67  }
68 
69  painter->setPen(TQColor(74,112,18));
70  TQFont fnt(TDEGlobalSettings::generalFont());
71  fnt.setPointSize(8);
72  painter->setFont(fnt);
73 
74  // Draw version number
75  TQRect r = rect();
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 ));
78 
79  // Draw message at given position, limited to 43 chars
80  // If message is too long, string is truncated
81  if (m_string.length() > 40) {m_string.truncate(39); m_string += "...";}
82  painter->drawText (90, 16, m_string, 42);
83 
84 }
85 

KDevelop Generic Shell

Skip menu "KDevelop Generic Shell"
  • Main Page
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Class Members
  • Related Pages

KDevelop Generic Shell

Skip menu "KDevelop Generic Shell"
  • buildtools
  •   lib
  •     base
  •     parsers
  •       autotools
  •       qmake
  •     widgets
  •   api
  • languages
  •   lib
  •     debugger
  •     designer_integration
  •     interfaces
  • lib
  •   catalog
  •   interfaces
  •     extensions
  •     external
  •     extras
  •   util
  •   widgets
  •     propeditor
  • parts
  •   documentation
  •     interfaces
  • src
  •   profileengine
  •     lib
Generated for KDevelop Generic Shell by doxygen 1.8.13
This website is maintained by Timothy Pearson.