mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 14:16:32 +02:00
and the InfoBar
This commit is contained in:
@@ -44,22 +44,32 @@ InfoBar::InfoBar( QWidget* parent )
|
|||||||
, ui( new Ui::InfoBar )
|
, ui( new Ui::InfoBar )
|
||||||
, m_queryLabel( 0 )
|
, m_queryLabel( 0 )
|
||||||
{
|
{
|
||||||
|
int requiredHeight = 0;
|
||||||
|
|
||||||
ui->setupUi( this );
|
ui->setupUi( this );
|
||||||
TomahawkUtils::unmarginLayout( layout() );
|
TomahawkUtils::unmarginLayout( layout() );
|
||||||
layout()->setContentsMargins( 8, 4, 8, 4 );
|
layout()->setContentsMargins( 8, 4, 8, 4 );
|
||||||
|
requiredHeight += 8; // Top + bottom margins
|
||||||
|
|
||||||
QFont boldFont = ui->captionLabel->font();
|
QFont boldFont = ui->captionLabel->font();
|
||||||
boldFont.setPixelSize( 18 );
|
//boldFont.setPixelSize( 18 );
|
||||||
|
boldFont.setPointSize( 16 );
|
||||||
boldFont.setBold( true );
|
boldFont.setBold( true );
|
||||||
ui->captionLabel->setFont( boldFont );
|
ui->captionLabel->setFont( boldFont );
|
||||||
ui->captionLabel->setElideMode( Qt::ElideRight );
|
ui->captionLabel->setElideMode( Qt::ElideRight );
|
||||||
|
|
||||||
boldFont.setPixelSize( 12 );
|
QFontMetrics boldFontMetrics( boldFont );
|
||||||
|
requiredHeight += boldFontMetrics.height();
|
||||||
|
|
||||||
|
boldFont.setPointSize( 10 );
|
||||||
boldFont.setBold( false );
|
boldFont.setBold( false );
|
||||||
ui->descriptionLabel->setFont( boldFont );
|
ui->descriptionLabel->setFont( boldFont );
|
||||||
|
|
||||||
|
boldFontMetrics = QFontMetrics( boldFont );
|
||||||
|
requiredHeight += boldFontMetrics.height();
|
||||||
|
|
||||||
QFont regFont = ui->longDescriptionLabel->font();
|
QFont regFont = ui->longDescriptionLabel->font();
|
||||||
regFont.setPixelSize( 11 );
|
regFont.setPointSize( 9 );
|
||||||
ui->longDescriptionLabel->setFont( regFont );
|
ui->longDescriptionLabel->setFont( regFont );
|
||||||
|
|
||||||
m_whitePal = ui->captionLabel->palette();
|
m_whitePal = ui->captionLabel->palette();
|
||||||
@@ -70,7 +80,11 @@ InfoBar::InfoBar( QWidget* parent )
|
|||||||
ui->longDescriptionLabel->setPalette( m_whitePal );
|
ui->longDescriptionLabel->setPalette( m_whitePal );
|
||||||
|
|
||||||
ui->captionLabel->setMargin( 6 );
|
ui->captionLabel->setMargin( 6 );
|
||||||
|
requiredHeight += 2*6;
|
||||||
|
|
||||||
ui->descriptionLabel->setMargin( 6 );
|
ui->descriptionLabel->setMargin( 6 );
|
||||||
|
requiredHeight += 2*6;
|
||||||
|
|
||||||
ui->longDescriptionLabel->setMargin( 4 );
|
ui->longDescriptionLabel->setMargin( 4 );
|
||||||
|
|
||||||
ui->captionLabel->setText( QString() );
|
ui->captionLabel->setText( QString() );
|
||||||
@@ -95,8 +109,8 @@ InfoBar::InfoBar( QWidget* parent )
|
|||||||
|
|
||||||
setAutoFillBackground( true );
|
setAutoFillBackground( true );
|
||||||
|
|
||||||
setMinimumHeight( geometry().height() );
|
setMinimumHeight( requiredHeight );
|
||||||
setMaximumHeight( geometry().height() );
|
setMaximumHeight( requiredHeight );
|
||||||
|
|
||||||
createTile();
|
createTile();
|
||||||
|
|
||||||
|
@@ -7,11 +7,11 @@
|
|||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>774</width>
|
<width>774</width>
|
||||||
<height>80</height>
|
<height>72</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
<sizepolicy hsizetype="Expanding" vsizetype="Preferred">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@@ -28,9 +28,6 @@
|
|||||||
<layout class="QVBoxLayout" name="verticalLayout_3">
|
<layout class="QVBoxLayout" name="verticalLayout_3">
|
||||||
<item>
|
<item>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
<property name="sizeConstraint">
|
|
||||||
<enum>QLayout::SetDefaultConstraint</enum>
|
|
||||||
</property>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="QLabel" name="imageLabel">
|
<widget class="QLabel" name="imageLabel">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
@@ -59,16 +56,13 @@
|
|||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout">
|
<layout class="QVBoxLayout" name="verticalLayout">
|
||||||
<property name="sizeConstraint">
|
|
||||||
<enum>QLayout::SetDefaultConstraint</enum>
|
|
||||||
</property>
|
|
||||||
<property name="bottomMargin">
|
<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="Fixed">
|
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@@ -81,7 +75,7 @@
|
|||||||
<item>
|
<item>
|
||||||
<widget class="ElidedLabel" name="descriptionLabel">
|
<widget class="ElidedLabel" name="descriptionLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
<sizepolicy hsizetype="Preferred" vsizetype="Preferred">
|
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
|
||||||
<horstretch>0</horstretch>
|
<horstretch>0</horstretch>
|
||||||
<verstretch>0</verstretch>
|
<verstretch>0</verstretch>
|
||||||
</sizepolicy>
|
</sizepolicy>
|
||||||
@@ -104,16 +98,13 @@
|
|||||||
<property name="sizeHint" stdset="0">
|
<property name="sizeHint" stdset="0">
|
||||||
<size>
|
<size>
|
||||||
<width>16</width>
|
<width>16</width>
|
||||||
<height>20</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
</spacer>
|
</spacer>
|
||||||
</item>
|
</item>
|
||||||
<item>
|
<item>
|
||||||
<layout class="QVBoxLayout" name="verticalLayout_2">
|
<layout class="QVBoxLayout" name="verticalLayout_2">
|
||||||
<property name="sizeConstraint">
|
|
||||||
<enum>QLayout::SetMaximumSize</enum>
|
|
||||||
</property>
|
|
||||||
<item>
|
<item>
|
||||||
<widget class="ElidedLabel" name="longDescriptionLabel">
|
<widget class="ElidedLabel" name="longDescriptionLabel">
|
||||||
<property name="sizePolicy">
|
<property name="sizePolicy">
|
||||||
|
Reference in New Issue
Block a user