summaryrefslogtreecommitdiff
path: root/noncore/styles/fresh/fresh.cpp
Side-by-side diff
Diffstat (limited to 'noncore/styles/fresh/fresh.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/styles/fresh/fresh.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/noncore/styles/fresh/fresh.cpp b/noncore/styles/fresh/fresh.cpp
index 0730329..831b620 100644
--- a/noncore/styles/fresh/fresh.cpp
+++ b/noncore/styles/fresh/fresh.cpp
@@ -759,88 +759,90 @@ void FreshStyle::drawPopupMenuItem( QPainter* p, bool checkable, int maxpmw, int
if ( dis && !act ) {
p->setPen( g.light() );
p->drawText( x+w-tab-windowsRightBorder-motifItemHMargin-motifItemFrame+1,
y+m+1, tab, h-2*m, text_flags, s.mid( t+1 ));
p->setPen( discol );
}
p->drawText( x+w-tab-windowsRightBorder-motifItemHMargin-motifItemFrame,
y+m, tab, h-2*m, text_flags, s.mid( t+1 ) );
}
if ( dis && !act ) {
p->setPen( g.light() );
p->drawText( x+xm+1, y+m+1, w-xm+1, h-2*m, text_flags, s, t );
p->setPen( discol );
}
p->drawText( x+xm, y+m, w-xm-tab+1, h-2*m, text_flags, s, t );
} else if ( mi->pixmap() ) { // draw pixmap
QPixmap *pixmap = mi->pixmap();
if ( pixmap->depth() == 1 )
p->setBackgroundMode( OpaqueMode );
p->drawPixmap( x+xm, y+motifItemFrame, *pixmap );
if ( pixmap->depth() == 1 )
p->setBackgroundMode( TransparentMode );
}
if ( mi->popup() ) { // draw sub menu arrow
int dim = (h-2*motifItemFrame) / 2;
if ( act ) {
if ( !dis )
discol = white;
QColorGroup g2( discol, g.highlight(),
white, white,
dis ? discol : white,
discol, white );
drawArrow( p, RightArrow, FALSE,
x+w - motifArrowHMargin - motifItemFrame - dim, y+h/2-dim/2,
dim, dim, g2, TRUE );
} else {
drawArrow( p, RightArrow,
FALSE,
x+w - motifArrowHMargin - motifItemFrame - dim, y+h/2-dim/2,
dim, dim, g, mi->isEnabled() );
}
}
#endif
}
//===========================================================================
FreshStyleImpl::FreshStyleImpl()
- : fresh(0), ref(0)
+ : fresh(0)
{
}
FreshStyleImpl::~FreshStyleImpl()
{
// We do not delete the style because Qt does that when a new style
// is set.
}
QStyle *FreshStyleImpl::style()
{
if ( !fresh )
fresh = new FreshStyle();
return fresh;
}
QString FreshStyleImpl::name() const
{
return QString("Fresh");
}
QRESULT FreshStyleImpl::queryInterface( const QUuid &uuid, QUnknownInterface **iface )
{
*iface = 0;
if ( uuid == IID_QUnknown )
*iface = this;
else if ( uuid == IID_Style )
*iface = this;
+ else
+ return QS_FALSE;
if ( *iface )
(*iface)->addRef();
return QS_OK;
}
Q_EXPORT_INTERFACE()
{
Q_CREATE_INSTANCE( FreshStyleImpl )
}