mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-09 07:36:48 +02:00
Fix GridView layout bug on some GTK styles.
This commit is contained in:
@@ -232,12 +232,10 @@ GridView::verifySize()
|
|||||||
if ( !autoResize() || !m_model )
|
if ( !autoResize() || !m_model )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
#ifdef Q_WS_X11
|
|
||||||
// int scrollbar = verticalScrollBar()->isVisible() ? verticalScrollBar()->width() + 16 : 0;
|
|
||||||
int scrollbar = 0; verticalScrollBar()->rect().width();
|
|
||||||
#else
|
|
||||||
int scrollbar = verticalScrollBar()->rect().width();
|
int scrollbar = verticalScrollBar()->rect().width();
|
||||||
#endif
|
|
||||||
|
if ( rect().width() - contentsRect().width() > scrollbar ) //HACK: if the contentsRect includes the scrollbar
|
||||||
|
scrollbar = 0; //don't count it any more
|
||||||
|
|
||||||
const int rectWidth = contentsRect().width() - scrollbar - 3;
|
const int rectWidth = contentsRect().width() - scrollbar - 3;
|
||||||
const int itemWidth = 160;
|
const int itemWidth = 160;
|
||||||
@@ -274,12 +272,10 @@ GridView::layoutItems()
|
|||||||
{
|
{
|
||||||
if ( autoFitItems() && m_model )
|
if ( autoFitItems() && m_model )
|
||||||
{
|
{
|
||||||
#ifdef Q_WS_X11
|
|
||||||
// int scrollbar = verticalScrollBar()->isVisible() ? verticalScrollBar()->width() + 16 : 0;
|
|
||||||
int scrollbar = 0; verticalScrollBar()->rect().width();
|
|
||||||
#else
|
|
||||||
int scrollbar = verticalScrollBar()->rect().width();
|
int scrollbar = verticalScrollBar()->rect().width();
|
||||||
#endif
|
|
||||||
|
if ( rect().width() - contentsRect().width() >= scrollbar ) //HACK: if the contentsRect includes the scrollbar
|
||||||
|
scrollbar = 0; //don't count it any more
|
||||||
|
|
||||||
const int rectWidth = contentsRect().width() - scrollbar - 3;
|
const int rectWidth = contentsRect().width() - scrollbar - 3;
|
||||||
const int itemWidth = 160;
|
const int itemWidth = 160;
|
||||||
|
Reference in New Issue
Block a user