mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
Added offline account icons.
This commit is contained in:
@@ -227,8 +227,11 @@ TwitterAccount::connectAuthVerifyReply( const QTweetUser &user )
|
|||||||
|
|
||||||
|
|
||||||
QPixmap
|
QPixmap
|
||||||
TwitterAccount::icon() const {
|
TwitterAccount::icon() const
|
||||||
return QPixmap( ":/twitter-icon.png" );
|
{
|
||||||
|
if ( connectionState() == Connected )
|
||||||
|
return QPixmap( ":/twitter-icon.png" );
|
||||||
|
return QPixmap( ":/twitter-offline-icon.png" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
<!DOCTYPE RCC><RCC version="1.0">
|
<RCC>
|
||||||
<qresource>
|
<qresource prefix="/">
|
||||||
<file>twitter-icon.png</file>
|
<file>twitter-icon.png</file>
|
||||||
</qresource>
|
<file>twitter-offline-icon.png</file>
|
||||||
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
BIN
src/accounts/twitter/twitter-offline-icon.png
Normal file
BIN
src/accounts/twitter/twitter-offline-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.6 KiB |
@@ -53,6 +53,14 @@ XmppAccount::~XmppAccount()
|
|||||||
delete m_xmppSipPlugin.data();
|
delete m_xmppSipPlugin.data();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QPixmap
|
||||||
|
XmppAccount::icon() const
|
||||||
|
{
|
||||||
|
if ( connectionState() == Connected )
|
||||||
|
return QPixmap( ":/xmpp-icon.png" );
|
||||||
|
return QPixmap( ":/xmpp-offline-icon.png" );
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
XmppAccount::authenticate()
|
XmppAccount::authenticate()
|
||||||
|
@@ -63,7 +63,7 @@ public:
|
|||||||
XmppAccount( const QString &accountId );
|
XmppAccount( const QString &accountId );
|
||||||
virtual ~XmppAccount();
|
virtual ~XmppAccount();
|
||||||
|
|
||||||
QPixmap icon() const { return QPixmap( ":/xmpp-icon.png" ); }
|
QPixmap icon() const;
|
||||||
|
|
||||||
void authenticate();
|
void authenticate();
|
||||||
void deauthenticate();
|
void deauthenticate();
|
||||||
|
@@ -98,7 +98,9 @@ GoogleWrapper::~GoogleWrapper()
|
|||||||
QPixmap
|
QPixmap
|
||||||
GoogleWrapper::icon() const
|
GoogleWrapper::icon() const
|
||||||
{
|
{
|
||||||
return QPixmap( ":/gmail-logo.png" );
|
if ( connectionState() == Connected )
|
||||||
|
return QPixmap( ":/gmail-logo.png" );
|
||||||
|
return QPixmap( ":/gmail-offline-logo.png" );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
BIN
src/accounts/xmpp/googlewrapper/gmail-offline-logo.png
Normal file
BIN
src/accounts/xmpp/googlewrapper/gmail-offline-logo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 4.6 KiB |
@@ -1,5 +1,6 @@
|
|||||||
<!DOCTYPE RCC><RCC version="1.0">
|
<RCC>
|
||||||
<qresource>
|
<qresource prefix="/">
|
||||||
<file>gmail-logo.png</file>
|
<file>gmail-logo.png</file>
|
||||||
</qresource>
|
<file>gmail-offline-logo.png</file>
|
||||||
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
@@ -1,5 +1,6 @@
|
|||||||
<!DOCTYPE RCC><RCC version="1.0">
|
<RCC>
|
||||||
<qresource>
|
<qresource prefix="/">
|
||||||
<file>xmpp-icon.png</file>
|
<file>xmpp-icon.png</file>
|
||||||
</qresource>
|
<file>xmpp-offline-icon.png</file>
|
||||||
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
BIN
src/accounts/xmpp/xmpp-offline-icon.png
Normal file
BIN
src/accounts/xmpp/xmpp-offline-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 3.4 KiB |
@@ -139,16 +139,16 @@ AccountWidget::~AccountWidget()
|
|||||||
void
|
void
|
||||||
AccountWidget::update( const QPersistentModelIndex& idx, int accountIdx )
|
AccountWidget::update( const QPersistentModelIndex& idx, int accountIdx )
|
||||||
{
|
{
|
||||||
const QPixmap &pixmap = static_cast< QPixmap >( idx.data( Qt::DecorationRole ).value< QPixmap >() );
|
|
||||||
QSize pixmapSize( 32, 32 );
|
|
||||||
m_imageLabel->setPixmap( pixmap.scaled( pixmapSize, Qt::KeepAspectRatio, Qt::SmoothTransformation ) );
|
|
||||||
m_imageLabel->setFixedSize( pixmapSize );
|
|
||||||
|
|
||||||
Tomahawk::Accounts::Account* account =
|
Tomahawk::Accounts::Account* account =
|
||||||
idx.data( Tomahawk::Accounts::AccountModel::ChildrenOfFactoryRole )
|
idx.data( Tomahawk::Accounts::AccountModel::ChildrenOfFactoryRole )
|
||||||
.value< QList< Tomahawk::Accounts::Account* > >().at( accountIdx );
|
.value< QList< Tomahawk::Accounts::Account* > >().at( accountIdx );
|
||||||
if ( account )
|
if ( account )
|
||||||
{
|
{
|
||||||
|
const QPixmap& pixmap = account->icon();
|
||||||
|
QSize pixmapSize( 32, 32 );
|
||||||
|
m_imageLabel->setPixmap( pixmap.scaled( pixmapSize, Qt::KeepAspectRatio, Qt::SmoothTransformation ) );
|
||||||
|
m_imageLabel->setFixedSize( pixmapSize );
|
||||||
|
|
||||||
QFontMetrics fm = m_idLabel->fontMetrics();
|
QFontMetrics fm = m_idLabel->fontMetrics();
|
||||||
m_idLabel->setText( account->accountFriendlyName() );
|
m_idLabel->setText( account->accountFriendlyName() );
|
||||||
m_idLabel->setToolTip( "<b>" +
|
m_idLabel->setToolTip( "<b>" +
|
||||||
|
@@ -96,3 +96,12 @@ AccountsToolButton::popupHidden() //SLOT
|
|||||||
{
|
{
|
||||||
setDown( false );
|
setDown( false );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
QSize
|
||||||
|
AccountsToolButton::sizeHint() const
|
||||||
|
{
|
||||||
|
QSize size = QToolButton::sizeHint();
|
||||||
|
size.rwidth() *= 3;
|
||||||
|
return size;
|
||||||
|
}
|
||||||
|
@@ -34,6 +34,8 @@ class DLLEXPORT AccountsToolButton : public QToolButton
|
|||||||
public:
|
public:
|
||||||
explicit AccountsToolButton( QWidget* parent = 0 );
|
explicit AccountsToolButton( QWidget* parent = 0 );
|
||||||
|
|
||||||
|
QSize sizeHint() const;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void mousePressEvent( QMouseEvent *event );
|
void mousePressEvent( QMouseEvent *event );
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user