1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-03-20 15:59:42 +01:00

* Correctly scale / adjust images on 'What's New' page.

This commit is contained in:
Christian Muehlhaeuser 2014-08-21 18:39:02 +02:00
parent 1b9d4469f1
commit 1007cfa9b2
2 changed files with 39 additions and 7 deletions

View File

@ -13,7 +13,7 @@
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<layout class="QHBoxLayout" name="horizontalLayout_2" stretch="0,1,0">
<property name="spacing">
<number>0</number>
</property>
@ -155,7 +155,7 @@
</widget>
</item>
<item>
<widget class="QLabel" name="label_4">
<widget class="QLabel" name="inboxImage">
<property name="sizePolicy">
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -175,6 +175,9 @@ border-color: #ccc;
<property name="pixmap">
<pixmap resource="resources.qrc">:/whatsnew_0_8/data/images/inbox-screenshot.png</pixmap>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
<property name="alignment">
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
</property>
@ -211,7 +214,7 @@ border-color: #ccc;
</widget>
</item>
<item>
<widget class="QLabel" name="label_22">
<widget class="QLabel" name="linkImage">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -221,6 +224,9 @@ border-color: #ccc;
<property name="pixmap">
<pixmap resource="resources.qrc">:/whatsnew_0_8/data/images/universal-link-network.png</pixmap>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
</widget>
</item>
<item>
@ -251,7 +257,7 @@ border-color: #ccc;
</widget>
</item>
<item>
<widget class="QLabel" name="label_23">
<widget class="QLabel" name="beatsImage">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -261,6 +267,9 @@ border-color: #ccc;
<property name="pixmap">
<pixmap resource="resources.qrc">:/whatsnew_0_8/data/images/beatsmusic.png</pixmap>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
</widget>
</item>
<item>
@ -291,7 +300,7 @@ border-color: #ccc;
</widget>
</item>
<item>
<widget class="QLabel" name="label_24">
<widget class="QLabel" name="googleImage">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -301,6 +310,9 @@ border-color: #ccc;
<property name="pixmap">
<pixmap resource="resources.qrc">:/whatsnew_0_8/data/images/gmusic-banner.png</pixmap>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
</widget>
</item>
<item>
@ -331,7 +343,7 @@ border-color: #ccc;
</widget>
</item>
<item>
<widget class="QLabel" name="label_25">
<widget class="QLabel" name="androidImage">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -341,6 +353,9 @@ border-color: #ccc;
<property name="pixmap">
<pixmap resource="resources.qrc">:/whatsnew_0_8/data/images/tomahawk-android.png</pixmap>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
</widget>
</item>
<item>
@ -371,7 +386,7 @@ border-color: #ccc;
</widget>
</item>
<item>
<widget class="QLabel" name="label_26">
<widget class="QLabel" name="networkImage">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
@ -381,6 +396,9 @@ border-color: #ccc;
<property name="pixmap">
<pixmap resource="resources.qrc">:/whatsnew_0_8/data/images/networking.png</pixmap>
</property>
<property name="scaledContents">
<bool>false</bool>
</property>
</widget>
</item>
<item>

View File

@ -20,6 +20,7 @@
#include "WhatsNew_0_8.h"
#include "ui_WhatsNewWidget_0_8.h"
#include "utils/Logger.h"
#include "utils/ImageRegistry.h"
#include "utils/TomahawkStyle.h"
#include "TomahawkSettings.h"
@ -83,7 +84,10 @@ WhatsNewWidget_0_8::WhatsNewWidget_0_8( QWidget* parent )
TomahawkUtils::unmarginLayout( layout );
}
int width = ui->widget->minimumSize().width() - ( ui->widget->layout()->contentsMargins().left() + ui->widget->layout()->contentsMargins().right() );
{
ui->inboxImage->setPixmap( ui->inboxImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
ui->inboxImage->setFixedHeight( ui->inboxImage->pixmap()->height() );
ui->inboxButton->setFixedSize( QSize( 80, 80 ) );
QPixmap inboxPixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/inboxbutton.png", ui->inboxButton->size() );
ui->inboxButton->setPixmap( inboxPixmap );
@ -91,6 +95,8 @@ WhatsNewWidget_0_8::WhatsNewWidget_0_8( QWidget* parent )
}
{
ui->linkImage->setPixmap( ui->linkImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
ui->linkImage->setFixedHeight( ui->linkImage->pixmap()->height() );
ui->linkButton->setFixedSize( QSize( 80, 80 ) );
QPixmap pixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/connectivitybutton.png", ui->inboxButton->size() );
ui->linkButton->setPixmap( pixmap );
@ -98,6 +104,8 @@ WhatsNewWidget_0_8::WhatsNewWidget_0_8( QWidget* parent )
}
{
ui->beatsImage->setPixmap( ui->beatsImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
ui->beatsImage->setFixedHeight( ui->beatsImage->pixmap()->height() );
ui->beatsButton->setFixedSize( QSize( 80, 80 ) );
QPixmap beatsPixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/beatsbutton.png", ui->inboxButton->size() );
ui->beatsButton->setPixmap( beatsPixmap );
@ -105,6 +113,8 @@ WhatsNewWidget_0_8::WhatsNewWidget_0_8( QWidget* parent )
}
{
ui->googleImage->setPixmap( ui->googleImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
ui->googleImage->setFixedHeight( ui->googleImage->pixmap()->height() );
ui->googleButton->setFixedSize( QSize( 80, 80 ) );
QPixmap pixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/googlebutton.png", ui->inboxButton->size() );
ui->googleButton->setPixmap( pixmap );
@ -112,6 +122,8 @@ WhatsNewWidget_0_8::WhatsNewWidget_0_8( QWidget* parent )
}
{
ui->androidImage->setPixmap( ui->androidImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
ui->androidImage->setFixedHeight( ui->androidImage->pixmap()->height() );
ui->androidButton->setFixedSize( QSize( 80, 80 ) );
QPixmap pixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/androidbutton.png", ui->inboxButton->size() );
ui->androidButton->setPixmap( pixmap );
@ -119,6 +131,8 @@ WhatsNewWidget_0_8::WhatsNewWidget_0_8( QWidget* parent )
}
{
ui->networkImage->setPixmap( ui->networkImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
ui->networkImage->setFixedHeight( ui->networkImage->pixmap()->height() );
ui->networkButton->setFixedSize( QSize( 80, 80 ) );
QPixmap networkingPixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/networkbutton.png", ui->inboxButton->size() );
ui->networkButton->setPixmap( networkingPixmap );