diff --git a/src/libtomahawk/utils/proxystyle.cpp b/src/libtomahawk/utils/proxystyle.cpp index 038208a85..2e358751a 100644 --- a/src/libtomahawk/utils/proxystyle.cpp +++ b/src/libtomahawk/utils/proxystyle.cpp @@ -24,8 +24,8 @@ #include <QStyleOption> #include <QWidget> -#define ARROW_WIDTH 8 -#define ARROW_HEIGHT 8 +#define ARROW_WIDTH 7 +#define ARROW_HEIGHT 7 void diff --git a/src/sourcetree/sourcetreeview.cpp b/src/sourcetree/sourcetreeview.cpp index 8b21bb176..28408852b 100644 --- a/src/sourcetree/sourcetreeview.cpp +++ b/src/sourcetree/sourcetreeview.cpp @@ -38,6 +38,7 @@ using namespace Tomahawk; +#define TREEVIEW_INDENT_ADD -7 class SourceDelegate : public QStyledItemDelegate { @@ -79,7 +80,7 @@ SourceTreeView::SourceTreeView( QWidget* parent ) setDropIndicatorShown( false ); setAllColumnsShowFocus( true ); setUniformRowHeights( false ); - setIndentation( 16 ); + setIndentation( 14 ); setSortingEnabled( true ); sortByColumn( 0, Qt::AscendingOrder ); @@ -594,7 +595,23 @@ SourceDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option, co } else { - QStyledItemDelegate::paint( painter, o, index ); + QStyleOptionViewItemV4 opt = option; + initStyleOption( &opt, index ); + + // shrink the indentations. count how indented this item is and remove it + int indentMult = 0; + QModelIndex counter = index; + while ( counter.parent().isValid() ) + { + indentMult++; + counter = counter.parent(); + } + int realX = opt.rect.x() + indentMult * TREEVIEW_INDENT_ADD; + + opt.rect.setX( realX ); + const QWidget *widget = opt.widget; + QStyle *style = widget ? widget->style() : QApplication::style(); + style->drawControl( QStyle::CE_ItemViewItem, &opt, painter, widget ); } #ifdef Q_WS_MAC