mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-07 06:36:55 +02:00
Consistent size for all headers in the view
This commit is contained in:
@@ -62,6 +62,9 @@
|
|||||||
namespace TomahawkUtils
|
namespace TomahawkUtils
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|
||||||
|
static int s_headerHeight = 0;
|
||||||
|
|
||||||
#ifdef Q_WS_MAC
|
#ifdef Q_WS_MAC
|
||||||
QString
|
QString
|
||||||
appSupportFolderPath()
|
appSupportFolderPath()
|
||||||
@@ -445,8 +448,8 @@ unmarginLayout( QLayout* layout )
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QWeakPointer< QNetworkAccessManager > s_nam;
|
static QWeakPointer< QNetworkAccessManager > s_nam;
|
||||||
NetworkProxyFactory* s_proxyFactory = 0;
|
static NetworkProxyFactory* s_proxyFactory = 0;
|
||||||
|
|
||||||
|
|
||||||
QList< QNetworkProxy >
|
QList< QNetworkProxy >
|
||||||
@@ -650,4 +653,17 @@ crash()
|
|||||||
*a = 1;
|
*a = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
headerHeight()
|
||||||
|
{
|
||||||
|
return s_headerHeight;
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
setHeaderHeight( int height )
|
||||||
|
{
|
||||||
|
s_headerHeight = height;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} // ns
|
} // ns
|
||||||
|
@@ -101,6 +101,9 @@ namespace TomahawkUtils
|
|||||||
DLLEXPORT QPixmap createAvatarFrame( const QPixmap &avatar );
|
DLLEXPORT QPixmap createAvatarFrame( const QPixmap &avatar );
|
||||||
|
|
||||||
DLLEXPORT void crash();
|
DLLEXPORT void crash();
|
||||||
|
|
||||||
|
DLLEXPORT int headerHeight();
|
||||||
|
DLLEXPORT void setHeaderHeight( int height );
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif // TOMAHAWKUTILS_H
|
#endif // TOMAHAWKUTILS_H
|
||||||
|
@@ -23,9 +23,10 @@
|
|||||||
|
|
||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
#include "utils/stylehelper.h"
|
#include "utils/stylehelper.h"
|
||||||
|
#include "utils/tomahawkutils.h"
|
||||||
|
|
||||||
#define FONT_SIZE 16
|
|
||||||
|
|
||||||
|
static const int s_defaultFontSize = 12;
|
||||||
|
|
||||||
HeaderLabel::HeaderLabel( QWidget* parent )
|
HeaderLabel::HeaderLabel( QWidget* parent )
|
||||||
: QLabel( parent )
|
: QLabel( parent )
|
||||||
@@ -33,10 +34,10 @@ HeaderLabel::HeaderLabel( QWidget* parent )
|
|||||||
{
|
{
|
||||||
QFont f( font() );
|
QFont f( font() );
|
||||||
f.setBold( true );
|
f.setBold( true );
|
||||||
f.setPixelSize( 12 );
|
f.setPixelSize( s_defaultFontSize );
|
||||||
|
|
||||||
setFont( f );
|
setFont( f );
|
||||||
setFixedHeight( sizeHint().height() + 8 );
|
setFixedHeight( TomahawkUtils::headerHeight() );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -51,6 +52,12 @@ HeaderLabel::sizeHint() const
|
|||||||
return QLabel::sizeHint();
|
return QLabel::sizeHint();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int
|
||||||
|
HeaderLabel::defaultFontSize()
|
||||||
|
{
|
||||||
|
return s_defaultFontSize;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
HeaderLabel::mousePressEvent( QMouseEvent* event )
|
HeaderLabel::mousePressEvent( QMouseEvent* event )
|
||||||
|
@@ -39,6 +39,8 @@ public:
|
|||||||
QSize minimumSizeHint() const { return sizeHint(); }
|
QSize minimumSizeHint() const { return sizeHint(); }
|
||||||
QSize sizeHint() const;
|
QSize sizeHint() const;
|
||||||
|
|
||||||
|
static int defaultFontSize();
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void clicked();
|
void clicked();
|
||||||
|
|
||||||
|
@@ -20,6 +20,7 @@
|
|||||||
|
|
||||||
#include "combobox.h"
|
#include "combobox.h"
|
||||||
#include "utils/stylehelper.h"
|
#include "utils/stylehelper.h"
|
||||||
|
#include "utils/tomahawkutils.h"
|
||||||
|
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
@@ -37,6 +38,7 @@ SiblingCrumbButton::SiblingCrumbButton(
|
|||||||
: BreadcrumbButtonBase(parent),
|
: BreadcrumbButtonBase(parent),
|
||||||
m_index(index), m_combo( new ComboBox(this) )
|
m_index(index), m_combo( new ComboBox(this) )
|
||||||
{
|
{
|
||||||
|
setFixedHeight( TomahawkUtils::headerHeight() );
|
||||||
m_combo->setSizeAdjustPolicy( QComboBox::AdjustToContents );
|
m_combo->setSizeAdjustPolicy( QComboBox::AdjustToContents );
|
||||||
setIndex(index);
|
setIndex(index);
|
||||||
connect(m_combo, SIGNAL(activated(int)), SLOT(comboboxActivated(int)));
|
connect(m_combo, SIGNAL(activated(int)), SLOT(comboboxActivated(int)));
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
*
|
*
|
||||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||||
|
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
|
||||||
*
|
*
|
||||||
* Tomahawk is free software: you can redistribute it and/or modify
|
* Tomahawk is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -57,6 +58,7 @@
|
|||||||
#include "utils/spotifyparser.h"
|
#include "utils/spotifyparser.h"
|
||||||
#include "dropjob.h"
|
#include "dropjob.h"
|
||||||
#include "EchonestCatalogSynchronizer.h"
|
#include "EchonestCatalogSynchronizer.h"
|
||||||
|
#include "widgets/HeaderLabel.h"
|
||||||
|
|
||||||
#include "audio/audioengine.h"
|
#include "audio/audioengine.h"
|
||||||
#include "utils/xspfloader.h"
|
#include "utils/xspfloader.h"
|
||||||
@@ -148,6 +150,11 @@ TomahawkApp::init()
|
|||||||
setQuitOnLastWindowClosed( false );
|
setQuitOnLastWindowClosed( false );
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
QFont f = APP->font();
|
||||||
|
f.setPixelSize( HeaderLabel::defaultFontSize() );
|
||||||
|
QFontMetrics fm( f );
|
||||||
|
TomahawkUtils::setHeaderHeight( fm.height() + 8 );
|
||||||
|
|
||||||
registerMetaTypes();
|
registerMetaTypes();
|
||||||
|
|
||||||
new TomahawkSettings( this );
|
new TomahawkSettings( this );
|
||||||
|
@@ -1,6 +1,7 @@
|
|||||||
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
|
||||||
*
|
*
|
||||||
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org>
|
||||||
|
* Copyright 2010-2011, Leo Franchi <lfranchi@kde.org>
|
||||||
*
|
*
|
||||||
* Tomahawk is free software: you can redistribute it and/or modify
|
* Tomahawk is free software: you can redistribute it and/or modify
|
||||||
* it under the terms of the GNU General Public License as published by
|
* it under the terms of the GNU General Public License as published by
|
||||||
@@ -69,6 +70,7 @@
|
|||||||
#include "utils/logger.h"
|
#include "utils/logger.h"
|
||||||
#include "jobview/JobStatusModel.h"
|
#include "jobview/JobStatusModel.h"
|
||||||
#include "LoadXSPFDialog.h"
|
#include "LoadXSPFDialog.h"
|
||||||
|
#include <widgets/HeaderLabel.h>
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user