Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
openSUSE:Leap:42.3
breeze4-style
add-support-for-Q3ListView-to-the-KDE4-style.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File add-support-for-Q3ListView-to-the-KDE4-style.patch of Package breeze4-style
diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp index 8a02d75..c1b9670 100644 --- a/kstyle/breezestyle.cpp +++ b/kstyle/breezestyle.cpp @@ -929,6 +929,7 @@ namespace Breeze case CC_ToolButton: fcn = &Style::drawToolButtonComplexControl; break; case CC_ComboBox: fcn = &Style::drawComboBoxComplexControl; break; case CC_SpinBox: fcn = &Style::drawSpinBoxComplexControl; break; + case CC_Q3ListView: fcn = &Style::drawQ3ListViewComplexControl; break; case CC_Slider: fcn = &Style::drawSliderComplexControl; break; case CC_Dial: fcn = &Style::drawDialComplexControl; break; case CC_ScrollBar: fcn = &Style::drawScrollBarComplexControl; break; @@ -6122,6 +6216,67 @@ namespace Breeze } //______________________________________________________________ + bool Style::drawQ3ListViewComplexControl( const QStyleOptionComplex* option, QPainter* painter, const QWidget* widget ) const + { + + const QStyleOptionQ3ListView* optListView( qstyleoption_cast<const QStyleOptionQ3ListView*>( option ) ); + if( !optListView ) return true; + + // this is copied from skulpture code + // Copyright ( c ) 2007-2010 Christoph Feck <christoph@maxiom.de> + if( optListView->subControls & QStyle::SC_Q3ListView ) + { + painter->fillRect( + optListView->rect, + optListView->viewportPalette.brush( optListView->viewportBGRole ) ); + } + + if( optListView->subControls & QStyle::SC_Q3ListViewBranch ) + { + + QStyleOption opt = *static_cast<const QStyleOption*>( option ); + int y = optListView->rect.y(); + + for ( int i = 1; i < optListView->items.size(); ++i ) + { + QStyleOptionQ3ListViewItem item = optListView->items.at( i ); + if( y + item.totalHeight > 0 && y < optListView->rect.height() ) + { + opt.state = QStyle::State_Item; + if ( i + 1 < optListView->items.size() ) + { opt.state |= QStyle::State_Sibling; } + + if( + item.features & QStyleOptionQ3ListViewItem::Expandable + || ( item.childCount > 0 && item.height > 0 ) ) + { opt.state |= QStyle::State_Children | ( item.state & QStyle::State_Open ); } + + opt.rect = QRect( optListView->rect.left(), y, optListView->rect.width(), item.height ); + painter->save(); + drawIndicatorBranchPrimitive( &opt, painter, widget ); + painter->restore(); + + if( ( opt.state & QStyle::State_Sibling ) && item.height < item.totalHeight ) + { + opt.state = QStyle::State_Sibling; + opt.rect = QRect( + optListView->rect.left(), y + item.height, + optListView->rect.width(), item.totalHeight - item.height ); + painter->save(); + drawIndicatorBranchPrimitive( &opt, painter, widget ); + painter->restore(); + } + } + + y += item.totalHeight; + } + } + + return true; + + } + + //______________________________________________________________ bool Style::drawSliderComplexControl( const QStyleOptionComplex* option, QPainter* painter, const QWidget* widget ) const { diff --git a/kstyle/breezestyle.h b/kstyle/breezestyle.h index a627252..dcbfe4a 100644 --- a/kstyle/breezestyle.h +++ b/kstyle/breezestyle.h @@ -320,6 +320,7 @@ namespace Breeze bool drawToolButtonComplexControl( const QStyleOptionComplex*, QPainter*, const QWidget* ) const; bool drawComboBoxComplexControl( const QStyleOptionComplex*, QPainter*, const QWidget* ) const; bool drawSpinBoxComplexControl( const QStyleOptionComplex*, QPainter*, const QWidget* ) const; + bool drawQ3ListViewComplexControl( const QStyleOptionComplex*, QPainter*, const QWidget* ) const; bool drawSliderComplexControl( const QStyleOptionComplex*, QPainter*, const QWidget* ) const; bool drawDialComplexControl( const QStyleOptionComplex*, QPainter*, const QWidget* ) const; bool drawScrollBarComplexControl( const QStyleOptionComplex*, QPainter*, const QWidget* ) const;
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor