|
|
|
@ -9,7 +9,7 @@
|
|
|
|
|
//
|
|
|
|
|
// Some miscellaneous notes
|
|
|
|
|
//
|
|
|
|
|
// Reimplemented scrollbar metric and drawing routines from KStyle to allow
|
|
|
|
|
// Reimplemented scrollbar metric and drawing routines from TDEStyle to allow
|
|
|
|
|
// better placement of subcontrols. This is because the subcontrols slightly
|
|
|
|
|
// overlap to share part of their border.
|
|
|
|
|
//
|
|
|
|
@ -81,7 +81,7 @@ static unsigned contrast = 110;
|
|
|
|
|
// Constructor
|
|
|
|
|
|
|
|
|
|
PhaseStyle::PhaseStyle()
|
|
|
|
|
: KStyle(FilledFrameWorkaround | AllowMenuTransparency,
|
|
|
|
|
: TDEStyle(FilledFrameWorkaround | AllowMenuTransparency,
|
|
|
|
|
ThreeButtonScrollBar),
|
|
|
|
|
gradients_(TQPixmap::defaultDepth() > 8), kicker_(false)
|
|
|
|
|
{
|
|
|
|
@ -180,7 +180,7 @@ void PhaseStyle::polish(const TQStyleControlElementData &ceData, ControlElementF
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KStyle::polish(ceData, elementFlags, ptr);
|
|
|
|
|
TDEStyle::polish(ceData, elementFlags, ptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
@ -238,7 +238,7 @@ void PhaseStyle::unPolish(const TQStyleControlElementData &ceData, ControlElemen
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KStyle::unPolish(ceData, elementFlags, ptr);
|
|
|
|
|
TDEStyle::unPolish(ceData, elementFlags, ptr);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
@ -1025,16 +1025,16 @@ void PhaseStyle::drawPrimitive(TQ_PrimitiveElement element,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
KStyle::drawPrimitive(element, painter, ceData, elementFlags, rect, group, flags, option);
|
|
|
|
|
TDEStyle::drawPrimitive(element, painter, ceData, elementFlags, rect, group, flags, option);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
// drawKStylePrimitive()
|
|
|
|
|
// drawTDEStylePrimitive()
|
|
|
|
|
// ---------------------
|
|
|
|
|
// Draw the element
|
|
|
|
|
|
|
|
|
|
void PhaseStyle::drawKStylePrimitive(KStylePrimitive element,
|
|
|
|
|
void PhaseStyle::drawTDEStylePrimitive(TDEStylePrimitive element,
|
|
|
|
|
TQPainter *painter,
|
|
|
|
|
const TQStyleControlElementData &ceData,
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
@ -1143,7 +1143,7 @@ void PhaseStyle::drawKStylePrimitive(KStylePrimitive element,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
KStyle::drawKStylePrimitive(element, painter, ceData, elementFlags, rect,
|
|
|
|
|
TDEStyle::drawTDEStylePrimitive(element, painter, ceData, elementFlags, rect,
|
|
|
|
|
group, flags, option, widget);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1205,7 +1205,7 @@ void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
|
case CE_PushButtonLabel: {
|
|
|
|
|
const TQPushButton* button = ::tqqt_cast<const TQPushButton*>(widget);
|
|
|
|
|
if (!button) {
|
|
|
|
|
KStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
TDEStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
flags, option, widget);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -1320,7 +1320,7 @@ void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
|
case CE_MenuBarItem: {
|
|
|
|
|
const TQMenuBar *mbar = ::tqqt_cast<const TQMenuBar*>(widget);
|
|
|
|
|
if (!mbar) {
|
|
|
|
|
KStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
TDEStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
flags, option, widget);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -1350,7 +1350,7 @@ void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
|
|
|
|
|
|
case CE_PopupMenuItem: {
|
|
|
|
|
if (!ceData.widgetObjectTypes.contains(TQPOPUPMENU_OBJECT_NAME_STRING)) {
|
|
|
|
|
KStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
TDEStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
flags, option, widget);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -1508,7 +1508,7 @@ void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
|
drawPhaseTab(painter, x, y, w, h, group, ceData, elementFlags, option,
|
|
|
|
|
flags);
|
|
|
|
|
} else { // not a tabbar
|
|
|
|
|
KStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
TDEStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
flags, option, widget);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -1523,7 +1523,7 @@ void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
|
|
|
|
|
|
case CE_ProgressBarContents: {
|
|
|
|
|
if (!ceData.widgetObjectTypes.contains(TQPROGRESSBAR_OBJECT_NAME_STRING)) {
|
|
|
|
|
KStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
TDEStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
flags, option, widget);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -1552,7 +1552,7 @@ void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
|
case CE_ToolBoxTab: {
|
|
|
|
|
const TQToolBox *box = ::tqqt_cast<const TQToolBox*>(widget);
|
|
|
|
|
if (!box) {
|
|
|
|
|
KStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
TDEStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
flags, option, widget);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -1587,7 +1587,7 @@ void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
KStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
TDEStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
flags, option, widget);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -1612,7 +1612,7 @@ void PhaseStyle::drawControlMask(TQ_ControlElement element,
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
KStyle::drawControlMask(element, painter, ceData, elementFlags, rect, option, widget);
|
|
|
|
|
TDEStyle::drawControlMask(element, painter, ceData, elementFlags, rect, option, widget);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -1779,7 +1779,7 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
|
case CC_SpinWidget: {
|
|
|
|
|
const TQSpinWidget *spin = ::tqqt_cast<const TQSpinWidget*>(widget);
|
|
|
|
|
if (!spin) {
|
|
|
|
|
KStyle::drawComplexControl(control, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
TDEStyle::drawComplexControl(control, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
flags, controls, active, option, widget);
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
@ -1908,7 +1908,7 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
KStyle::drawComplexControl(control, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
TDEStyle::drawComplexControl(control, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
flags, controls, active, option, widget);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
@ -1936,7 +1936,7 @@ void PhaseStyle::drawComplexControlMask(TQ_ComplexControl control,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
KStyle::drawComplexControlMask(control,painter,ceData,elementFlags,rect,option,widget);
|
|
|
|
|
TDEStyle::drawComplexControlMask(control,painter,ceData,elementFlags,rect,option,widget);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2001,7 +2001,7 @@ int PhaseStyle::pixelMetric(PixelMetric metric, const TQStyleControlElementData
|
|
|
|
|
return ITEMFRAME;
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
return KStyle::pixelMetric(metric, ceData, elementFlags, widget);
|
|
|
|
|
return TDEStyle::pixelMetric(metric, ceData, elementFlags, widget);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2021,7 +2021,7 @@ TQRect PhaseStyle::subRect(SubRect rect, const TQStyleControlElementData &ceData
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
return KStyle::subRect(rect, ceData, elementFlags, widget);
|
|
|
|
|
return TDEStyle::subRect(rect, ceData, elementFlags, widget);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2073,7 +2073,7 @@ TQRect PhaseStyle::querySubControlMetrics(TQ_ComplexControl control,
|
|
|
|
|
|
|
|
|
|
case CC_ScrollBar: {
|
|
|
|
|
bool horizontal = (ceData.orientation == TQt::Horizontal);
|
|
|
|
|
rect = KStyle::querySubControlMetrics(control, ceData, elementFlags,
|
|
|
|
|
rect = TDEStyle::querySubControlMetrics(control, ceData, elementFlags,
|
|
|
|
|
subcontrol, option, widget);
|
|
|
|
|
|
|
|
|
|
// adjust the standard metrics so controls can "overlap"
|
|
|
|
@ -2116,7 +2116,7 @@ TQRect PhaseStyle::querySubControlMetrics(TQ_ComplexControl control,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
rect = KStyle::querySubControlMetrics(control, ceData, elementFlags, subcontrol,
|
|
|
|
|
rect = TDEStyle::querySubControlMetrics(control, ceData, elementFlags, subcontrol,
|
|
|
|
|
option, widget);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2142,7 +2142,7 @@ TQSize PhaseStyle::sizeFromContents(ContentsType contents,
|
|
|
|
|
case CT_PushButton: {
|
|
|
|
|
const TQPushButton* button = ::tqqt_cast<const TQPushButton*>(widget);
|
|
|
|
|
if (!button) {
|
|
|
|
|
return KStyle::sizeFromContents(contents, ceData, elementFlags, contentsize,
|
|
|
|
|
return TDEStyle::sizeFromContents(contents, ceData, elementFlags, contentsize,
|
|
|
|
|
option, widget);
|
|
|
|
|
}
|
|
|
|
|
int margin = pixelMetric(PM_ButtonMargin, ceData, elementFlags, widget)
|
|
|
|
@ -2162,7 +2162,7 @@ TQSize PhaseStyle::sizeFromContents(ContentsType contents,
|
|
|
|
|
case CT_PopupMenuItem: {
|
|
|
|
|
if (!widget || option.isDefault()) return contentsize;
|
|
|
|
|
if (!ceData.widgetObjectTypes.contains(TQPOPUPMENU_OBJECT_NAME_STRING)) {
|
|
|
|
|
return KStyle::sizeFromContents(contents, ceData, elementFlags, contentsize,
|
|
|
|
|
return TDEStyle::sizeFromContents(contents, ceData, elementFlags, contentsize,
|
|
|
|
|
option, widget);
|
|
|
|
|
}
|
|
|
|
|
TQMenuItem *item = option.menuItem();
|
|
|
|
@ -2206,7 +2206,7 @@ TQSize PhaseStyle::sizeFromContents(ContentsType contents,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
|
return KStyle::sizeFromContents(contents, ceData, elementFlags, contentsize,
|
|
|
|
|
return TDEStyle::sizeFromContents(contents, ceData, elementFlags, contentsize,
|
|
|
|
|
option, widget);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
@ -2246,7 +2246,7 @@ int PhaseStyle::styleHint(StyleHint sh, const TQStyleControlElementData &ceData,
|
|
|
|
|
}
|
|
|
|
|
break;
|
|
|
|
|
default:
|
|
|
|
|
ret = KStyle::styleHint(sh, ceData, elementFlags, opt, returnData, w);
|
|
|
|
|
ret = TDEStyle::styleHint(sh, ceData, elementFlags, opt, returnData, w);
|
|
|
|
|
break;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -2264,7 +2264,7 @@ bool PhaseStyle::objectEventHandler( const TQStyleControlElementData &ceData, Co
|
|
|
|
|
if (ceData.widgetObjectTypes.contains(TQOBJECT_OBJECT_NAME_STRING)) {
|
|
|
|
|
TQObject* object = reinterpret_cast<TQObject*>(source);
|
|
|
|
|
|
|
|
|
|
if (KStyle::objectEventHandler(ceData, elementFlags, source, event)) return true;
|
|
|
|
|
if (TDEStyle::objectEventHandler(ceData, elementFlags, source, event)) return true;
|
|
|
|
|
if (!object->isWidgetType()) return false;
|
|
|
|
|
|
|
|
|
|
bool horiz;
|
|
|
|
|