mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-20 12:52:30 +02:00
* Make header buttons work on WhatsNew page.
This commit is contained in:
@@ -27,6 +27,7 @@
|
|||||||
|
|
||||||
#include <QLayout>
|
#include <QLayout>
|
||||||
#include <QScrollArea>
|
#include <QScrollArea>
|
||||||
|
#include <QScrollBar>
|
||||||
#include <QStackedWidget>
|
#include <QStackedWidget>
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
@@ -63,23 +64,23 @@ WhatsNewWidget_0_8::WhatsNewWidget_0_8( QWidget* parent )
|
|||||||
: QWidget( parent )
|
: QWidget( parent )
|
||||||
, ui( new Ui::WhatsNewWidget_0_8 )
|
, ui( new Ui::WhatsNewWidget_0_8 )
|
||||||
{
|
{
|
||||||
QWidget* widget = new QWidget;
|
m_widget = new QWidget;
|
||||||
ui->setupUi( widget );
|
ui->setupUi( m_widget );
|
||||||
|
|
||||||
{
|
{
|
||||||
QScrollArea* area = new QScrollArea();
|
m_area = new QScrollArea();
|
||||||
area->setWidgetResizable( true );
|
m_area->setWidgetResizable( true );
|
||||||
area->setWidget( widget );
|
m_area->setWidget( m_widget );
|
||||||
|
|
||||||
QPalette pal = palette();
|
QPalette pal = palette();
|
||||||
pal.setBrush( backgroundRole(), Qt::white );
|
pal.setBrush( backgroundRole(), Qt::white );
|
||||||
area->setPalette( pal );
|
m_area->setPalette( pal );
|
||||||
area->setAutoFillBackground( true );
|
m_area->setAutoFillBackground( true );
|
||||||
area->setFrameShape( QFrame::NoFrame );
|
m_area->setFrameShape( QFrame::NoFrame );
|
||||||
area->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
m_area->setAttribute( Qt::WA_MacShowFocusRect, 0 );
|
||||||
|
|
||||||
QVBoxLayout* layout = new QVBoxLayout();
|
QVBoxLayout* layout = new QVBoxLayout();
|
||||||
layout->addWidget( area );
|
layout->addWidget( m_area );
|
||||||
setLayout( layout );
|
setLayout( layout );
|
||||||
TomahawkUtils::unmarginLayout( layout );
|
TomahawkUtils::unmarginLayout( layout );
|
||||||
}
|
}
|
||||||
@@ -89,6 +90,7 @@ WhatsNewWidget_0_8::WhatsNewWidget_0_8( QWidget* parent )
|
|||||||
ui->inboxImage->setPixmap( ui->inboxImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
|
ui->inboxImage->setPixmap( ui->inboxImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
|
||||||
ui->inboxImage->setFixedHeight( ui->inboxImage->pixmap()->height() );
|
ui->inboxImage->setFixedHeight( ui->inboxImage->pixmap()->height() );
|
||||||
ui->inboxButton->setFixedSize( QSize( 80, 80 ) );
|
ui->inboxButton->setFixedSize( QSize( 80, 80 ) );
|
||||||
|
ui->inboxButton->setCursor( Qt::PointingHandCursor );
|
||||||
QPixmap inboxPixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/inboxbutton.png", ui->inboxButton->size() );
|
QPixmap inboxPixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/inboxbutton.png", ui->inboxButton->size() );
|
||||||
ui->inboxButton->setPixmap( inboxPixmap );
|
ui->inboxButton->setPixmap( inboxPixmap );
|
||||||
connect( ui->inboxButton, SIGNAL( clicked() ), SLOT( inboxBoxClicked() ) );
|
connect( ui->inboxButton, SIGNAL( clicked() ), SLOT( inboxBoxClicked() ) );
|
||||||
@@ -98,6 +100,7 @@ WhatsNewWidget_0_8::WhatsNewWidget_0_8( QWidget* parent )
|
|||||||
ui->linkImage->setPixmap( ui->linkImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
|
ui->linkImage->setPixmap( ui->linkImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
|
||||||
ui->linkImage->setFixedHeight( ui->linkImage->pixmap()->height() );
|
ui->linkImage->setFixedHeight( ui->linkImage->pixmap()->height() );
|
||||||
ui->linkButton->setFixedSize( QSize( 80, 80 ) );
|
ui->linkButton->setFixedSize( QSize( 80, 80 ) );
|
||||||
|
ui->linkButton->setCursor( Qt::PointingHandCursor );
|
||||||
QPixmap pixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/connectivitybutton.png", ui->inboxButton->size() );
|
QPixmap pixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/connectivitybutton.png", ui->inboxButton->size() );
|
||||||
ui->linkButton->setPixmap( pixmap );
|
ui->linkButton->setPixmap( pixmap );
|
||||||
connect( ui->linkButton, SIGNAL( clicked() ), SLOT( urlLookupBoxClicked() ) );
|
connect( ui->linkButton, SIGNAL( clicked() ), SLOT( urlLookupBoxClicked() ) );
|
||||||
@@ -107,6 +110,7 @@ WhatsNewWidget_0_8::WhatsNewWidget_0_8( QWidget* parent )
|
|||||||
ui->beatsImage->setPixmap( ui->beatsImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
|
ui->beatsImage->setPixmap( ui->beatsImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
|
||||||
ui->beatsImage->setFixedHeight( ui->beatsImage->pixmap()->height() );
|
ui->beatsImage->setFixedHeight( ui->beatsImage->pixmap()->height() );
|
||||||
ui->beatsButton->setFixedSize( QSize( 80, 80 ) );
|
ui->beatsButton->setFixedSize( QSize( 80, 80 ) );
|
||||||
|
ui->beatsButton->setCursor( Qt::PointingHandCursor );
|
||||||
QPixmap beatsPixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/beatsbutton.png", ui->inboxButton->size() );
|
QPixmap beatsPixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/beatsbutton.png", ui->inboxButton->size() );
|
||||||
ui->beatsButton->setPixmap( beatsPixmap );
|
ui->beatsButton->setPixmap( beatsPixmap );
|
||||||
connect( ui->beatsButton, SIGNAL( clicked() ), SLOT( beatsBoxClicked() ) );
|
connect( ui->beatsButton, SIGNAL( clicked() ), SLOT( beatsBoxClicked() ) );
|
||||||
@@ -116,6 +120,7 @@ WhatsNewWidget_0_8::WhatsNewWidget_0_8( QWidget* parent )
|
|||||||
ui->googleImage->setPixmap( ui->googleImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
|
ui->googleImage->setPixmap( ui->googleImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
|
||||||
ui->googleImage->setFixedHeight( ui->googleImage->pixmap()->height() );
|
ui->googleImage->setFixedHeight( ui->googleImage->pixmap()->height() );
|
||||||
ui->googleButton->setFixedSize( QSize( 80, 80 ) );
|
ui->googleButton->setFixedSize( QSize( 80, 80 ) );
|
||||||
|
ui->googleButton->setCursor( Qt::PointingHandCursor );
|
||||||
QPixmap pixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/googlebutton.png", ui->inboxButton->size() );
|
QPixmap pixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/googlebutton.png", ui->inboxButton->size() );
|
||||||
ui->googleButton->setPixmap( pixmap );
|
ui->googleButton->setPixmap( pixmap );
|
||||||
connect( ui->googleButton, SIGNAL( clicked() ), SLOT( gmusicBoxClicked() ) );
|
connect( ui->googleButton, SIGNAL( clicked() ), SLOT( gmusicBoxClicked() ) );
|
||||||
@@ -125,6 +130,7 @@ WhatsNewWidget_0_8::WhatsNewWidget_0_8( QWidget* parent )
|
|||||||
ui->androidImage->setPixmap( ui->androidImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
|
ui->androidImage->setPixmap( ui->androidImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
|
||||||
ui->androidImage->setFixedHeight( ui->androidImage->pixmap()->height() );
|
ui->androidImage->setFixedHeight( ui->androidImage->pixmap()->height() );
|
||||||
ui->androidButton->setFixedSize( QSize( 80, 80 ) );
|
ui->androidButton->setFixedSize( QSize( 80, 80 ) );
|
||||||
|
ui->androidButton->setCursor( Qt::PointingHandCursor );
|
||||||
QPixmap pixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/androidbutton.png", ui->inboxButton->size() );
|
QPixmap pixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/androidbutton.png", ui->inboxButton->size() );
|
||||||
ui->androidButton->setPixmap( pixmap );
|
ui->androidButton->setPixmap( pixmap );
|
||||||
connect( ui->androidButton, SIGNAL( clicked() ), SLOT( androidBoxClicked() ) );
|
connect( ui->androidButton, SIGNAL( clicked() ), SLOT( androidBoxClicked() ) );
|
||||||
@@ -134,6 +140,7 @@ WhatsNewWidget_0_8::WhatsNewWidget_0_8( QWidget* parent )
|
|||||||
ui->networkImage->setPixmap( ui->networkImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
|
ui->networkImage->setPixmap( ui->networkImage->pixmap()->scaledToWidth( width, Qt::SmoothTransformation ) );
|
||||||
ui->networkImage->setFixedHeight( ui->networkImage->pixmap()->height() );
|
ui->networkImage->setFixedHeight( ui->networkImage->pixmap()->height() );
|
||||||
ui->networkButton->setFixedSize( QSize( 80, 80 ) );
|
ui->networkButton->setFixedSize( QSize( 80, 80 ) );
|
||||||
|
ui->networkButton->setCursor( Qt::PointingHandCursor );
|
||||||
QPixmap networkingPixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/networkbutton.png", ui->inboxButton->size() );
|
QPixmap networkingPixmap = ImageRegistry::instance()->pixmap( ":/whatsnew_0_8/data/images/networkbutton.png", ui->inboxButton->size() );
|
||||||
ui->networkButton->setPixmap( networkingPixmap );
|
ui->networkButton->setPixmap( networkingPixmap );
|
||||||
connect( ui->networkButton, SIGNAL( clicked() ), SLOT( networkingBoxClicked() ) );
|
connect( ui->networkButton, SIGNAL( clicked() ), SLOT( networkingBoxClicked() ) );
|
||||||
@@ -228,31 +235,35 @@ WhatsNewWidget_0_8::urlLookupBoxClicked()
|
|||||||
void
|
void
|
||||||
WhatsNewWidget_0_8::beatsBoxClicked()
|
WhatsNewWidget_0_8::beatsBoxClicked()
|
||||||
{
|
{
|
||||||
|
activateAnchor( ui->beatsCaption );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WhatsNewWidget_0_8::gmusicBoxClicked()
|
WhatsNewWidget_0_8::gmusicBoxClicked()
|
||||||
{
|
{
|
||||||
|
activateAnchor( ui->googleCaption );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WhatsNewWidget_0_8::networkingBoxClicked()
|
WhatsNewWidget_0_8::networkingBoxClicked()
|
||||||
{
|
{
|
||||||
|
activateAnchor( ui->networkCaption );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WhatsNewWidget_0_8::androidBoxClicked()
|
WhatsNewWidget_0_8::androidBoxClicked()
|
||||||
{
|
{
|
||||||
|
activateAnchor( ui->androidCaption );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
WhatsNewWidget_0_8::activateAnchor( QWidget* /* widget */ )
|
WhatsNewWidget_0_8::activateAnchor( QWidget* widget )
|
||||||
{
|
{
|
||||||
//FIXME
|
m_area->verticalScrollBar()->setValue( widget->mapTo( m_widget, QPoint( 0, 0 ) ).y() - 32 );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -26,6 +26,8 @@
|
|||||||
|
|
||||||
#include "../ViewPageDllMacro.h"
|
#include "../ViewPageDllMacro.h"
|
||||||
|
|
||||||
|
class QScrollArea;
|
||||||
|
|
||||||
namespace Ui
|
namespace Ui
|
||||||
{
|
{
|
||||||
class WhatsNewWidget_0_8;
|
class WhatsNewWidget_0_8;
|
||||||
@@ -65,6 +67,9 @@ private slots:
|
|||||||
private:
|
private:
|
||||||
void activateAnchor( QWidget* widget );
|
void activateAnchor( QWidget* widget );
|
||||||
|
|
||||||
|
QWidget* m_widget;
|
||||||
|
QScrollArea* m_area;
|
||||||
|
|
||||||
Ui::WhatsNewWidget_0_8 *ui;
|
Ui::WhatsNewWidget_0_8 *ui;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user