Move implementation out of header
[yandex-traffic] / mainwidget.hpp
index 3469b8b..65f64ab 100644 (file)
@@ -3,31 +3,28 @@
 
 #include <QtGui>
 
-#include <settings.hpp>
-#include <regions.hpp>
+#include "settings.hpp"
+#include "regions.hpp"
+#include "light.hpp"
 
 
-class MainWidget : public QLabel
+class MainWidget : public QWidget
 {
     Q_OBJECT
 private:
     RegionsTable _regions;
     Settings _settings;
 
+    // Widgets
+    TrafficLight *_light;
+    QLabel *_label;
+
 public:
-    MainWidget ()
-        : QLabel ()
-    {
-        setAlignment(Qt::AlignCenter);
-        setAttribute(Qt::WA_TranslucentBackground);
-
-        setText (_settings.regions ().join (", "));
-    }
-
-    QSize sizeHint() const
-    {
-        return 2 * QLabel::sizeHint();
-    }
+    MainWidget ();
+    QSize sizeHint () const;
+
+protected:
+    void paintEvent (QPaintEvent *event);
 };
 
 #endif /* __MAINWIDGET_H__ */