X-Git-Url: http://vcs.maemo.org/git/?a=blobdiff_plain;f=src%2FUserInterface%2FViews%2FRoomStatusIndicatorWidget.cpp;h=dbc2b07883ff84a41cd7537a8192540934e34154;hb=81d3e60d0265fdb330388ed9e358b524c56ab310;hp=c903bc0502e2013bd27f4e2526f7397e1dcf8597;hpb=89e9ba5883b47a6477957ed78772828b45bc3df9;p=qtmeetings diff --git a/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp b/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp index c903bc0..dbc2b07 100644 --- a/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp +++ b/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp @@ -6,6 +6,8 @@ #include "DigitalTimeDisplayWidget.h" #include "ToolBox.h" +#include + #include QTime RoomStatusIndicatorWidget::endOfTheDay = QTime( 23, 59, 0, 0 ); @@ -74,25 +76,28 @@ QString RoomStatusIndicatorWidget::statusToText( const Room::Status aStatus ) QPalette RoomStatusIndicatorWidget::createPalette( Room::Status aStatus ) { - QPixmap pixmap( aStatus == Room::BusyStatus ? ":roomstatus_busy" : ":roomstatus_free" ); + // QPixmap pixmap( aStatus == Room::BusyStatus ? ":roomstatus_busy" : ":roomstatus_free" ); + QString image = aStatus == Room::BusyStatus ? ":roomstatus_busy" : ":roomstatus_free"; // The image needs to be moved in normal mode so the traffic light not partly outside the screen const int xoffset( 60 ); const int yoffset( 19 ); - int cropwidth( pixmap.width() - xoffset ); - int cropheight( pixmap.height() - yoffset ); +// int cropwidth( pixmap.width() - xoffset ); +// int cropheight( pixmap.height() - yoffset ); QBrush brush; if ( windowState() == Qt::WindowFullScreen ) { // Use the full image in full screen mode - brush.setTexture( pixmap ); +// brush.setTexture( pixmap ); + brush.setTexture( QPixmap(image) ); } else { // Take part of the image so the traffic lights are moved xoffset poxels to left // and yoffset pixels to up - brush.setTexture( pixmap.copy( xoffset, yoffset, cropwidth, cropheight ) ); +// brush.setTexture( pixmap.copy( xoffset, yoffset, cropwidth, cropheight ) ); + brush.setTexture( QPixmap(image) ); } QPalette palette; @@ -117,4 +122,26 @@ void RoomStatusIndicatorWidget::statusChanged( const Room::Status aStatus, const iUntilTextLabel->setText( tr( "until %1" ).arg( aUntil.toString( iTimeFormat ) ) ); } setPalette( createPalette( aStatus ) ); +} + +void RoomStatusIndicatorWidget::currentRoomChanged( Room *aRoom ) +{ + iDefaultRoomLabel->setText( aRoom->name() ); +} + +bool RoomStatusIndicatorWidget::event(QEvent *event) +{ + switch(event->type()) + { + case QEvent::Paint: + qDebug() << "[RoomStatusIndicatorWidget::event] "; + break; + case QEvent::PaletteChange: + qDebug() << "[RoomStatusIndicatorWidget::event] "; + break; + default: + break; + } + + return ViewBase::event( event ); }