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

* WIP: Small splitter handles, no frame around SuperCollection view.

This commit is contained in:
Christian Muehlhaeuser
2011-02-09 05:44:17 +01:00
parent 1a68116b36
commit 9575dd67f3
7 changed files with 21 additions and 2 deletions

View File

@@ -27,6 +27,7 @@ SET(TRIAL_LIBRARY_PATHS
/usr/lib${LIB_SUFFIX}
/sw/lib${LIB_SUFFIX}
/usr/pkg/lib${LIB_SUFFIX}
/usr/lib64
)
SET(TRIAL_INCLUDE_PATHS
$ENV{CLUCENE_HOME}/include

View File

@@ -82,6 +82,7 @@ PlaylistManager::PlaylistManager( QObject* parent )
m_superCollectionView = new CollectionView();
m_superCollectionFlatModel = new CollectionFlatModel( m_superCollectionView );
m_superCollectionView->setModel( m_superCollectionFlatModel );
m_superCollectionView->setFrameShape( QFrame::NoFrame );
m_superAlbumView = new AlbumView();
m_superAlbumModel = new AlbumModel( m_superAlbumView );

View File

@@ -106,9 +106,7 @@ TopBar::resizeEvent(QResizeEvent* e )
gradient.setColorAt( 1.0, QColor( 63, 63, 63 ) );
QPalette p = palette();
p.setBrush( QPalette::Background, QBrush( gradient ) );
p.setBrush( QPalette::Window, QBrush( gradient ) );
p.setBrush( QPalette::Base, QBrush( gradient ) );
setPalette( p );
}

View File

@@ -8,6 +8,8 @@ AnimatedSplitter::AnimatedSplitter( QWidget* parent )
, m_animateIndex( -1 )
, m_greedyIndex( 0 )
{
setHandleWidth( 1 );
m_timeLine = new QTimeLine( ANIMATION_TIME, this );
m_timeLine->setUpdateInterval( 5 );
m_timeLine->setEasingCurve( QEasingCurve::OutBack );

View File

@@ -1,5 +1,6 @@
#include "proxystyle.h"
#include <QDebug>
#include <QPainter>
#include <QStyleOption>
#include <QWidget>
@@ -11,3 +12,16 @@ ProxyStyle::drawPrimitive( PrimitiveElement pe, const QStyleOption* opt, QPainte
if ( pe != PE_FrameStatusBar )
QProxyStyle::drawPrimitive( pe, opt, p, w );
}
void
ProxyStyle::drawControl( ControlElement ce, const QStyleOption* opt, QPainter* p, const QWidget* w ) const
{
if ( ce == CE_Splitter )
{
p->setPen( QColor( 0x8c, 0x8c, 0x8c ) );
p->drawLine( opt->rect.topLeft(), opt->rect.bottomRight() );
}
else
QProxyStyle::drawControl( ce, opt, p, w );
}

View File

@@ -12,6 +12,7 @@ public:
ProxyStyle() {}
virtual void drawPrimitive( PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w = 0 ) const;
virtual void drawControl( ControlElement ce, const QStyleOption *opt, QPainter *p, const QWidget *w = 0 ) const;
};
#endif // PROXYSTYLE_H

View File

@@ -62,12 +62,14 @@ TomahawkWindow::TomahawkWindow( QWidget* parent )
ui->splitter->setStretchFactor( 0, 1 );
ui->splitter->setStretchFactor( 1, 3 );
ui->splitter->setCollapsible( 1, false );
ui->splitter->setHandleWidth( 1 );
ui->sidebarSplitter->setChildrenCollapsible( false );
ui->sidebarSplitter->setGreedyWidget( 0 );
ui->sidebarSplitter->setStretchFactor( 0, 3 );
ui->sidebarSplitter->setStretchFactor( 1, 1 );
ui->sidebarSplitter->hide( 1, false );
ui->sidebarSplitter->setHandleWidth( 1 );
/* QToolBar* toolbar = addToolBar( "TomahawkToolbar" );
toolbar->setObjectName( "TomahawkToolbar" );