mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-08-06 22:26:32 +02:00
* Draw a horizontal splitter.
This commit is contained in:
@@ -93,15 +93,35 @@ ProxyStyle::drawControl( ControlElement ce, const QStyleOption* opt, QPainter* p
|
|||||||
// We must special-case this because of the AnimatedSplitterHandle which has a
|
// We must special-case this because of the AnimatedSplitterHandle which has a
|
||||||
// SizeHint of 0,0.
|
// SizeHint of 0,0.
|
||||||
if ( splitter->orientation() == Qt::Vertical )
|
if ( splitter->orientation() == Qt::Vertical )
|
||||||
|
{
|
||||||
p->drawLine( opt->rect.topLeft(), opt->rect.topRight() );
|
p->drawLine( opt->rect.topLeft(), opt->rect.topRight() );
|
||||||
|
}
|
||||||
else
|
else
|
||||||
p->drawLine( opt->rect.topLeft(), opt->rect.bottomRight() );
|
{
|
||||||
|
if ( splitter->handleWidth() == 1 )
|
||||||
|
{
|
||||||
|
p->setPen( TomahawkStyle::BORDER_LINE );
|
||||||
|
p->drawLine( opt->rect.topLeft(), opt->rect.bottomLeft() );
|
||||||
|
}
|
||||||
|
else if ( splitter->handleWidth() == 3 )
|
||||||
|
{
|
||||||
|
p->setPen( TomahawkStyle::BORDER_LINE );
|
||||||
|
p->drawLine( opt->rect.topLeft(), opt->rect.bottomLeft() );
|
||||||
|
p->setPen( TomahawkStyle::BORDER_LINE.darker() );
|
||||||
|
p->drawLine( opt->rect.topLeft() + QPoint( 1, 0 ), opt->rect.bottomLeft() + QPoint( 1, 0 ) );
|
||||||
|
p->setPen( TomahawkStyle::BORDER_LINE );
|
||||||
|
p->drawLine( opt->rect.topLeft() + QPoint( 2, 0 ), opt->rect.bottomLeft() + QPoint( 2, 0 ) );
|
||||||
|
}
|
||||||
|
else
|
||||||
|
Q_ASSERT( false );
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
QProxyStyle::drawControl( ce, opt, p, w );
|
QProxyStyle::drawControl( ce, opt, p, w );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
QSize
|
QSize
|
||||||
ProxyStyle::sizeFromContents( QStyle::ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget ) const
|
ProxyStyle::sizeFromContents( QStyle::ContentsType type, const QStyleOption *option, const QSize &size, const QWidget *widget ) const
|
||||||
{
|
{
|
||||||
@@ -109,9 +129,9 @@ ProxyStyle::sizeFromContents( QStyle::ContentsType type, const QStyleOption *opt
|
|||||||
{
|
{
|
||||||
const QSplitter* splitter = qobject_cast< const QSplitter* >( widget );
|
const QSplitter* splitter = qobject_cast< const QSplitter* >( widget );
|
||||||
if ( splitter->orientation() == Qt::Horizontal )
|
if ( splitter->orientation() == Qt::Horizontal )
|
||||||
return QSize( 1, size.height() );
|
return QSize( 2, size.height() );
|
||||||
else
|
else
|
||||||
return QSize( size.width(), 1 );
|
return QSize( size.width(), 2 );
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
return QProxyStyle::sizeFromContents( type, option, size, widget );
|
return QProxyStyle::sizeFromContents( type, option, size, widget );
|
||||||
|
Reference in New Issue
Block a user