From a5d67f1912f0768406eda636bfb590b7f3900a99 Mon Sep 17 00:00:00 2001 From: Christian Muehlhaeuser Date: Mon, 6 Aug 2012 02:26:31 +0200 Subject: [PATCH] * Fixed sidebar sizehints. --- src/sourcetree/SourceDelegate.cpp | 4 ++-- src/sourcetree/SourceTreeView.cpp | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sourcetree/SourceDelegate.cpp b/src/sourcetree/SourceDelegate.cpp index 38f4f10bf..17e2717ea 100644 --- a/src/sourcetree/SourceDelegate.cpp +++ b/src/sourcetree/SourceDelegate.cpp @@ -89,7 +89,7 @@ SourceDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelIndex& if ( type == SourcesModel::Collection ) { - return QSize( option.rect.width(), option.fontMetrics.height() * 2.8 ); + return QSize( option.rect.width(), option.fontMetrics.height() * 3.0 ); } else if ( type == SourcesModel::Divider ) { @@ -114,7 +114,7 @@ SourceDelegate::sizeHint( const QStyleOptionViewItem& option, const QModelIndex& return m_expandedMap.value( index )->size(); } else - return QSize( option.rect.width(), option.fontMetrics.height() * 1.2 ); //QStyledItemDelegate::sizeHint( option, index ) ); + return QSize( option.rect.width(), option.fontMetrics.height() * 1.4 ); //QStyledItemDelegate::sizeHint( option, index ) ); } diff --git a/src/sourcetree/SourceTreeView.cpp b/src/sourcetree/SourceTreeView.cpp index 7549291cb..e0499e333 100644 --- a/src/sourcetree/SourceTreeView.cpp +++ b/src/sourcetree/SourceTreeView.cpp @@ -70,11 +70,12 @@ SourceTreeView::SourceTreeView( QWidget* parent ) QFont fnt; fnt.setPointSize( font().pointSize() - 1 ); + setFont( fnt ); + QFontMetrics fm( fnt ); // This is sort of the longest string in there. With translations // we will never get it right so setting it to something reasonable for the average case setMinimumWidth( fm.width( "Track Album Artist Local Top10") ); - setFont( fnt ); setHeaderHidden( true ); setRootIsDecorated( true );