X-Git-Url: http://git.maemo.org/git/?p=qtmeetings;a=blobdiff_plain;f=src%2FUserInterface%2FViews%2FRoomStatusIndicatorWidget.cpp;h=e3ba64851294154b8a19597ba7e84af679528685;hp=6573e28ef30816f0921352232274ba8ac8958939;hb=270286b17231aedeedd0bd4b3fa7db7b65f7c9da;hpb=b50201458e621351445d5930fd98d2a33558fdad diff --git a/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp b/src/UserInterface/Views/RoomStatusIndicatorWidget.cpp index 6573e28..e3ba648 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 ); @@ -94,25 +96,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; @@ -137,6 +142,28 @@ 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 ); } void RoomStatusIndicatorWidget::connectionEstablished()