Changeset 2969
- Timestamp:
- 04/28/06 04:39:29 (3 years ago)
- Files:
-
- hydranode/hngui/backgrounds/splash.png (modified) (previous)
- hydranode/hngui/main.cpp (modified) (3 diffs)
- hydranode/hngui/main.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
hydranode/hngui/main.cpp
r2941 r2969 55 55 QString imgDir() { return s_imgDir; } 56 56 57 class Splash : public QSplashScreen { 58 public: 59 Splash(const QPixmap &img); 60 void showMessage( 61 const QString &message, int alignment = Qt::AlignLeft, 62 const QColor &color = Qt::black 63 ); 64 protected: 65 void drawContents(QPainter *p); 66 private: 67 QString m_message; 68 }; 69 70 Splash::Splash(const QPixmap &img) : QSplashScreen(img) { 71 setMask( 72 QRegion( 73 QPixmap::fromImage( 74 pixmap().toImage().createAlphaMask( 75 Qt::AutoColor | Qt::DiffuseDither 76 | Qt::DiffuseAlphaDither 77 ), Qt::AutoColor | Qt::DiffuseDither 78 | Qt::DiffuseAlphaDither 79 ) 80 ) 81 ); 82 } 83 84 void Splash::showMessage(const QString &message, int al, const QColor &c) { 85 QSplashScreen::showMessage(message, al, c); 86 m_message = message; 87 } 88 89 void Splash::drawContents(QPainter *p) { 90 logDebug("Contents drawn."); 91 // QSplashScreen::drawContents(p); 92 p->setBackground(QColor(0, 0, 0, 0)); 93 p->setRenderHint(QPainter::Antialiasing); 94 p->setRenderHint(QPainter::SmoothPixmapTransform); 95 p->drawPixmap(0, 0, pixmap()); 96 p->drawText(4, height() - 46, m_message); 97 } 98 57 99 MainWindow::MainWindow() : m_ecomm(), m_core(), m_ui(), m_corePort(9990), 58 100 m_showTitle(true) { 59 m_splash = new QSplashScreen(QPixmap(imgDir() + "splash.png"));101 m_splash = new Splash(QPixmap(imgDir() + "splash.png")); 60 102 connect( 61 103 m_splash, SIGNAL(destroyed(QObject*)), … … 63 105 ); 64 106 m_splash->show(); 107 m_splash->showMessage("Sleeping..."); 108 m_splash->repaint(); 109 Sleep(30000); 65 110 setWindowTitle("Hydranode - v0.3"); 66 111 #if 0 … … 523 568 ) 524 569 ); 525 526 570 } 527 571 hydranode/hngui/main.h
r2939 r2969 37 37 } 38 38 class EngineComm; 39 class QSplashScreen;39 class Splash; 40 40 class QToolButton; 41 41 … … 113 113 QWidget *m_currentPage; 114 114 115 QSplashScreen*m_splash;115 Splash *m_splash; 116 116 int m_corePort; 117 117 QString m_cmdLine; // command-line used for starting core process
