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