1
0
mirror of https://github.com/tomahawk-player/tomahawk.git synced 2025-07-31 03:10:12 +02:00

* Keep width/height ratio for items when auto-resizing GridViews.

This commit is contained in:
Christian Muehlhaeuser
2014-08-19 06:10:28 +02:00
parent b8ded4fde2
commit e05d327aa5
5 changed files with 6 additions and 5 deletions

View File

@@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> === /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
* *
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org> * Copyright 2010-2014, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org> * Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
* *
* Tomahawk is free software: you can redistribute it and/or modify * Tomahawk is free software: you can redistribute it and/or modify
@@ -282,7 +282,7 @@ GridView::layoutItems()
const int extraSpace = remSpace / itemsPerRow; const int extraSpace = remSpace / itemsPerRow;
const int newItemWidth = itemWidth + extraSpace - spacing(); const int newItemWidth = itemWidth + extraSpace - spacing();
m_delegate->setItemSize( QSize( newItemWidth, newItemWidth + 32 ) ); m_delegate->setItemSize( QSize( newItemWidth, newItemWidth + ( m_itemSize.height() - m_itemSize.width() ) ) );
verifySize(); verifySize();
if ( !m_inited ) if ( !m_inited )

View File

@@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> === /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
* *
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org> * Copyright 2010-2014, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org> * Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
* *
* Tomahawk is free software: you can redistribute it and/or modify * Tomahawk is free software: you can redistribute it and/or modify

View File

@@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> === /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
* *
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org> * Copyright 2010-2014, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org> * Copyright 2010-2012, Jeff Mitchell <jeff@tomahawk-player.org>
* *
* Tomahawk is free software: you can redistribute it and/or modify * Tomahawk is free software: you can redistribute it and/or modify

View File

@@ -1,6 +1,6 @@
/* === This file is part of Tomahawk Player - <http://tomahawk-player.org> === /* === This file is part of Tomahawk Player - <http://tomahawk-player.org> ===
* *
* Copyright 2010-2011, Christian Muehlhaeuser <muesli@tomahawk-player.org> * Copyright 2010-2014, Christian Muehlhaeuser <muesli@tomahawk-player.org>
* Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org> * Copyright 2010-2011, Jeff Mitchell <jeff@tomahawk-player.org>
* *
* Tomahawk is free software: you can redistribute it and/or modify * Tomahawk is free software: you can redistribute it and/or modify

View File

@@ -80,6 +80,7 @@ TrackInfoWidget::TrackInfoWidget( const Tomahawk::query_ptr& query, QWidget* par
ui->similarTracksView->setEmptyTip( tr( "Sorry, but we could not find similar tracks for this song!" ) ); ui->similarTracksView->setEmptyTip( tr( "Sorry, but we could not find similar tracks for this song!" ) );
ui->similarTracksView->setAutoResize( true ); ui->similarTracksView->setAutoResize( true );
ui->similarTracksView->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff ); ui->similarTracksView->setVerticalScrollBarPolicy( Qt::ScrollBarAlwaysOff );
ui->similarTracksView->setItemSize( QSize( 190, 190 + 56 ) );
// TomahawkUtils::styleScrollBar( ui->similarTracksView->verticalScrollBar() ); // TomahawkUtils::styleScrollBar( ui->similarTracksView->verticalScrollBar() );
// ui->similarTracksView->setStyleSheet( "QListView { background-color: transparent; } QListView::item { background-color: transparent; }" ); // ui->similarTracksView->setStyleSheet( "QListView { background-color: transparent; } QListView::item { background-color: transparent; }" );