mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-01 03:40:16 +02:00
* Made deprecated InfoBar look the same as the other headers.
This commit is contained in:
@@ -35,7 +35,7 @@
|
|||||||
#include "utils/Logger.h"
|
#include "utils/Logger.h"
|
||||||
|
|
||||||
#define ANIMATION_TIME 400
|
#define ANIMATION_TIME 400
|
||||||
#define IMAGE_HEIGHT 64
|
#define IMAGE_HEIGHT 48
|
||||||
|
|
||||||
using namespace Tomahawk;
|
using namespace Tomahawk;
|
||||||
|
|
||||||
@@ -46,12 +46,9 @@ InfoBar::InfoBar( QWidget* parent )
|
|||||||
, m_queryLabel( 0 )
|
, m_queryLabel( 0 )
|
||||||
{
|
{
|
||||||
ui->setupUi( this );
|
ui->setupUi( this );
|
||||||
TomahawkUtils::unmarginLayout( layout() );
|
|
||||||
layout()->setContentsMargins( 8, 4, 8, 4 );
|
|
||||||
|
|
||||||
QFont boldFont = ui->captionLabel->font();
|
QFont boldFont = ui->captionLabel->font();
|
||||||
boldFont.setPointSize( TomahawkUtils::defaultFontSize() + 4 );
|
boldFont.setPointSize( TomahawkUtils::defaultFontSize() + 4 );
|
||||||
boldFont.setBold( true );
|
|
||||||
ui->captionLabel->setFont( boldFont );
|
ui->captionLabel->setFont( boldFont );
|
||||||
ui->captionLabel->setElideMode( Qt::ElideRight );
|
ui->captionLabel->setElideMode( Qt::ElideRight );
|
||||||
|
|
||||||
@@ -66,14 +63,15 @@ InfoBar::InfoBar( QWidget* parent )
|
|||||||
ui->longDescriptionLabel->setFont( regFont );
|
ui->longDescriptionLabel->setFont( regFont );
|
||||||
|
|
||||||
m_whitePal = ui->captionLabel->palette();
|
m_whitePal = ui->captionLabel->palette();
|
||||||
m_whitePal.setColor( QPalette::Foreground, Qt::white );
|
m_whitePal.setColor( QPalette::Foreground, TomahawkStyle::HEADER_TEXT );
|
||||||
|
m_whitePal.setBrush( backgroundRole(), TomahawkStyle::HEADER_BACKGROUND );
|
||||||
|
|
||||||
ui->captionLabel->setPalette( m_whitePal );
|
ui->captionLabel->setPalette( m_whitePal );
|
||||||
ui->descriptionLabel->setPalette( m_whitePal );
|
ui->descriptionLabel->setPalette( m_whitePal );
|
||||||
ui->longDescriptionLabel->setPalette( m_whitePal );
|
ui->longDescriptionLabel->setPalette( m_whitePal );
|
||||||
|
|
||||||
ui->captionLabel->setMargin( 2 );
|
ui->captionLabel->setMargin( 2 );
|
||||||
ui->descriptionLabel->setMargin( 1 );
|
ui->descriptionLabel->setMargin( 2 );
|
||||||
ui->longDescriptionLabel->setMargin( 4 );
|
ui->longDescriptionLabel->setMargin( 4 );
|
||||||
|
|
||||||
ui->captionLabel->setText( QString() );
|
ui->captionLabel->setText( QString() );
|
||||||
@@ -81,6 +79,11 @@ InfoBar::InfoBar( QWidget* parent )
|
|||||||
ui->longDescriptionLabel->setText( QString() );
|
ui->longDescriptionLabel->setText( QString() );
|
||||||
ui->imageLabel->setText( QString() );
|
ui->imageLabel->setText( QString() );
|
||||||
|
|
||||||
|
ui->lineAbove->setStyleSheet( QString( "QFrame { border: 1px solid %1; }" ).arg( TomahawkStyle::HEADER_BACKGROUND.name() ) );
|
||||||
|
ui->lineAbove->setFrameShape( QFrame::HLine );
|
||||||
|
ui->lineBelow->setStyleSheet( QString( "QFrame { border: 1px solid black; }" ) );
|
||||||
|
ui->lineBelow->setFrameShape( QFrame::HLine );
|
||||||
|
|
||||||
m_queryLabel = new QueryLabel( this );
|
m_queryLabel = new QueryLabel( this );
|
||||||
m_queryLabel->setType( QueryLabel::Artist );
|
m_queryLabel->setType( QueryLabel::Artist );
|
||||||
m_queryLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
m_queryLabel->setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Preferred );
|
||||||
@@ -98,9 +101,10 @@ InfoBar::InfoBar( QWidget* parent )
|
|||||||
QPalette pal = m_whitePal;
|
QPalette pal = m_whitePal;
|
||||||
pal.setBrush( backgroundRole(), TomahawkStyle::HEADER_BACKGROUND );
|
pal.setBrush( backgroundRole(), TomahawkStyle::HEADER_BACKGROUND );
|
||||||
|
|
||||||
|
setSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed );
|
||||||
|
setFixedHeight( 58 );
|
||||||
setAutoFillBackground( true );
|
setAutoFillBackground( true );
|
||||||
setPalette( pal );
|
setPalette( pal );
|
||||||
setFixedHeight( 80 );
|
|
||||||
|
|
||||||
connect( ViewManager::instance(), SIGNAL( filterAvailable( bool ) ), SLOT( setFilterAvailable( bool ) ) );
|
connect( ViewManager::instance(), SIGNAL( filterAvailable( bool ) ), SLOT( setFilterAvailable( bool ) ) );
|
||||||
}
|
}
|
||||||
|
@@ -26,43 +26,70 @@
|
|||||||
<string notr="true" extracomment="not translatable because not shown to the user">InfoBar</string>
|
<string notr="true" extracomment="not translatable because not shown to the user">InfoBar</string>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
|
<property name="margin">
|
||||||
|
<number>0</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<property name="spacing">
|
||||||
|
<number>8</number>
|
||||||
|
</property>
|
||||||
|
<property name="leftMargin">
|
||||||
|
<number>8</number>
|
||||||
|
</property>
|
||||||
|
<property name="topMargin">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
|
<property name="rightMargin">
|
||||||
|
<number>8</number>
|
||||||
|
</property>
|
||||||
|
<property name="bottomMargin">
|
||||||
|
<number>4</number>
|
||||||
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="imageLabel">
|
<widget class="QLabel" name="imageLabel">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>64</width>
|
<width>48</width>
|
||||||
<height>64</height>
|
<height>48</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<spacer name="horizontalSpacer">
|
<layout class="QVBoxLayout" name="verticalLayout" stretch="0,0,0">
|
||||||
<property name="orientation">
|
<property name="spacing">
|
||||||
<enum>Qt::Horizontal</enum>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizeType">
|
<property name="margin">
|
||||||
<enum>QSizePolicy::Fixed</enum>
|
|
||||||
</property>
|
|
||||||
<property name="sizeHint" stdset="0">
|
|
||||||
<size>
|
|
||||||
<width>16</width>
|
|
||||||
<height>20</height>
|
|
||||||
</size>
|
|
||||||
</property>
|
|
||||||
</spacer>
|
|
||||||
</item>
|
|
||||||
<item>
|
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
|
||||||
<property name="bottomMargin">
|
|
||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<item>
|
<item>
|
||||||
<widget class="ElidedLabel" name="captionLabel">
|
<widget class="ElidedLabel" name="captionLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
|
<horstretch>0</horstretch>
|
||||||
|
<verstretch>0</verstretch>
|
||||||
|
</sizepolicy>
|
||||||
|
</property>
|
||||||
|
<property name="font">
|
||||||
|
<font>
|
||||||
|
<weight>75</weight>
|
||||||
|
<bold>true</bold>
|
||||||
|
</font>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="ElidedLabel" name="descriptionLabel">
|
||||||
|
<property name="sizePolicy">
|
||||||
|
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@@ -73,17 +100,20 @@
|
|||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<widget class="ElidedLabel" name="descriptionLabel">
|
<spacer name="verticalSpacer">
|
||||||
<property name="sizePolicy">
|
<property name="orientation">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
|
<enum>Qt::Vertical</enum>
|
||||||
<horstretch>0</horstretch>
|
|
||||||
<verstretch>0</verstretch>
|
|
||||||
</sizepolicy>
|
|
||||||
</property>
|
</property>
|
||||||
<property name="alignment">
|
<property name="sizeType">
|
||||||
<set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
|
<enum>QSizePolicy::MinimumExpanding</enum>
|
||||||
</property>
|
</property>
|
||||||
</widget>
|
<property name="sizeHint" stdset="0">
|
||||||
|
<size>
|
||||||
|
<width>20</width>
|
||||||
|
<height>1</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
@@ -150,6 +180,32 @@
|
|||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</item>
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="Line" name="lineAbove">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>1</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
<item>
|
||||||
|
<widget class="Line" name="lineBelow">
|
||||||
|
<property name="maximumSize">
|
||||||
|
<size>
|
||||||
|
<width>16777215</width>
|
||||||
|
<height>1</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
</widget>
|
</widget>
|
||||||
<customwidgets>
|
<customwidgets>
|
||||||
|
Reference in New Issue
Block a user