Update to new style API

pull/1/head
Timothy Pearson 12 years ago
parent dc8692f8b3
commit 8a81e3e9ad

@ -169,11 +169,13 @@ TQtCKStyle::KStyleFlags TQtCKStyle::styleFlags() const
void TQtCKStyle::drawKStylePrimitive( KStylePrimitive kpe, void TQtCKStyle::drawKStylePrimitive( KStylePrimitive kpe,
TQPainter* p, TQPainter* p,
const TQWidget* widget, TQStyleControlElementData ceData,
ControlElementFlags elementFlags,
const TQRect &r, const TQRect &r,
const TQColorGroup &cg, const TQColorGroup &cg,
SFlags flags, SFlags flags,
const TQStyleOption& /* opt */ ) const const TQStyleOption& /* opt */,
const TQWidget* widget ) const
{ {
switch( kpe ) switch( kpe )
{ {
@ -382,6 +384,8 @@ int TQtCKStyle::kPixelMetric( KStylePixelMetric kpm, const TQWidget* /* widget *
void TQtCKStyle::drawPrimitive( PrimitiveElement pe, void TQtCKStyle::drawPrimitive( PrimitiveElement pe,
TQPainter* p, TQPainter* p,
TQStyleControlElementData ceData,
ControlElementFlags elementFlags,
const TQRect &r, const TQRect &r,
const TQColorGroup &cg, const TQColorGroup &cg,
SFlags flags, SFlags flags,
@ -406,30 +410,32 @@ void TQtCKStyle::drawPrimitive( PrimitiveElement pe,
(parent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)) )) // Collapsed dock (parent->inherits(TQMAINWINDOW_OBJECT_NAME_STRING)) )) // Collapsed dock
// Draw a toolbar handle // Draw a toolbar handle
drawKStylePrimitive( KPE_ToolBarHandle, p, widget, r, cg, flags, opt ); drawKStylePrimitive( KPE_ToolBarHandle, p, ceData, elementFlags, r, cg, flags, opt, widget );
else if ( widget->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) ) else if ( widget->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) )
// Draw a dock window handle // Draw a dock window handle
drawKStylePrimitive( KPE_DockWindowHandle, p, widget, r, cg, flags, opt ); drawKStylePrimitive( KPE_DockWindowHandle, p, ceData, elementFlags, r, cg, flags, opt, widget );
else else
// General handle, probably a kicker applet handle. // General handle, probably a kicker applet handle.
drawKStylePrimitive( KPE_GeneralHandle, p, widget, r, cg, flags, opt ); drawKStylePrimitive( KPE_GeneralHandle, p, ceData, elementFlags, r, cg, flags, opt, widget );
} else } else
TQCommonStyle::tqdrawPrimitive( pe, p, r, cg, flags, opt ); TQCommonStyle::drawPrimitive( pe, p, ceData, elementFlags, r, cg, flags, opt );
} }
void TQtCKStyle::drawControl( ControlElement element, void TQtCKStyle::drawControl( ControlElement element,
TQPainter* p, TQPainter* p,
const TQWidget* widget, TQStyleControlElementData ceData,
ControlElementFlags elementFlags,
const TQRect &r, const TQRect &r,
const TQColorGroup &cg, const TQColorGroup &cg,
SFlags flags, SFlags flags,
const TQStyleOption &opt ) const const TQStyleOption &opt,
const TQWidget* widget ) const
{ {
switch (element) switch (element)
{ {
@ -601,8 +607,8 @@ void TQtCKStyle::drawControl( ControlElement element,
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
case CE_PopupMenuScroller: { case CE_PopupMenuScroller: {
p->fillRect(r, cg.background()); p->fillRect(r, cg.background());
tqdrawPrimitive(PE_ButtonTool, p, r, cg, Style_Enabled); drawPrimitive(PE_ButtonTool, p, ceData, elementFlags, r, cg, Style_Enabled);
tqdrawPrimitive((flags & Style_Up) ? PE_ArrowUp : PE_ArrowDown, p, r, cg, Style_Enabled); drawPrimitive((flags & Style_Up) ? PE_ArrowUp : PE_ArrowDown, p, ceData, elementFlags, r, cg, Style_Enabled);
break; break;
} }
@ -610,15 +616,15 @@ void TQtCKStyle::drawControl( ControlElement element,
// PROGRESSBAR // PROGRESSBAR
// ------------------------------------------------------------------------ // ------------------------------------------------------------------------
case CE_ProgressBarGroove: { case CE_ProgressBarGroove: {
TQRect fr = subRect(SR_ProgressBarGroove, widget); TQRect fr = subRect(SR_ProgressBarGroove, ceData, elementFlags, widget);
tqdrawPrimitive(PE_Panel, p, fr, cg, Style_Sunken, TQStyleOption::Default); drawPrimitive(PE_Panel, p, ceData, elementFlags, fr, cg, Style_Sunken, TQStyleOption::Default);
break; break;
} }
case CE_ProgressBarContents: { case CE_ProgressBarContents: {
// ### Take into account totalSteps() for busy indicator // ### Take into account totalSteps() for busy indicator
const TQProgressBar* pb = (const TQProgressBar*)widget; const TQProgressBar* pb = (const TQProgressBar*)widget;
TQRect cr = subRect(SR_ProgressBarContents, widget); TQRect cr = subRect(SR_ProgressBarContents, ceData, elementFlags, widget);
double progress = pb->progress(); double progress = pb->progress();
bool reverse = TQApplication::reverseLayout(); bool reverse = TQApplication::reverseLayout();
int steps = pb->totalSteps(); int steps = pb->totalSteps();
@ -682,7 +688,7 @@ void TQtCKStyle::drawControl( ControlElement element,
case CE_ProgressBarLabel: { case CE_ProgressBarLabel: {
const TQProgressBar* pb = (const TQProgressBar*)widget; const TQProgressBar* pb = (const TQProgressBar*)widget;
TQRect cr = subRect(SR_ProgressBarContents, widget); TQRect cr = subRect(SR_ProgressBarContents, ceData, elementFlags, widget);
double progress = pb->progress(); double progress = pb->progress();
bool reverse = TQApplication::reverseLayout(); bool reverse = TQApplication::reverseLayout();
int steps = pb->totalSteps(); int steps = pb->totalSteps();
@ -721,12 +727,12 @@ void TQtCKStyle::drawControl( ControlElement element,
} }
default: default:
TQCommonStyle::drawControl(element, p, widget, r, cg, flags, opt); TQCommonStyle::drawControl(element, p, ceData, elementFlags, r, cg, flags, opt, widget);
} }
} }
TQRect TQtCKStyle::subRect(SubRect r, const TQWidget* widget) const TQRect TQtCKStyle::subRect(SubRect r, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags, const TQWidget* widget) const
{ {
switch(r) switch(r)
{ {
@ -743,12 +749,12 @@ TQRect TQtCKStyle::subRect(SubRect r, const TQWidget* widget) const
} }
default: default:
return TQCommonStyle::subRect(r, widget); return TQCommonStyle::subRect(r, ceData, elementFlags, widget);
} }
} }
int TQtCKStyle::pixelMetric(PixelMetric m, const TQWidget* widget) const int TQtCKStyle::pixelMetric(PixelMetric m, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQWidget* widget) const
{ {
switch(m) switch(m)
{ {
@ -769,7 +775,7 @@ int TQtCKStyle::pixelMetric(PixelMetric m, const TQWidget* widget) const
&& widget->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) ) && widget->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) )
return widget->fontMetrics().lineSpacing(); return widget->fontMetrics().lineSpacing();
else else
return TQCommonStyle::pixelMetric(m, widget); return TQCommonStyle::pixelMetric(m, ceData, elementFlags, widget);
} }
// TABS // TABS
@ -853,10 +859,10 @@ int TQtCKStyle::pixelMetric(PixelMetric m, const TQWidget* widget) const
return 0; return 0;
case PM_PopupMenuScrollerHeight: case PM_PopupMenuScrollerHeight:
return pixelMetric( PM_ScrollBarExtent, 0); return pixelMetric( PM_ScrollBarExtent, ceData, elementFlags, 0);
default: default:
return TQCommonStyle::pixelMetric( m, widget ); return TQCommonStyle::pixelMetric( m, ceData, elementFlags, widget );
} }
} }
@ -875,13 +881,15 @@ static TQListViewItem* nextVisibleSibling(TQListViewItem* item)
void TQtCKStyle::drawComplexControl( ComplexControl control, void TQtCKStyle::drawComplexControl( ComplexControl control,
TQPainter* p, TQPainter* p,
const TQWidget* widget, TQStyleControlElementData ceData,
ControlElementFlags elementFlags,
const TQRect &r, const TQRect &r,
const TQColorGroup &cg, const TQColorGroup &cg,
SFlags flags, SFlags flags,
SCFlags controls, SCFlags controls,
SCFlags active, SCFlags active,
const TQStyleOption &opt ) const const TQStyleOption &opt,
const TQWidget* widget ) const
{ {
switch(control) switch(control)
{ {
@ -898,13 +906,13 @@ void TQtCKStyle::drawComplexControl( ComplexControl control,
(maxedOut ? Style_Default : Style_Enabled)); (maxedOut ? Style_Default : Style_Enabled));
TQRect addline, subline, subline2, addpage, subpage, slider, first, last; TQRect addline, subline, subline2, addpage, subpage, slider, first, last;
subline = querySubControlMetrics(control, widget, SC_ScrollBarSubLine, opt); subline = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarSubLine, opt, widget);
addline = querySubControlMetrics(control, widget, SC_ScrollBarAddLine, opt); addline = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarAddLine, opt, widget);
subpage = querySubControlMetrics(control, widget, SC_ScrollBarSubPage, opt); subpage = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarSubPage, opt, widget);
addpage = querySubControlMetrics(control, widget, SC_ScrollBarAddPage, opt); addpage = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarAddPage, opt, widget);
slider = querySubControlMetrics(control, widget, SC_ScrollBarSlider, opt); slider = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarSlider, opt, widget);
first = querySubControlMetrics(control, widget, SC_ScrollBarFirst, opt); first = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarFirst, opt, widget);
last = querySubControlMetrics(control, widget, SC_ScrollBarLast, opt); last = querySubControlMetrics(control, ceData, elementFlags, SC_ScrollBarLast, opt, widget);
subline2 = addline; subline2 = addline;
if ( useThreeButtonScrollBar ) if ( useThreeButtonScrollBar )
@ -915,50 +923,50 @@ void TQtCKStyle::drawComplexControl( ComplexControl control,
// Draw the up/left button set // Draw the up/left button set
if ((controls & SC_ScrollBarSubLine) && subline.isValid()) { if ((controls & SC_ScrollBarSubLine) && subline.isValid()) {
tqdrawPrimitive(PE_ScrollBarSubLine, p, subline, cg, drawPrimitive(PE_ScrollBarSubLine, p, ceData, elementFlags, subline, cg,
sflags | (active == SC_ScrollBarSubLine ? sflags | (active == SC_ScrollBarSubLine ?
Style_Down : Style_Default)); Style_Down : Style_Default));
if (useThreeButtonScrollBar && subline2.isValid()) if (useThreeButtonScrollBar && subline2.isValid())
tqdrawPrimitive(PE_ScrollBarSubLine, p, subline2, cg, drawPrimitive(PE_ScrollBarSubLine, p, ceData, elementFlags, subline2, cg,
sflags | (active == SC_ScrollBarSubLine ? sflags | (active == SC_ScrollBarSubLine ?
Style_Down : Style_Default)); Style_Down : Style_Default));
} }
if ((controls & SC_ScrollBarAddLine) && addline.isValid()) if ((controls & SC_ScrollBarAddLine) && addline.isValid())
tqdrawPrimitive(PE_ScrollBarAddLine, p, addline, cg, drawPrimitive(PE_ScrollBarAddLine, p, ceData, elementFlags, addline, cg,
sflags | ((active == SC_ScrollBarAddLine) ? sflags | ((active == SC_ScrollBarAddLine) ?
Style_Down : Style_Default)); Style_Down : Style_Default));
if ((controls & SC_ScrollBarSubPage) && subpage.isValid()) if ((controls & SC_ScrollBarSubPage) && subpage.isValid())
tqdrawPrimitive(PE_ScrollBarSubPage, p, subpage, cg, drawPrimitive(PE_ScrollBarSubPage, p, ceData, elementFlags, subpage, cg,
sflags | ((active == SC_ScrollBarSubPage) ? sflags | ((active == SC_ScrollBarSubPage) ?
Style_Down : Style_Default)); Style_Down : Style_Default));
if ((controls & SC_ScrollBarAddPage) && addpage.isValid()) if ((controls & SC_ScrollBarAddPage) && addpage.isValid())
tqdrawPrimitive(PE_ScrollBarAddPage, p, addpage, cg, drawPrimitive(PE_ScrollBarAddPage, p, ceData, elementFlags, addpage, cg,
sflags | ((active == SC_ScrollBarAddPage) ? sflags | ((active == SC_ScrollBarAddPage) ?
Style_Down : Style_Default)); Style_Down : Style_Default));
if ((controls & SC_ScrollBarFirst) && first.isValid()) if ((controls & SC_ScrollBarFirst) && first.isValid())
tqdrawPrimitive(PE_ScrollBarFirst, p, first, cg, drawPrimitive(PE_ScrollBarFirst, p, ceData, elementFlags, first, cg,
sflags | ((active == SC_ScrollBarFirst) ? sflags | ((active == SC_ScrollBarFirst) ?
Style_Down : Style_Default)); Style_Down : Style_Default));
if ((controls & SC_ScrollBarLast) && last.isValid()) if ((controls & SC_ScrollBarLast) && last.isValid())
tqdrawPrimitive(PE_ScrollBarLast, p, last, cg, drawPrimitive(PE_ScrollBarLast, p, ceData, elementFlags, last, cg,
sflags | ((active == SC_ScrollBarLast) ? sflags | ((active == SC_ScrollBarLast) ?
Style_Down : Style_Default)); Style_Down : Style_Default));
if ((controls & SC_ScrollBarSlider) && slider.isValid()) { if ((controls & SC_ScrollBarSlider) && slider.isValid()) {
tqdrawPrimitive(PE_ScrollBarSlider, p, slider, cg, drawPrimitive(PE_ScrollBarSlider, p, ceData, elementFlags, slider, cg,
sflags | ((active == SC_ScrollBarSlider) ? sflags | ((active == SC_ScrollBarSlider) ?
Style_Down : Style_Default)); Style_Down : Style_Default));
// Draw focus rect // Draw focus rect
if (sb->hasFocus()) { if (sb->hasFocus()) {
TQRect fr(slider.x() + 2, slider.y() + 2, TQRect fr(slider.x() + 2, slider.y() + 2,
slider.width() - 5, slider.height() - 5); slider.width() - 5, slider.height() - 5);
tqdrawPrimitive(PE_FocusRect, p, fr, cg, Style_Default); drawPrimitive(PE_FocusRect, p, ceData, elementFlags, fr, cg, Style_Default);
} }
} }
break; break;
@ -969,8 +977,8 @@ void TQtCKStyle::drawComplexControl( ComplexControl control,
// ------------------------------------------------------------------- // -------------------------------------------------------------------
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());
@ -987,23 +995,23 @@ void TQtCKStyle::drawComplexControl( ComplexControl control,
// Draw slider groove // Draw slider groove
if ((controls & SC_SliderGroove) && groove.isValid()) { if ((controls & SC_SliderGroove) && groove.isValid()) {
drawKStylePrimitive( KPE_SliderGroove, &p2, widget, groove, cg, flags, opt ); drawKStylePrimitive( 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())
tqdrawPrimitive(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;
drawKStylePrimitive( KPE_SliderHandle, &p2, widget, handle, cg, flags, opt ); drawKStylePrimitive( KPE_SliderHandle, &p2, ceData, elementFlags, handle, cg, flags, opt, widget );
} }
p2.end(); p2.end();
@ -1022,7 +1030,7 @@ void TQtCKStyle::drawComplexControl( ComplexControl control,
// Paint the icon and text. // Paint the icon and text.
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 we're have a branch or are expanded... // If we're have a branch or are expanded...
if ( controls & (SC_ListViewBranch | SC_ListViewExpand) ) if ( controls & (SC_ListViewBranch | SC_ListViewExpand) )
@ -1084,7 +1092,7 @@ void TQtCKStyle::drawComplexControl( ComplexControl control,
boxflags = child->isOpen() ? TQStyle::Style_Off : TQStyle::Style_On; boxflags = child->isOpen() ? TQStyle::Style_Off : TQStyle::Style_On;
// TQtCKStyle extension: Draw the box and expand/collapse indicator // TQtCKStyle extension: Draw the box and expand/collapse indicator
drawKStylePrimitive( KPE_ListViewExpander, p, NULL, boxrect, cg, boxflags, opt ); drawKStylePrimitive( KPE_ListViewExpander, p, ceData, elementFlags, boxrect, cg, boxflags, opt, NULL );
// dotlinery // dotlinery
p->setPen( cg.mid() ); p->setPen( cg.mid() );
@ -1138,7 +1146,7 @@ void TQtCKStyle::drawComplexControl( ComplexControl control,
branchflags = TQStyle::Style_Horizontal; branchflags = TQStyle::Style_Horizontal;
// TQtCKStyle extension: Draw the horizontal branch // TQtCKStyle extension: Draw the horizontal branch
drawKStylePrimitive( KPE_ListViewBranch, p, NULL, branchrect, cg, branchflags, opt ); drawKStylePrimitive( KPE_ListViewBranch, p, ceData, elementFlags, branchrect, cg, branchflags, opt, NULL );
} else { } else {
// Vertical branch // Vertical branch
@ -1154,7 +1162,7 @@ void TQtCKStyle::drawComplexControl( ComplexControl control,
branchflags = TQStyle::Style_Default; branchflags = TQStyle::Style_Default;
// TQtCKStyle extension: Draw the vertical branch // TQtCKStyle extension: Draw the vertical branch
drawKStylePrimitive( KPE_ListViewBranch, p, NULL, branchrect, cg, branchflags, opt ); drawKStylePrimitive( KPE_ListViewBranch, p, ceData, elementFlags, branchrect, cg, branchflags, opt, NULL );
} }
} }
} }
@ -1162,19 +1170,21 @@ void TQtCKStyle::drawComplexControl( ComplexControl control,
} }
default: default:
TQCommonStyle::drawComplexControl( control, p, widget, r, cg, TQCommonStyle::drawComplexControl( control, p, ceData, elementFlags, r, cg,
flags, controls, active, opt ); flags, controls, active, opt, widget );
break; break;
} }
} }
TQStyle::SubControl TQtCKStyle::querySubControl( ComplexControl control, TQStyle::SubControl TQtCKStyle::querySubControl( ComplexControl control,
const TQWidget* widget, TQStyleControlElementData ceData,
ControlElementFlags elementFlags,
const TQPoint &pos, const TQPoint &pos,
const TQStyleOption &opt ) const const TQStyleOption &opt,
const TQWidget* widget ) const
{ {
TQStyle::SubControl ret = TQCommonStyle::querySubControl(control, widget, pos, opt); TQStyle::SubControl ret = TQCommonStyle::querySubControl(control, ceData, elementFlags, pos, opt, widget);
if (d->scrollbarType == ThreeButtonScrollBar) { if (d->scrollbarType == ThreeButtonScrollBar) {
// Enable third button // Enable third button
@ -1186,9 +1196,11 @@ TQStyle::SubControl TQtCKStyle::querySubControl( ComplexControl control,
TQRect TQtCKStyle::querySubControlMetrics( ComplexControl control, TQRect TQtCKStyle::querySubControlMetrics( ComplexControl control,
const TQWidget* widget, TQStyleControlElementData ceData,
ControlElementFlags elementFlags,
SubControl sc, SubControl sc,
const TQStyleOption &opt ) const const TQStyleOption &opt,
const TQWidget* widget ) const
{ {
TQRect ret; TQRect ret;
@ -1201,7 +1213,7 @@ TQRect TQtCKStyle::querySubControlMetrics( ComplexControl control,
const TQScrollBar *sb = (const TQScrollBar*)widget; const TQScrollBar *sb = (const TQScrollBar*)widget;
bool horizontal = sb->orientation() == Qt::Horizontal; bool horizontal = sb->orientation() == Qt::Horizontal;
int sliderstart = sb->sliderStart(); int sliderstart = sb->sliderStart();
int sbextent = pixelMetric(PM_ScrollBarExtent, widget); int sbextent = pixelMetric(PM_ScrollBarExtent, ceData, elementFlags, widget);
int maxlen = (horizontal ? sb->width() : sb->height()) int maxlen = (horizontal ? sb->width() : sb->height())
- (sbextent * (threeButtonScrollBar ? 3 : 2)); - (sbextent * (threeButtonScrollBar ? 3 : 2));
int sliderlen; int sliderlen;
@ -1212,7 +1224,7 @@ TQRect TQtCKStyle::querySubControlMetrics( ComplexControl control,
uint range = sb->maxValue() - sb->minValue(); uint range = sb->maxValue() - sb->minValue();
sliderlen = (sb->pageStep() * maxlen) / (range + sb->pageStep()); sliderlen = (sb->pageStep() * maxlen) / (range + sb->pageStep());
int slidermin = pixelMetric( PM_ScrollBarSliderMin, widget ); int slidermin = pixelMetric( PM_ScrollBarSliderMin, ceData, elementFlags, widget );
if ( sliderlen < slidermin || range > INT_MAX / 2 ) if ( sliderlen < slidermin || range > INT_MAX / 2 )
sliderlen = slidermin; sliderlen = slidermin;
if ( sliderlen > maxlen ) if ( sliderlen > maxlen )
@ -1319,11 +1331,11 @@ TQRect TQtCKStyle::querySubControlMetrics( ComplexControl control,
} }
default: default:
ret = TQCommonStyle::querySubControlMetrics(control, widget, sc, opt); ret = TQCommonStyle::querySubControlMetrics(control, ceData, elementFlags, sc, opt, widget);
break; break;
} }
} else } else
ret = TQCommonStyle::querySubControlMetrics(control, widget, sc, opt); ret = TQCommonStyle::querySubControlMetrics(control, ceData, elementFlags, sc, opt, widget);
return ret; return ret;
} }
@ -1571,8 +1583,10 @@ static const char* const critical_xpm[]={
".............aaaaaaa............"}; ".............aaaaaaa............"};
TQPixmap TQtCKStyle::stylePixmap( StylePixmap stylepixmap, TQPixmap TQtCKStyle::stylePixmap( StylePixmap stylepixmap,
const TQWidget* widget, TQStyleControlElementData ceData,
const TQStyleOption& opt) const ControlElementFlags elementFlags,
const TQStyleOption& opt,
const TQWidget* widget) const
{ {
switch (stylepixmap) { switch (stylepixmap) {
case SP_TitleBarShadeButton: case SP_TitleBarShadeButton:
@ -1598,12 +1612,12 @@ TQPixmap TQtCKStyle::stylePixmap( StylePixmap stylepixmap,
default: default:
break; break;
} }
return TQCommonStyle::stylePixmap(stylepixmap, widget, opt); return TQCommonStyle::stylePixmap(stylepixmap, ceData, elementFlags, opt, widget);
} }
int TQtCKStyle::styleHint( StyleHint sh, const TQWidget* w, int TQtCKStyle::styleHint( StyleHint sh, TQStyleControlElementData ceData, ControlElementFlags elementFlags,
const TQStyleOption &opt, TQStyleHintReturn* shr) const const TQStyleOption &opt, TQStyleHintReturn* shr, const TQWidget* w) const
{ {
switch (sh) switch (sh)
{ {
@ -1617,7 +1631,7 @@ int TQtCKStyle::styleHint( StyleHint sh, const TQWidget* w,
return d->menuAltKeyNavigation ? 1 : 0; return d->menuAltKeyNavigation ? 1 : 0;
case SH_PopupMenu_SubMenuPopupDelay: case SH_PopupMenu_SubMenuPopupDelay:
if ( styleHint( SH_PopupMenu_SloppySubMenus, w ) ) if ( styleHint( SH_PopupMenu_SloppySubMenus, ceData, elementFlags, TQStyleOption::Default, 0, w ) )
return TQMIN( 100, d->popupMenuDelay ); return TQMIN( 100, d->popupMenuDelay );
else else
return d->popupMenuDelay; return d->popupMenuDelay;
@ -1653,7 +1667,7 @@ int TQtCKStyle::styleHint( StyleHint sh, const TQWidget* w,
} }
default: default:
return TQCommonStyle::styleHint(sh, w, opt, shr); return TQCommonStyle::styleHint(sh, ceData, elementFlags, opt, shr, w);
} }
} }

@ -228,11 +228,13 @@ class TQtCKStyle: public TQCommonStyle
*/ */
virtual void drawKStylePrimitive( KStylePrimitive kpe, virtual void drawKStylePrimitive( KStylePrimitive kpe,
TQPainter* p, TQPainter* p,
const TQWidget* widget, TQStyleControlElementData ceData,
ControlElementFlags elementFlags,
const TQRect &r, const TQRect &r,
const TQColorGroup &cg, const TQColorGroup &cg,
SFlags flags = Style_Default, SFlags flags = Style_Default,
const TQStyleOption& = TQStyleOption::Default ) const; const TQStyleOption& = TQStyleOption::Default,
const TQWidget* widget = 0 ) const;
enum KStylePixelMetric { enum KStylePixelMetric {
@ -257,6 +259,8 @@ class TQtCKStyle: public TQCommonStyle
void drawPrimitive( PrimitiveElement pe, void drawPrimitive( PrimitiveElement pe,
TQPainter* p, TQPainter* p,
TQStyleControlElementData ceData,
ControlElementFlags elementFlags,
const TQRect &r, const TQRect &r,
const TQColorGroup &cg, const TQColorGroup &cg,
SFlags flags = Style_Default, SFlags flags = Style_Default,
@ -264,46 +268,56 @@ class TQtCKStyle: public TQCommonStyle
void drawControl( ControlElement element, void drawControl( ControlElement element,
TQPainter* p, TQPainter* p,
const TQWidget* widget, TQStyleControlElementData ceData,
ControlElementFlags elementFlags,
const TQRect &r, const TQRect &r,
const TQColorGroup &cg, const TQColorGroup &cg,
SFlags flags = Style_Default, SFlags flags = Style_Default,
const TQStyleOption& = TQStyleOption::Default ) const; const TQStyleOption& = TQStyleOption::Default,
const TQWidget* widget = 0 ) const;
void drawComplexControl( ComplexControl control, void drawComplexControl( ComplexControl control,
TQPainter *p, TQPainter *p,
const TQWidget* widget, TQStyleControlElementData ceData,
ControlElementFlags elementFlags,
const TQRect &r, const TQRect &r,
const TQColorGroup &cg, const TQColorGroup &cg,
SFlags flags = Style_Default, SFlags flags = Style_Default,
SCFlags controls = SC_All, SCFlags controls = SC_All,
SCFlags active = SC_None, SCFlags active = SC_None,
const TQStyleOption& = TQStyleOption::Default ) const; const TQStyleOption& = TQStyleOption::Default,
const TQWidget* widget = 0 ) const;
SubControl querySubControl( ComplexControl control, SubControl querySubControl( ComplexControl control,
const TQWidget* widget, TQStyleControlElementData ceData,
ControlElementFlags elementFlags,
const TQPoint &pos, const TQPoint &pos,
const TQStyleOption& = TQStyleOption::Default ) const; const TQStyleOption& = TQStyleOption::Default,
const TQWidget* widget = 0 ) const;
TQRect querySubControlMetrics( ComplexControl control, TQRect querySubControlMetrics( ComplexControl control,
const TQWidget* widget, TQStyleControlElementData ceData,
ControlElementFlags elementFlags,
SubControl sc, SubControl sc,
const TQStyleOption& = TQStyleOption::Default ) const; const TQStyleOption& = TQStyleOption::Default,
const TQWidget* widget = 0 ) const;
int pixelMetric( PixelMetric m, int pixelMetric( PixelMetric m, TQStyleControlElementData ceData, ControlElementFlags elementFlags,
const TQWidget* widget = 0 ) const; const TQWidget* widget = 0 ) const;
TQRect subRect( SubRect r, TQRect subRect( SubRect r, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags,
const TQWidget* widget ) const; const TQWidget* widget = 0 ) const;
TQPixmap stylePixmap( StylePixmap stylepixmap, TQPixmap stylePixmap( StylePixmap stylepixmap,
const TQWidget* widget = 0, TQStyleControlElementData ceData,
const TQStyleOption& = TQStyleOption::Default ) const; ControlElementFlags elementFlags,
const TQStyleOption& = TQStyleOption::Default,
const TQWidget* widget = 0 ) const;
int styleHint( StyleHint sh, int styleHint( StyleHint sh, TQStyleControlElementData ceData, ControlElementFlags elementFlags,
const TQWidget* w = 0,
const TQStyleOption &opt = TQStyleOption::Default, const TQStyleOption &opt = TQStyleOption::Default,
TQStyleHintReturn* shr = 0 ) const; TQStyleHintReturn* shr = 0,
const TQWidget* w = 0 ) const;
protected: protected:
bool eventFilter( TQObject* object, TQEvent* event ); bool eventFilter( TQObject* object, TQEvent* event );

File diff suppressed because it is too large Load Diff

@ -158,28 +158,28 @@ class TQtCurveStyle : public BASE_STYLE
EntryColor coloration, int round, EWidget=WIDGET_ENTRY) const; EntryColor coloration, int round, EWidget=WIDGET_ENTRY) const;
void drawArrow(TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags, void drawArrow(TQPainter *p, const TQRect &r, const TQColorGroup &cg, SFlags flags,
TQ_PrimitiveElement pe, bool small=false, bool checkActive=false) const; TQ_PrimitiveElement pe, bool small=false, bool checkActive=false) const;
void tqdrawPrimitive(TQ_PrimitiveElement, TQPainter *, const TQRect &, const TQColorGroup &, void drawPrimitive(TQ_PrimitiveElement, TQPainter *, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQRect &, const TQColorGroup &,
SFlags = Style_Default, const TQStyleOption & = TQStyleOption::Default) const; SFlags = Style_Default, const TQStyleOption & = TQStyleOption::Default) const;
void drawKStylePrimitive(KStylePrimitive kpe, TQPainter* p, const TQWidget* widget, const TQRect &r, void drawKStylePrimitive(KStylePrimitive kpe, TQPainter* p, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQRect &r,
const TQColorGroup &cg, SFlags flags, const TQStyleOption &opt ) const; const TQColorGroup &cg, SFlags flags, const TQStyleOption &opt, const TQWidget* widget = 0 ) const;
void drawControl(ControlElement, TQPainter *, const TQWidget *, const TQRect &, const TQColorGroup &, void drawControl(ControlElement, TQPainter *, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQRect &, const TQColorGroup &,
SFlags = Style_Default, const TQStyleOption & = TQStyleOption::Default) const; SFlags = Style_Default, const TQStyleOption & = TQStyleOption::Default, const TQWidget * = 0) const;
void drawControlMask(ControlElement, TQPainter *, const TQWidget *, const TQRect &, void drawControlMask(ControlElement, TQPainter *, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQRect &,
const TQStyleOption & = TQStyleOption::Default) const; const TQStyleOption & = TQStyleOption::Default, const TQWidget * = 0) const;
void drawComplexControlMask(ComplexControl control, TQPainter *p, const TQWidget *widget, void drawComplexControlMask(ComplexControl control, TQPainter *p, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags,
const TQRect &r, const TQStyleOption &data) const; const TQRect &r, const TQStyleOption &data, const TQWidget *widget) const;
TQRect subRect(SubRect, const TQWidget *) const; TQRect subRect(SubRect, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags, const TQWidget * = 0) const;
void drawComplexControl(ComplexControl, TQPainter *, const TQWidget *, const TQRect &, void drawComplexControl(ComplexControl, TQPainter *, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQRect &,
const TQColorGroup &, SFlags = Style_Default, SCFlags = SC_All, const TQColorGroup &, SFlags = Style_Default, SCFlags = SC_All,
SCFlags = SC_None, const TQStyleOption & = TQStyleOption::Default) const; SCFlags = SC_None, const TQStyleOption & = TQStyleOption::Default, const TQWidget * = 0) const;
TQRect querySubControlMetrics(TQ_ComplexControl, const TQWidget *, SubControl, TQRect querySubControlMetrics(TQ_ComplexControl, TQStyleControlElementData ceData, ControlElementFlags elementFlags, SubControl,
const TQStyleOption & = TQStyleOption::Default) const; const TQStyleOption & = TQStyleOption::Default, const TQWidget * = 0) const;
int pixelMetric(PixelMetric, const TQWidget *widget= 0) const; int pixelMetric(PixelMetric, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQWidget *widget= 0) const;
int kPixelMetric(KStylePixelMetric kpm, const TQWidget *widget) const; int kPixelMetric(KStylePixelMetric kpm, const TQWidget *widget) const;
TQSize tqsizeFromContents(ContentsType, const TQWidget *, const TQSize &, TQSize sizeFromContents(ContentsType, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQSize &,
const TQStyleOption & = TQStyleOption::Default) const; const TQStyleOption & = TQStyleOption::Default, const TQWidget * = 0) const;
int styleHint(StyleHint, const TQWidget *widget= 0, const TQStyleOption & = TQStyleOption::Default, int styleHint(StyleHint, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQStyleOption & = TQStyleOption::Default,
TQStyleHintReturn *returnData= 0) const; TQStyleHintReturn *returnData= 0, const TQWidget *widget= 0) const;
void drawItem(TQPainter *p, const TQRect &r, int flags, const TQColorGroup &cg, bool enabled, void drawItem(TQPainter *p, const TQRect &r, int flags, const TQColorGroup &cg, bool enabled,
const TQPixmap *pixmap, const TQString &text, int len=-1, const TQColor *penColor=0) const; const TQPixmap *pixmap, const TQString &text, int len=-1, const TQColor *penColor=0) const;

Loading…
Cancel
Save