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