diff --git a/src/modules/locale/timezonewidget/timezonewidget.cpp b/src/modules/locale/timezonewidget/timezonewidget.cpp index f60e32c96..307e1d9b8 100644 --- a/src/modules/locale/timezonewidget/timezonewidget.cpp +++ b/src/modules/locale/timezonewidget/timezonewidget.cpp @@ -28,6 +28,8 @@ #include "timezonewidget.h" +// Pixel value indicating that a spot is outside of a zone +#define RGB_TRANSPARENT 0 static constexpr double MAP_Y_OFFSET = 0.125; static constexpr double MAP_X_OFFSET = -0.0370; @@ -49,9 +51,16 @@ TimeZoneWidget::TimeZoneWidget( QWidget* parent ) font.setBold( false ); // Images - background = QImage( ":/images/bg.png" ).scaled( X_SIZE, Y_SIZE, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ); + background = QImage( ":/images/bg.png" ); pin = QImage( ":/images/pin.png" ); +#ifdef DEBUG_TIMEZONES + if ( background.size() != QSize( 780, 340 ) ) + { + cWarning() << "Timezone background size mitsmatch" << background.size(); + } +#endif + // Set size setMinimumSize( background.size() ); setMaximumSize( background.size() ); @@ -60,9 +69,12 @@ TimeZoneWidget::TimeZoneWidget( QWidget* parent ) QStringList zones = QString( ZONES ).split( " ", QString::SkipEmptyParts ); for ( int i = 0; i < zones.size(); ++i ) { - timeZoneImages.append( QImage( ":/images/timezone_" + zones.at( i ) + ".png" ) - .scaled( X_SIZE, Y_SIZE, Qt::IgnoreAspectRatio, Qt::SmoothTransformation ) ); + timeZoneImages.append( QImage( ":/images/timezone_" + zones.at( i ) + ".png" ) ); #ifdef DEBUG_TIMEZONES + if ( timeZoneImages.last().size() != background.size() ) + { + cWarning() << "Timezone image size mismatch" << zones.at( i ) << timeZoneImages.last().size(); + } timeZoneImages.last().setText( ZONE_NAME, zones.at( i ) ); #endif } diff --git a/src/modules/locale/timezonewidget/timezonewidget.h b/src/modules/locale/timezonewidget/timezonewidget.h index 3f5baf16b..87b817349 100644 --- a/src/modules/locale/timezonewidget/timezonewidget.h +++ b/src/modules/locale/timezonewidget/timezonewidget.h @@ -40,12 +40,9 @@ #include -#define RGB_TRANSPARENT 0 #define ZONES \ "0.0 1.0 2.0 3.0 3.5 4.0 4.5 5.0 5.5 5.75 6.0 6.5 7.0 8.0 9.0 9.5 10.0 10.5 11.0 11.5 12.0 12.75 13.0 -1.0 -2.0 " \ "-3.0 -3.5 -4.0 -4.5 -5.0 -5.5 -6.0 -7.0 -8.0 -9.0 -9.5 -10.0 -11.0" -#define X_SIZE 780 -#define Y_SIZE 340 class TimeZoneWidget : public QWidget