#include "DigitalTimeDisplayWidget.h"\r
#include "ToolBox.h"\r
\r
+#include <QEvent>\r
+\r
#include <QtDebug>\r
\r
QTime RoomStatusIndicatorWidget::endOfTheDay = QTime( 23, 59, 0, 0 );\r
\r
QPalette RoomStatusIndicatorWidget::createPalette( Room::Status aStatus )\r
{\r
- QPixmap pixmap( aStatus == Room::BusyStatus ? ":roomstatus_busy" : ":roomstatus_free" );\r
+ // QPixmap pixmap( aStatus == Room::BusyStatus ? ":roomstatus_busy" : ":roomstatus_free" );\r
+ QString image = aStatus == Room::BusyStatus ? ":roomstatus_busy" : ":roomstatus_free";\r
\r
// The image needs to be moved in normal mode so the traffic light not partly outside the screen\r
const int xoffset( 60 );\r
const int yoffset( 19 );\r
- int cropwidth( pixmap.width() - xoffset );\r
- int cropheight( pixmap.height() - yoffset );\r
+// int cropwidth( pixmap.width() - xoffset );\r
+// int cropheight( pixmap.height() - yoffset );\r
\r
QBrush brush;\r
if ( windowState() == Qt::WindowFullScreen )\r
{\r
// Use the full image in full screen mode\r
- brush.setTexture( pixmap );\r
+// brush.setTexture( pixmap );\r
+ brush.setTexture( QPixmap(image) );\r
}\r
else\r
{\r
// Take part of the image so the traffic lights are moved xoffset poxels to left \r
// and yoffset pixels to up\r
- brush.setTexture( pixmap.copy( xoffset, yoffset, cropwidth, cropheight ) );\r
+// brush.setTexture( pixmap.copy( xoffset, yoffset, cropwidth, cropheight ) );\r
+ brush.setTexture( QPixmap(image) );\r
}\r
\r
QPalette palette;\r
iUntilTextLabel->setText( tr( "until %1" ).arg( aUntil.toString( iTimeFormat ) ) );\r
}\r
setPalette( createPalette( aStatus ) );\r
+}
+\r
+void RoomStatusIndicatorWidget::currentRoomChanged( Room *aRoom )\r
+{\r
+ iDefaultRoomLabel->setText( aRoom->name() );\r
+}\r
+\r
+bool RoomStatusIndicatorWidget::event(QEvent *event)\r
+{\r
+ switch(event->type())\r
+ {\r
+ case QEvent::Paint:\r
+ qDebug() << "[RoomStatusIndicatorWidget::event] <Paint event>";\r
+ break;\r
+ case QEvent::PaletteChange:\r
+ qDebug() << "[RoomStatusIndicatorWidget::event] <Palette change event>";\r
+ break;\r
+ default:\r
+ break;\r
+ }\r
+ \r
+ return ViewBase::event( event );\r
}\r
\r
void RoomStatusIndicatorWidget::connectionEstablished()\r