|
|
@ -492,9 +492,14 @@ bool LiquidStyle::isPlain() const {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LiquidStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p,
|
|
|
|
void LiquidStyle::drawPrimitive( PrimitiveElement pe,
|
|
|
|
const TQRect &r, const TQColorGroup &cg,
|
|
|
|
TQPainter *p,
|
|
|
|
SFlags flags, const TQStyleOption &opt ) const
|
|
|
|
const TQStyleControlElementData &ceData,
|
|
|
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
|
|
|
const TQRect &r,
|
|
|
|
|
|
|
|
const TQColorGroup &cg,
|
|
|
|
|
|
|
|
SFlags flags,
|
|
|
|
|
|
|
|
const TQStyleOption &opt ) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool down = flags & Style_Down;
|
|
|
|
bool down = flags & Style_Down;
|
|
|
|
bool on = flags & Style_On;
|
|
|
|
bool on = flags & Style_On;
|
|
|
@ -1357,15 +1362,20 @@ void LiquidStyle::drawPrimitive( PrimitiveElement pe, TQPainter *p,
|
|
|
|
p->setBrush( oldBrush );
|
|
|
|
p->setBrush( oldBrush );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
TDEStyle::drawPrimitive( pe, p, r, cg, flags, opt );
|
|
|
|
TDEStyle::drawPrimitive( pe, p, ceData, elementFlags, r, cg, flags, opt );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} // general switch
|
|
|
|
} // general switch
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void LiquidStyle::drawTDEStylePrimitive( TDEStylePrimitive kpe, TQPainter* p,
|
|
|
|
void LiquidStyle::drawTDEStylePrimitive( TDEStylePrimitive kpe,
|
|
|
|
const TQWidget* widget, const TQRect &r,
|
|
|
|
TQPainter* p,
|
|
|
|
const TQColorGroup &cg, SFlags flags,
|
|
|
|
const TQStyleControlElementData &ceData,
|
|
|
|
const TQStyleOption &opt ) const
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
|
|
|
const TQRect &r,
|
|
|
|
|
|
|
|
const TQColorGroup &cg,
|
|
|
|
|
|
|
|
SFlags flags,
|
|
|
|
|
|
|
|
const TQStyleOption &opt,
|
|
|
|
|
|
|
|
const TQWidget* widget ) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch ( kpe )
|
|
|
|
switch ( kpe )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1432,7 +1442,7 @@ void LiquidStyle::drawTDEStylePrimitive( TDEStylePrimitive kpe, TQPainter* p,
|
|
|
|
int x, y, w, h;
|
|
|
|
int x, y, w, h;
|
|
|
|
r.rect( &x, &y, &w, &h );
|
|
|
|
r.rect( &x, &y, &w, &h );
|
|
|
|
if (qstrcmp( tqApp->argv() [ 0 ], "kmix" ) == 0) x = x+3;
|
|
|
|
if (qstrcmp( tqApp->argv() [ 0 ], "kmix" ) == 0) x = x+3;
|
|
|
|
if ( ( ( const TQSlider * ) widget ) ->orientation() == TQt::Horizontal )
|
|
|
|
if ( ceData.orientation == TQt::Horizontal )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int x2 = x + w - 1;
|
|
|
|
int x2 = x + w - 1;
|
|
|
|
y = y + ( h - 5 ) / 2;
|
|
|
|
y = y + ( h - 5 ) / 2;
|
|
|
@ -1471,7 +1481,7 @@ void LiquidStyle::drawTDEStylePrimitive( TDEStylePrimitive kpe, TQPainter* p,
|
|
|
|
p->drawPixmap( r.x(), r.y(), *getPixmap( flags & Style_Enabled ? RadioOffHover : RadioOff));
|
|
|
|
p->drawPixmap( r.x(), r.y(), *getPixmap( flags & Style_Enabled ? RadioOffHover : RadioOff));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ((( const TQSlider * ) widget ) ->orientation() == TQt::Horizontal)
|
|
|
|
if ( ceData.orientation == TQt::Horizontal )
|
|
|
|
(widget && widget->height() < 17) ? p->drawPixmap( r.x(), r.y(), *getPixmap( flags & Style_Enabled ? RadioOffHover : RadioOff)) : p->drawPixmap( r.x(), (optionHandler->style() == Milk) ? r.y() : r.y()+2, *getPixmap( flags & Style_Enabled ? HSlider : HSliderInactive));
|
|
|
|
(widget && widget->height() < 17) ? p->drawPixmap( r.x(), r.y(), *getPixmap( flags & Style_Enabled ? RadioOffHover : RadioOff)) : p->drawPixmap( r.x(), (optionHandler->style() == Milk) ? r.y() : r.y()+2, *getPixmap( flags & Style_Enabled ? HSlider : HSliderInactive));
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1514,14 +1524,19 @@ void LiquidStyle::drawTDEStylePrimitive( TDEStylePrimitive kpe, TQPainter* p,
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
TDEStyle::drawTDEStylePrimitive( kpe, p, widget, r, cg, flags, opt );
|
|
|
|
TDEStyle::drawTDEStylePrimitive( kpe, p, ceData, elementFlags, r, cg, flags, opt, widget );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void LiquidStyle::drawControl( ControlElement element, TQPainter *p,
|
|
|
|
void LiquidStyle::drawControl( ControlElement element,
|
|
|
|
const TQWidget *widget, const TQRect &r,
|
|
|
|
TQPainter *p,
|
|
|
|
const TQColorGroup &cg, SFlags flags,
|
|
|
|
const TQStyleControlElementData &ceData,
|
|
|
|
const TQStyleOption &opt ) const
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
|
|
|
const TQRect &r,
|
|
|
|
|
|
|
|
const TQColorGroup &cg,
|
|
|
|
|
|
|
|
SFlags flags,
|
|
|
|
|
|
|
|
const TQStyleOption &opt,
|
|
|
|
|
|
|
|
const TQWidget *widget ) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch ( element )
|
|
|
|
switch ( element )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1536,7 +1551,7 @@ void LiquidStyle::drawControl( ControlElement element, TQPainter *p,
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// tqWarning("%s - %s,%s : %s,%s",tqApp->argv()[0],widget->className(),widget->name(),widget->parentWidget()->className(),widget->parentWidget()->name());
|
|
|
|
// tqWarning("%s - %s,%s : %s,%s",tqApp->argv()[0],widget->className(),widget->name(),widget->parentWidget()->className(),widget->parentWidget()->name());
|
|
|
|
const TQProgressBar *progress = ( const TQProgressBar * ) widget;
|
|
|
|
const TQProgressBar *progress = ( const TQProgressBar * ) widget;
|
|
|
|
TQRect contentsR( subRect( SR_ProgressBarContents, widget ) );
|
|
|
|
TQRect contentsR( subRect( SR_ProgressBarContents, ceData, elementFlags, widget ) );
|
|
|
|
double val = progress->progress();
|
|
|
|
double val = progress->progress();
|
|
|
|
bool reverse = TQApplication::reverseLayout();
|
|
|
|
bool reverse = TQApplication::reverseLayout();
|
|
|
|
val = val / progress->totalSteps();
|
|
|
|
val = val / progress->totalSteps();
|
|
|
@ -1618,8 +1633,8 @@ void LiquidStyle::drawControl( ControlElement element, TQPainter *p,
|
|
|
|
int shiftX = 0;
|
|
|
|
int shiftX = 0;
|
|
|
|
int shiftY = 0;
|
|
|
|
int shiftY = 0;
|
|
|
|
if (flags & (Style_Down | Style_On)) {
|
|
|
|
if (flags & (Style_Down | Style_On)) {
|
|
|
|
shiftX = pixelMetric(PM_ButtonShiftHorizontal, widget);
|
|
|
|
shiftX = pixelMetric(PM_ButtonShiftHorizontal, ceData, elementFlags, widget);
|
|
|
|
shiftY = pixelMetric(PM_ButtonShiftVertical, widget);
|
|
|
|
shiftY = pixelMetric(PM_ButtonShiftVertical, ceData, elementFlags, widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (!opt.isDefault())
|
|
|
|
if (!opt.isDefault())
|
|
|
@ -1635,7 +1650,7 @@ void LiquidStyle::drawControl( ControlElement element, TQPainter *p,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
rect.moveBy(shiftX, shiftY);
|
|
|
|
rect.moveBy(shiftX, shiftY);
|
|
|
|
drawPrimitive(pe, p, rect, cg, flags, opt);
|
|
|
|
drawPrimitive(pe, p, ceData, elementFlags, rect, cg, flags, opt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1645,7 +1660,7 @@ void LiquidStyle::drawControl( ControlElement element, TQPainter *p,
|
|
|
|
! toolbutton->text().isNull() &&
|
|
|
|
! toolbutton->text().isNull() &&
|
|
|
|
! toolbutton->usesTextLabel()) {
|
|
|
|
! toolbutton->usesTextLabel()) {
|
|
|
|
int alignment = AlignCenter | ShowPrefix;
|
|
|
|
int alignment = AlignCenter | ShowPrefix;
|
|
|
|
if (!styleHint(SH_UnderlineAccelerator, widget, TQStyleOption::Default, 0))
|
|
|
|
if (!styleHint(SH_UnderlineAccelerator, ceData, elementFlags, TQStyleOption::Default, 0, widget))
|
|
|
|
alignment |= NoAccel;
|
|
|
|
alignment |= NoAccel;
|
|
|
|
|
|
|
|
|
|
|
|
rect.moveBy(shiftX, shiftY);
|
|
|
|
rect.moveBy(shiftX, shiftY);
|
|
|
@ -1673,7 +1688,7 @@ void LiquidStyle::drawControl( ControlElement element, TQPainter *p,
|
|
|
|
p->setFont( toolbutton->font() );
|
|
|
|
p->setFont( toolbutton->font() );
|
|
|
|
TQRect pr = rect, tr = rect;
|
|
|
|
TQRect pr = rect, tr = rect;
|
|
|
|
int alignment = ShowPrefix;
|
|
|
|
int alignment = ShowPrefix;
|
|
|
|
if (!styleHint(SH_UnderlineAccelerator, widget, TQStyleOption::Default, 0))
|
|
|
|
if (!styleHint(SH_UnderlineAccelerator, ceData, elementFlags, TQStyleOption::Default, 0, widget))
|
|
|
|
alignment |= NoAccel;
|
|
|
|
alignment |= NoAccel;
|
|
|
|
|
|
|
|
|
|
|
|
if ( toolbutton->textPosition() == TQToolButton::Under )
|
|
|
|
if ( toolbutton->textPosition() == TQToolButton::Under )
|
|
|
@ -1741,7 +1756,7 @@ void LiquidStyle::drawControl( ControlElement element, TQPainter *p,
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (optionHandler->DrawProgressLabel())
|
|
|
|
if (optionHandler->DrawProgressLabel())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQRect contentsR( subRect( SR_ProgressBarContents, widget ) );
|
|
|
|
TQRect contentsR( subRect( SR_ProgressBarContents, ceData, elementFlags, widget ) );
|
|
|
|
if ( !contentsR.isValid() )
|
|
|
|
if ( !contentsR.isValid() )
|
|
|
|
return ;
|
|
|
|
return ;
|
|
|
|
TQFont font( p->font() );
|
|
|
|
TQFont font( p->font() );
|
|
|
@ -1881,7 +1896,7 @@ void LiquidStyle::drawControl( ControlElement element, TQPainter *p,
|
|
|
|
if ( !isPlain() && !btn->autoMask() )
|
|
|
|
if ( !isPlain() && !btn->autoMask() )
|
|
|
|
const_cast<LiquidStyle*>( this ) ->btnOffset = btn->backgroundOffset();
|
|
|
|
const_cast<LiquidStyle*>( this ) ->btnOffset = btn->backgroundOffset();
|
|
|
|
const_cast<LiquidStyle*>( this ) ->paintWidget = const_cast<TQWidget*>( widget );
|
|
|
|
const_cast<LiquidStyle*>( this ) ->paintWidget = const_cast<TQWidget*>( widget );
|
|
|
|
drawPrimitive( PE_ButtonDefault, p, r, cg, flags, TQStyleOption( btn ));
|
|
|
|
drawPrimitive( PE_ButtonDefault, p, ceData, elementFlags, r, cg, flags, TQStyleOption( btn ));
|
|
|
|
const_cast<LiquidStyle*>( this ) ->paintWidget = 0L;
|
|
|
|
const_cast<LiquidStyle*>( this ) ->paintWidget = 0L;
|
|
|
|
const_cast<LiquidStyle*>( this ) ->isHTMLButton = false;
|
|
|
|
const_cast<LiquidStyle*>( this ) ->isHTMLButton = false;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -1918,7 +1933,7 @@ void LiquidStyle::drawControl( ControlElement element, TQPainter *p,
|
|
|
|
|
|
|
|
|
|
|
|
if ( btn->isMenuButton() )
|
|
|
|
if ( btn->isMenuButton() )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
drawPrimitive( PE_ArrowDown, p, TQRect( w-14, (int)(h/2), 7, 7 ) , cg, flags, opt );
|
|
|
|
drawPrimitive( PE_ArrowDown, p, ceData, elementFlags, TQRect( w-14, (int)(h/2), 7, 7 ) , cg, flags, opt );
|
|
|
|
w -= 14;
|
|
|
|
w -= 14;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TQColor tmp;
|
|
|
|
TQColor tmp;
|
|
|
@ -2041,7 +2056,7 @@ void LiquidStyle::drawControl( ControlElement element, TQPainter *p,
|
|
|
|
cflags |= Style_Enabled;
|
|
|
|
cflags |= Style_Enabled;
|
|
|
|
if ( act )
|
|
|
|
if ( act )
|
|
|
|
cflags |= Style_On;
|
|
|
|
cflags |= Style_On;
|
|
|
|
drawPrimitive( PE_CheckMark, p, visualRect( TQRect( xp, y + windowsItemFrame, checkcol - 2 * windowsItemFrame, h - 2 * windowsItemFrame ), r ), cg, cflags );
|
|
|
|
drawPrimitive( PE_CheckMark, p, ceData, elementFlags, visualRect( TQRect( xp, y + windowsItemFrame, checkcol - 2 * windowsItemFrame, h - 2 * windowsItemFrame ), r ), cg, cflags );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TQColor discol;
|
|
|
|
TQColor discol;
|
|
|
@ -2136,14 +2151,14 @@ void LiquidStyle::drawControl( ControlElement element, TQPainter *p,
|
|
|
|
if ( !dis )
|
|
|
|
if ( !dis )
|
|
|
|
discol = cg.highlightedText();
|
|
|
|
discol = cg.highlightedText();
|
|
|
|
TQColorGroup g2( discol, cg.highlight(), white, white, dis ? discol : white, discol, white );
|
|
|
|
TQColorGroup g2( discol, cg.highlight(), white, white, dis ? discol : white, discol, white );
|
|
|
|
drawPrimitive( arrow, p, vrect, g2, Style_Enabled );
|
|
|
|
drawPrimitive( arrow, p, ceData, elementFlags, vrect, g2, Style_Enabled );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( !dis )
|
|
|
|
if ( !dis )
|
|
|
|
discol = optionHandler->textColor();
|
|
|
|
discol = optionHandler->textColor();
|
|
|
|
TQColorGroup g2( discol, cg.background(), white, white, dis ? discol : white, discol, white );
|
|
|
|
TQColorGroup g2( discol, cg.background(), white, white, dis ? discol : white, discol, white );
|
|
|
|
drawPrimitive( arrow, p, vrect, g2, mi->isEnabled() ? Style_Enabled : Style_Default );
|
|
|
|
drawPrimitive( arrow, p, ceData, elementFlags, vrect, g2, mi->isEnabled() ? Style_Enabled : Style_Default );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -2154,7 +2169,7 @@ void LiquidStyle::drawControl( ControlElement element, TQPainter *p,
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}*/
|
|
|
|
}*/
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
TDEStyle::drawControl( element, p, widget, r, cg, flags, opt );
|
|
|
|
TDEStyle::drawControl( element, p, ceData, elementFlags, r, cg, flags, opt, widget );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2182,7 +2197,17 @@ void LiquidStyle::drawControl( ControlElement element, TQPainter *p,
|
|
|
|
// // }
|
|
|
|
// // }
|
|
|
|
// }
|
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, const TQWidget *widget, const TQRect &r, const TQColorGroup &cg, SFlags flags, SCFlags controls, SCFlags active, const TQStyleOption &opt ) const
|
|
|
|
void LiquidStyle::drawComplexControl( ComplexControl control,
|
|
|
|
|
|
|
|
TQPainter *p,
|
|
|
|
|
|
|
|
const TQStyleControlElementData &ceData,
|
|
|
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
|
|
|
const TQRect &r,
|
|
|
|
|
|
|
|
const TQColorGroup &cg,
|
|
|
|
|
|
|
|
SFlags flags,
|
|
|
|
|
|
|
|
SCFlags controls,
|
|
|
|
|
|
|
|
SCFlags active,
|
|
|
|
|
|
|
|
const TQStyleOption &opt,
|
|
|
|
|
|
|
|
const TQWidget *widget ) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch ( control )
|
|
|
|
switch ( control )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -2249,8 +2274,8 @@ void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, cons
|
|
|
|
const_cast<LiquidStyle*>( this ) ->paintWidget = const_cast<TQWidget*>( widget );
|
|
|
|
const_cast<LiquidStyle*>( this ) ->paintWidget = const_cast<TQWidget*>( widget );
|
|
|
|
const KAccessToolBarButton *toolbutton2 = 0L;
|
|
|
|
const KAccessToolBarButton *toolbutton2 = 0L;
|
|
|
|
TQRect button, menuarea;
|
|
|
|
TQRect button, menuarea;
|
|
|
|
button = querySubControlMetrics( control, widget, SC_ToolButton, opt );
|
|
|
|
button = querySubControlMetrics( control, ceData, elementFlags, SC_ToolButton, opt, widget );
|
|
|
|
menuarea = querySubControlMetrics( control, widget, SC_ToolButtonMenu, opt );
|
|
|
|
menuarea = querySubControlMetrics( control, ceData, elementFlags, SC_ToolButtonMenu, opt, widget );
|
|
|
|
if (::tqt_cast<TDEToolBarButton*>(toolbutton))
|
|
|
|
if (::tqt_cast<TDEToolBarButton*>(toolbutton))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
toolbutton2 = (const KAccessToolBarButton*)toolbutton;
|
|
|
|
toolbutton2 = (const KAccessToolBarButton*)toolbutton;
|
|
|
@ -2396,15 +2421,15 @@ void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, cons
|
|
|
|
if ( controls & SC_ToolButtonMenu )
|
|
|
|
if ( controls & SC_ToolButtonMenu )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( mflags & ( Style_Down | Style_On | Style_Raised ) )
|
|
|
|
if ( mflags & ( Style_Down | Style_On | Style_Raised ) )
|
|
|
|
drawPrimitive( PE_ButtonDropDown, p, menuarea, cg, mflags, opt );
|
|
|
|
drawPrimitive( PE_ButtonDropDown, p, ceData, elementFlags, menuarea, cg, mflags, opt );
|
|
|
|
drawPrimitive( PE_ArrowDown, p, menuarea, cg, mflags, opt );
|
|
|
|
drawPrimitive( PE_ArrowDown, p, ceData, elementFlags, menuarea, cg, mflags, opt );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#if 0
|
|
|
|
#if 0
|
|
|
|
if ( toolbutton->hasFocus() && !toolbutton->focusProxy() )
|
|
|
|
if ( toolbutton->hasFocus() && !toolbutton->focusProxy() )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQRect fr = toolbutton->rect();
|
|
|
|
TQRect fr = toolbutton->rect();
|
|
|
|
fr.addCoords( 3, 3, -3, -3 );
|
|
|
|
fr.addCoords( 3, 3, -3, -3 );
|
|
|
|
drawPrimitive( PE_FocusRect, p, fr, cg );
|
|
|
|
drawPrimitive( PE_FocusRect, p, ceData, elementFlags, fr, cg );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
const_cast<LiquidStyle*>( this ) ->paintWidget = 0L;
|
|
|
|
const_cast<LiquidStyle*>( this ) ->paintWidget = 0L;
|
|
|
@ -2413,7 +2438,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, cons
|
|
|
|
case CC_ScrollBar:
|
|
|
|
case CC_ScrollBar:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const_cast<LiquidStyle*>( this ) ->currentScrollBar = ( TQScrollBar * ) widget;
|
|
|
|
const_cast<LiquidStyle*>( this ) ->currentScrollBar = ( TQScrollBar * ) widget;
|
|
|
|
TDEStyle::drawComplexControl( control, p, widget, r, cg, flags, controls, active, opt );
|
|
|
|
TDEStyle::drawComplexControl( control, p, ceData, elementFlags, r, cg, flags, controls, active, opt, widget );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case CC_SpinWidget: {
|
|
|
|
case CC_SpinWidget: {
|
|
|
@ -2436,7 +2461,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, cons
|
|
|
|
TQRect re = sw->upRect();
|
|
|
|
TQRect re = sw->upRect();
|
|
|
|
TQColorGroup ucg = sw->isUpEnabled() ? cg : sw->palette().disabled();
|
|
|
|
TQColorGroup ucg = sw->isUpEnabled() ? cg : sw->palette().disabled();
|
|
|
|
p->fillRect(re, ucg.base());
|
|
|
|
p->fillRect(re, ucg.base());
|
|
|
|
drawPrimitive(pe, p, re, ucg, flags);
|
|
|
|
drawPrimitive(pe, p, ceData, elementFlags, re, ucg, flags);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if ( controls & SC_SpinWidgetDown ) {
|
|
|
|
if ( controls & SC_SpinWidgetDown ) {
|
|
|
@ -2451,7 +2476,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, cons
|
|
|
|
TQRect re = sw->downRect();
|
|
|
|
TQRect re = sw->downRect();
|
|
|
|
TQColorGroup dcg = sw->isDownEnabled() ? cg : sw->palette().disabled();
|
|
|
|
TQColorGroup dcg = sw->isDownEnabled() ? cg : sw->palette().disabled();
|
|
|
|
p->fillRect(re, dcg.base());
|
|
|
|
p->fillRect(re, dcg.base());
|
|
|
|
drawPrimitive(pe, p, re, dcg, flags);
|
|
|
|
drawPrimitive(pe, p, ceData, elementFlags, re, dcg, flags);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break; }
|
|
|
|
break; }
|
|
|
|
|
|
|
|
|
|
|
@ -2459,8 +2484,8 @@ void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, cons
|
|
|
|
// -------------------------------------------------------------------
|
|
|
|
// -------------------------------------------------------------------
|
|
|
|
case CC_Slider: {
|
|
|
|
case CC_Slider: {
|
|
|
|
const TQSlider* slider = (const TQSlider*)widget;
|
|
|
|
const TQSlider* slider = (const TQSlider*)widget;
|
|
|
|
TQRect groove = querySubControlMetrics(CC_Slider, widget, SC_SliderGroove, opt);
|
|
|
|
TQRect groove = querySubControlMetrics(CC_Slider, ceData, elementFlags, SC_SliderGroove, opt, widget);
|
|
|
|
TQRect handle = querySubControlMetrics(CC_Slider, widget, SC_SliderHandle, opt);
|
|
|
|
TQRect handle = querySubControlMetrics(CC_Slider, ceData, elementFlags, SC_SliderHandle, opt, widget);
|
|
|
|
|
|
|
|
|
|
|
|
// Double-buffer slider for no flicker
|
|
|
|
// Double-buffer slider for no flicker
|
|
|
|
TQPixmap pix(widget->size());
|
|
|
|
TQPixmap pix(widget->size());
|
|
|
@ -2511,23 +2536,23 @@ void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, cons
|
|
|
|
|
|
|
|
|
|
|
|
// Draw slider groove
|
|
|
|
// Draw slider groove
|
|
|
|
if ((controls & SC_SliderGroove) && groove.isValid()) {
|
|
|
|
if ((controls & SC_SliderGroove) && groove.isValid()) {
|
|
|
|
drawTDEStylePrimitive( KPE_SliderGroove, &p2, widget, groove, cg, flags, opt );
|
|
|
|
drawTDEStylePrimitive( KPE_SliderGroove, &p2, ceData, elementFlags, groove, cg, flags, opt, widget );
|
|
|
|
|
|
|
|
|
|
|
|
// Draw the focus rect around the groove
|
|
|
|
// Draw the focus rect around the groove
|
|
|
|
/* if (slider->hasFocus())
|
|
|
|
/* if (slider->hasFocus())
|
|
|
|
drawPrimitive(PE_FocusRect, &p2, groove, cg);*/
|
|
|
|
drawPrimitive(PE_FocusRect, &p2, ceData, elementFlags, groove, cg);*/
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Draw the tickmarks
|
|
|
|
// Draw the tickmarks
|
|
|
|
if (controls & SC_SliderTickmarks)
|
|
|
|
if (controls & SC_SliderTickmarks)
|
|
|
|
TQCommonStyle::drawComplexControl(control, &p2, widget,
|
|
|
|
TQCommonStyle::drawComplexControl(control, &p2, ceData, elementFlags,
|
|
|
|
r, cg, flags, SC_SliderTickmarks, active, opt);
|
|
|
|
r, cg, flags, SC_SliderTickmarks, active, opt, widget);
|
|
|
|
|
|
|
|
|
|
|
|
// Draw the slider handle
|
|
|
|
// Draw the slider handle
|
|
|
|
if ((controls & SC_SliderHandle) && handle.isValid()) {
|
|
|
|
if ((controls & SC_SliderHandle) && handle.isValid()) {
|
|
|
|
if (active == SC_SliderHandle)
|
|
|
|
if (active == SC_SliderHandle)
|
|
|
|
flags |= Style_Active;
|
|
|
|
flags |= Style_Active;
|
|
|
|
drawTDEStylePrimitive( KPE_SliderHandle, &p2, widget, handle, cg, flags, opt );
|
|
|
|
drawTDEStylePrimitive( KPE_SliderHandle, &p2, ceData, elementFlags, handle, cg, flags, opt, widget );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
p2.end();
|
|
|
|
p2.end();
|
|
|
@ -2538,7 +2563,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, cons
|
|
|
|
#ifndef QT_NO_LISTVIEW
|
|
|
|
#ifndef QT_NO_LISTVIEW
|
|
|
|
case CC_ListView: {
|
|
|
|
case CC_ListView: {
|
|
|
|
if ( controls & SC_ListView ) {
|
|
|
|
if ( controls & SC_ListView ) {
|
|
|
|
TQCommonStyle::drawComplexControl( control, p, widget, r, cg, flags, controls, active, opt );
|
|
|
|
TQCommonStyle::drawComplexControl( control, p, ceData, elementFlags, r, cg, flags, controls, active, opt, widget );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( controls & ( SC_ListViewBranch | SC_ListViewExpand ) ) {
|
|
|
|
if ( controls & ( SC_ListViewBranch | SC_ListViewExpand ) ) {
|
|
|
|
if ( opt.isDefault() )
|
|
|
|
if ( opt.isDefault() )
|
|
|
@ -2761,7 +2786,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, cons
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( controls & SC_TitleBarLabel )
|
|
|
|
if ( controls & SC_TitleBarLabel )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQRect ir = visualRect( querySubControlMetrics( CC_TitleBar, widget, SC_TitleBarLabel ), widget );
|
|
|
|
TQRect ir = visualRect( querySubControlMetrics( CC_TitleBar, ceData, elementFlags, SC_TitleBarLabel, TQStyleOption::Default, widget ), widget );
|
|
|
|
p->setPen( cg.text() );
|
|
|
|
p->setPen( cg.text() );
|
|
|
|
p->drawText(ir.x()+2, ir.y(), ir.width()-2, ir.height(), AlignCenter | AlignVCenter | SingleLine, widget->caption() );
|
|
|
|
p->drawText(ir.x()+2, ir.y(), ir.width()-2, ir.height(), AlignCenter | AlignVCenter | SingleLine, widget->caption() );
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2772,7 +2797,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, cons
|
|
|
|
|
|
|
|
|
|
|
|
if ( controls & SC_TitleBarCloseButton )
|
|
|
|
if ( controls & SC_TitleBarCloseButton )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ir = visualRect( querySubControlMetrics( CC_TitleBar, widget, SC_TitleBarCloseButton ), widget );
|
|
|
|
ir = visualRect( querySubControlMetrics( CC_TitleBar, ceData, elementFlags, SC_TitleBarCloseButton, TQStyleOption::Default, widget ), widget );
|
|
|
|
down = active & SC_TitleBarCloseButton;
|
|
|
|
down = active & SC_TitleBarCloseButton;
|
|
|
|
if (optionHandler->buttonStyle() == Brushed)
|
|
|
|
if (optionHandler->buttonStyle() == Brushed)
|
|
|
|
drawRectangularButton( p, cg, down ? optionHandler->titleButtonColor(0).dark(120) : optionHandler->titleButtonColor(0), ir.x(), ir.y(), ir.width(), ir.height(), down, false, false, full);
|
|
|
|
drawRectangularButton( p, cg, down ? optionHandler->titleButtonColor(0).dark(120) : optionHandler->titleButtonColor(0), ir.x(), ir.y(), ir.width(), ir.height(), down, false, false, full);
|
|
|
@ -2781,7 +2806,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, cons
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( controls & SC_TitleBarSysMenu )
|
|
|
|
if ( controls & SC_TitleBarSysMenu )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ir = visualRect( querySubControlMetrics( CC_TitleBar, widget, SC_TitleBarSysMenu ), widget );
|
|
|
|
ir = visualRect( querySubControlMetrics( CC_TitleBar, ceData, elementFlags, SC_TitleBarSysMenu, TQStyleOption::Default, widget ), widget );
|
|
|
|
down = active & SC_TitleBarSysMenu;
|
|
|
|
down = active & SC_TitleBarSysMenu;
|
|
|
|
if (optionHandler->buttonStyle() == Brushed)
|
|
|
|
if (optionHandler->buttonStyle() == Brushed)
|
|
|
|
drawRectangularButton( p, cg, down ? cg.button().dark(120) : cg.button(), ir.x(), ir.y(), ir.width(), ir.height(), down, false, false, full);
|
|
|
|
drawRectangularButton( p, cg, down ? cg.button().dark(120) : cg.button(), ir.x(), ir.y(), ir.width(), ir.height(), down, false, false, full);
|
|
|
@ -2791,7 +2816,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, cons
|
|
|
|
|
|
|
|
|
|
|
|
if ( controls & SC_TitleBarMaxButton )
|
|
|
|
if ( controls & SC_TitleBarMaxButton )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ir = visualRect( querySubControlMetrics( CC_TitleBar, widget, SC_TitleBarMaxButton ), widget );
|
|
|
|
ir = visualRect( querySubControlMetrics( CC_TitleBar, ceData, elementFlags, SC_TitleBarMaxButton, TQStyleOption::Default, widget ), widget );
|
|
|
|
down = active & SC_TitleBarMaxButton;
|
|
|
|
down = active & SC_TitleBarMaxButton;
|
|
|
|
if (optionHandler->buttonStyle() == Brushed)
|
|
|
|
if (optionHandler->buttonStyle() == Brushed)
|
|
|
|
drawRectangularButton( p, cg, down ? optionHandler->titleButtonColor(2).dark(120) : optionHandler->titleButtonColor(2), ir.x(), ir.y(), ir.width(), ir.height(), down, false, false, full);
|
|
|
|
drawRectangularButton( p, cg, down ? optionHandler->titleButtonColor(2).dark(120) : optionHandler->titleButtonColor(2), ir.x(), ir.y(), ir.width(), ir.height(), down, false, false, full);
|
|
|
@ -2801,7 +2826,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, cons
|
|
|
|
|
|
|
|
|
|
|
|
if ( controls & SC_TitleBarMinButton )
|
|
|
|
if ( controls & SC_TitleBarMinButton )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ir = visualRect( querySubControlMetrics( CC_TitleBar, widget, SC_TitleBarMinButton ), widget );
|
|
|
|
ir = visualRect( querySubControlMetrics( CC_TitleBar, ceData, elementFlags, SC_TitleBarMinButton, TQStyleOption::Default, widget ), widget );
|
|
|
|
down = active & SC_TitleBarMinButton;
|
|
|
|
down = active & SC_TitleBarMinButton;
|
|
|
|
if (optionHandler->buttonStyle() == Brushed)
|
|
|
|
if (optionHandler->buttonStyle() == Brushed)
|
|
|
|
drawRectangularButton( p, cg, down ? optionHandler->titleButtonColor(1).dark(120) : optionHandler->titleButtonColor(1), ir.x(), ir.y(), ir.width(), ir.height(), down, false, false, full);
|
|
|
|
drawRectangularButton( p, cg, down ? optionHandler->titleButtonColor(1).dark(120) : optionHandler->titleButtonColor(1), ir.x(), ir.y(), ir.width(), ir.height(), down, false, false, full);
|
|
|
@ -2810,7 +2835,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, cons
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if ( controls & SC_TitleBarNormalButton )
|
|
|
|
if ( controls & SC_TitleBarNormalButton )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ir = visualRect( querySubControlMetrics( CC_TitleBar, widget, SC_TitleBarNormalButton ), widget );
|
|
|
|
ir = visualRect( querySubControlMetrics( CC_TitleBar, ceData, elementFlags, SC_TitleBarNormalButton, TQStyleOption::Default, widget ), widget );
|
|
|
|
down = active & SC_TitleBarNormalButton;
|
|
|
|
down = active & SC_TitleBarNormalButton;
|
|
|
|
if (optionHandler->buttonStyle() == Brushed)
|
|
|
|
if (optionHandler->buttonStyle() == Brushed)
|
|
|
|
drawRectangularButton( p, cg, down ? optionHandler->titleButtonColor(1).dark(120) : optionHandler->titleButtonColor(1), ir.x(), ir.y(), ir.width(), ir.height(), down, false, false, full);
|
|
|
|
drawRectangularButton( p, cg, down ? optionHandler->titleButtonColor(1).dark(120) : optionHandler->titleButtonColor(1), ir.x(), ir.y(), ir.width(), ir.height(), down, false, false, full);
|
|
|
@ -2820,7 +2845,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, cons
|
|
|
|
|
|
|
|
|
|
|
|
if ( controls & SC_TitleBarShadeButton )
|
|
|
|
if ( controls & SC_TitleBarShadeButton )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ir = visualRect( querySubControlMetrics( CC_TitleBar, widget, SC_TitleBarShadeButton ), widget );
|
|
|
|
ir = visualRect( querySubControlMetrics( CC_TitleBar, ceData, elementFlags, SC_TitleBarShadeButton, TQStyleOption::Default, widget ), widget );
|
|
|
|
down = active & SC_TitleBarShadeButton;
|
|
|
|
down = active & SC_TitleBarShadeButton;
|
|
|
|
if (optionHandler->buttonStyle() == Brushed)
|
|
|
|
if (optionHandler->buttonStyle() == Brushed)
|
|
|
|
drawRectangularButton( p, cg, down ? cg.button().dark(120) : cg.button(), ir.x(), ir.y(), ir.width(), ir.height(), down, false, false, full);
|
|
|
|
drawRectangularButton( p, cg, down ? cg.button().dark(120) : cg.button(), ir.x(), ir.y(), ir.width(), ir.height(), down, false, false, full);
|
|
|
@ -2830,7 +2855,7 @@ void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, cons
|
|
|
|
|
|
|
|
|
|
|
|
if ( controls & SC_TitleBarUnshadeButton )
|
|
|
|
if ( controls & SC_TitleBarUnshadeButton )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
ir = visualRect( querySubControlMetrics( CC_TitleBar, widget, SC_TitleBarUnshadeButton ), widget );
|
|
|
|
ir = visualRect( querySubControlMetrics( CC_TitleBar, ceData, elementFlags, SC_TitleBarUnshadeButton, TQStyleOption::Default, widget ), widget );
|
|
|
|
down = active & SC_TitleBarUnshadeButton;
|
|
|
|
down = active & SC_TitleBarUnshadeButton;
|
|
|
|
if (optionHandler->buttonStyle() == Brushed)
|
|
|
|
if (optionHandler->buttonStyle() == Brushed)
|
|
|
|
drawRectangularButton( p, cg, down ? cg.button().dark(120) : cg.button(), ir.x(), ir.y(), ir.width(), ir.height(), down, false, false, full);
|
|
|
|
drawRectangularButton( p, cg, down ? cg.button().dark(120) : cg.button(), ir.x(), ir.y(), ir.width(), ir.height(), down, false, false, full);
|
|
|
@ -2842,13 +2867,18 @@ void LiquidStyle::drawComplexControl( ComplexControl control, TQPainter *p, cons
|
|
|
|
#endif //QT_NO_TITLEBAR
|
|
|
|
#endif //QT_NO_TITLEBAR
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
TDEStyle::drawComplexControl( control, p, widget,
|
|
|
|
TDEStyle::drawComplexControl( control, p, ceData, elementFlags,
|
|
|
|
r, cg, flags, controls, active, opt );
|
|
|
|
r, cg, flags, controls, active, opt, widget );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int LiquidStyle::styleHint(StyleHint sh, const TQWidget * w, const TQStyleOption & opt, TQStyleHintReturn * shr) const
|
|
|
|
int LiquidStyle::styleHint(StyleHint sh,
|
|
|
|
|
|
|
|
const TQStyleControlElementData &ceData,
|
|
|
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
|
|
|
const TQStyleOption & opt,
|
|
|
|
|
|
|
|
TQStyleHintReturn * shr,
|
|
|
|
|
|
|
|
const TQWidget * w) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (sh)
|
|
|
|
switch (sh)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -2860,20 +2890,26 @@ int LiquidStyle::styleHint(StyleHint sh, const TQWidget * w, const TQStyleOption
|
|
|
|
if (optionHandler->CenterTabs() && !TQApplication::reverseLayout())
|
|
|
|
if (optionHandler->CenterTabs() && !TQApplication::reverseLayout())
|
|
|
|
return AlignHCenter;
|
|
|
|
return AlignHCenter;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return TDEStyle::styleHint(sh, w, opt, shr);
|
|
|
|
return TDEStyle::styleHint(sh, ceData, elementFlags, opt, shr, w);
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return TDEStyle::styleHint(sh, w, opt, shr);
|
|
|
|
return TDEStyle::styleHint(sh, ceData, elementFlags, opt, shr, w);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQRect LiquidStyle::subRect( SubRect r, const TQWidget *widget ) const {
|
|
|
|
TQRect LiquidStyle::subRect( SubRect r,
|
|
|
|
|
|
|
|
const TQStyleControlElementData &ceData,
|
|
|
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
|
|
|
const TQWidget *widget ) const {
|
|
|
|
if (r == SR_ComboBoxFocusRect){
|
|
|
|
if (r == SR_ComboBoxFocusRect){
|
|
|
|
return querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxEditField );
|
|
|
|
return querySubControlMetrics( CC_ComboBox, ceData, elementFlags, SC_ComboBoxEditField, TQStyleOption::Default, widget );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return ( TDEStyle::subRect( r, widget ) );
|
|
|
|
return ( TDEStyle::subRect( r, ceData, elementFlags, widget ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int LiquidStyle::pixelMetric( PixelMetric m, const TQWidget *widget ) const
|
|
|
|
int LiquidStyle::pixelMetric( PixelMetric m,
|
|
|
|
|
|
|
|
const TQStyleControlElementData &ceData,
|
|
|
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
|
|
|
const TQWidget *widget ) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch ( m )
|
|
|
|
switch ( m )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -2955,14 +2991,16 @@ int LiquidStyle::pixelMetric( PixelMetric m, const TQWidget *widget ) const
|
|
|
|
case PM_ButtonShiftVertical:
|
|
|
|
case PM_ButtonShiftVertical:
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return TDEStyle::pixelMetric( m, widget );
|
|
|
|
return TDEStyle::pixelMetric( m, ceData, elementFlags, widget );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQSize LiquidStyle::sizeFromContents( ContentsType contents,
|
|
|
|
TQSize LiquidStyle::sizeFromContents( ContentsType contents,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQStyleControlElementData &ceData,
|
|
|
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
const TQSize &contentSize,
|
|
|
|
const TQSize &contentSize,
|
|
|
|
const TQStyleOption& opt ) const {
|
|
|
|
const TQStyleOption& opt,
|
|
|
|
|
|
|
|
const TQWidget *widget ) const {
|
|
|
|
switch ( contents ) {
|
|
|
|
switch ( contents ) {
|
|
|
|
case CT_PushButton: {
|
|
|
|
case CT_PushButton: {
|
|
|
|
// this is a little funky - we give values not based on pixelMetric
|
|
|
|
// this is a little funky - we give values not based on pixelMetric
|
|
|
@ -2974,7 +3012,7 @@ TQSize LiquidStyle::sizeFromContents( ContentsType contents,
|
|
|
|
int h = contentSize.height() > 24 ? contentSize.height() : 25;
|
|
|
|
int h = contentSize.height() > 24 ? contentSize.height() : 25;
|
|
|
|
|
|
|
|
|
|
|
|
if ( button->text().isEmpty() )
|
|
|
|
if ( button->text().isEmpty() )
|
|
|
|
return ( TQSize( contentSize.width() + 2 * pixelMetric( PM_ButtonMargin, widget ), h ) );
|
|
|
|
return ( TQSize( contentSize.width() + 2 * pixelMetric( PM_ButtonMargin, ceData, elementFlags, widget ), h ) );
|
|
|
|
|
|
|
|
|
|
|
|
return ( TQSize( w, h ) );
|
|
|
|
return ( TQSize( w, h ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -3000,7 +3038,7 @@ TQSize LiquidStyle::sizeFromContents( ContentsType contents,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
case CT_ComboBox: {
|
|
|
|
case CT_ComboBox: {
|
|
|
|
// TQSize sz = TDEStyle::sizeFromContents( contents, widget, contentSize, opt );
|
|
|
|
// TQSize sz = TDEStyle::sizeFromContents( contents, ceData, elementFlags, contentSize, opt, widget );
|
|
|
|
// return ( TQSize( sz.width()+3, sz.height() > 25 ? sz.height() : 25 ) );
|
|
|
|
// return ( TQSize( sz.width()+3, sz.height() > 25 ? sz.height() : 25 ) );
|
|
|
|
if ( ::tqt_cast<const TQComboBox *>(widget) && ((const TQComboBox *)widget)->editable())
|
|
|
|
if ( ::tqt_cast<const TQComboBox *>(widget) && ((const TQComboBox *)widget)->editable())
|
|
|
|
return ( TQSize( contentSize.width()+27, contentSize.height() + 4 > 22 ? contentSize.height() + 4 : 26 ) );
|
|
|
|
return ( TQSize( contentSize.width()+27, contentSize.height() + 4 > 22 ? contentSize.height() + 4 : 26 ) );
|
|
|
@ -3054,19 +3092,26 @@ TQSize LiquidStyle::sizeFromContents( ContentsType contents,
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return TDEStyle::sizeFromContents( contents, widget, contentSize, opt );
|
|
|
|
return TDEStyle::sizeFromContents( contents, ceData, elementFlags, contentSize, opt, widget );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQPixmap LiquidStyle::stylePixmap( StylePixmap stylepixmap,
|
|
|
|
TQPixmap LiquidStyle::stylePixmap( StylePixmap stylepixmap,
|
|
|
|
const TQWidget* widget,
|
|
|
|
const TQStyleControlElementData &ceData,
|
|
|
|
const TQStyleOption& opt ) const {
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
return TDEStyle::stylePixmap( stylepixmap, widget, opt );
|
|
|
|
const TQStyleOption& opt,
|
|
|
|
|
|
|
|
const TQWidget* widget ) const {
|
|
|
|
|
|
|
|
return TDEStyle::stylePixmap( stylepixmap, ceData, elementFlags, opt, widget );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
#include "eventfilter.cpp"
|
|
|
|
#include "eventfilter.cpp"
|
|
|
|
|
|
|
|
|
|
|
|
TQRect LiquidStyle::querySubControlMetrics( ComplexControl control, const TQWidget *widget, SubControl subcontrol, const TQStyleOption &opt ) const
|
|
|
|
TQRect LiquidStyle::querySubControlMetrics( ComplexControl control,
|
|
|
|
|
|
|
|
const TQStyleControlElementData &ceData,
|
|
|
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
|
|
|
|
SubControl subcontrol,
|
|
|
|
|
|
|
|
const TQStyleOption &opt,
|
|
|
|
|
|
|
|
const TQWidget *widget ) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( control == CC_ComboBox && subcontrol == SC_ComboBoxEditField )
|
|
|
|
if ( control == CC_ComboBox && subcontrol == SC_ComboBoxEditField )
|
|
|
|
return TQRect( 8, 3, widget->width() - 32, widget->height() - 7 );
|
|
|
|
return TQRect( 8, 3, widget->width() - 32, widget->height() - 7 );
|
|
|
@ -3091,11 +3136,11 @@ TQRect LiquidStyle::querySubControlMetrics( ComplexControl control, const TQWidg
|
|
|
|
case SC_TitleBarUnshadeButton:
|
|
|
|
case SC_TitleBarUnshadeButton:
|
|
|
|
return TQRect( widget->width() - 29, 1, 24, 16 );
|
|
|
|
return TQRect( widget->width() - 29, 1, 24, 16 );
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return ( TDEStyle::querySubControlMetrics( control, widget, subcontrol, opt ) );
|
|
|
|
return ( TDEStyle::querySubControlMetrics( control, ceData, elementFlags, subcontrol, opt, widget ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return ( TDEStyle::querySubControlMetrics( control, widget, subcontrol, opt ) );
|
|
|
|
return ( TDEStyle::querySubControlMetrics( control, ceData, elementFlags, subcontrol, opt, widget ) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQImage LiquidStyle::fetchImage( const char *name ){
|
|
|
|
TQImage LiquidStyle::fetchImage( const char *name ){
|
|
|
|