|
|
|
@ -154,26 +154,26 @@ void PhaseStyle::polish(const TQStyleControlElementData &ceData, ControlElementF
|
|
|
|
|
if (ceData.widgetObjectTypes.contains("TQWidget")) {
|
|
|
|
|
TQWidget *widget = reinterpret_cast<TQWidget*>(ptr);
|
|
|
|
|
|
|
|
|
|
if (::tqqt_cast<TQMenuBar*>(widget) ||
|
|
|
|
|
::tqqt_cast<TQPopupMenu*>(widget)) {
|
|
|
|
|
if (::tqt_cast<TQMenuBar*>(widget) ||
|
|
|
|
|
::tqt_cast<TQPopupMenu*>(widget)) {
|
|
|
|
|
// anti-flicker optimization
|
|
|
|
|
widget->setBackgroundMode(NoBackground);
|
|
|
|
|
} else if (::tqqt_cast<TQFrame*>(widget) ||
|
|
|
|
|
} else if (::tqt_cast<TQFrame*>(widget) ||
|
|
|
|
|
widget->inherits(TQTOOLBAREXTENSION) ||
|
|
|
|
|
(!qstrcmp(widget->name(), KTOOLBARWIDGET))) {
|
|
|
|
|
// needs special handling on paint events
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
} else if (highlights_ &&
|
|
|
|
|
(::tqqt_cast<TQPushButton*>(widget) ||
|
|
|
|
|
::tqqt_cast<TQComboBox*>(widget) ||
|
|
|
|
|
::tqqt_cast<TQSpinWidget*>(widget) ||
|
|
|
|
|
::tqqt_cast<TQCheckBox*>(widget) ||
|
|
|
|
|
::tqqt_cast<TQRadioButton*>(widget) ||
|
|
|
|
|
::tqqt_cast<TQSlider*>(widget) ||
|
|
|
|
|
(::tqt_cast<TQPushButton*>(widget) ||
|
|
|
|
|
::tqt_cast<TQComboBox*>(widget) ||
|
|
|
|
|
::tqt_cast<TQSpinWidget*>(widget) ||
|
|
|
|
|
::tqt_cast<TQCheckBox*>(widget) ||
|
|
|
|
|
::tqt_cast<TQRadioButton*>(widget) ||
|
|
|
|
|
::tqt_cast<TQSlider*>(widget) ||
|
|
|
|
|
widget->inherits(TQSPLITTERHANDLE))) {
|
|
|
|
|
// mouseover highlighting
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
} else if (highlights_ && ::tqqt_cast<TQTabBar*>(widget)) {
|
|
|
|
|
} else if (highlights_ && ::tqt_cast<TQTabBar*>(widget)) {
|
|
|
|
|
// highlighting needing mouse tracking
|
|
|
|
|
widget->setMouseTracking(true);
|
|
|
|
|
installObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
@ -216,23 +216,23 @@ void PhaseStyle::unPolish(const TQStyleControlElementData &ceData, ControlElemen
|
|
|
|
|
if (ceData.widgetObjectTypes.contains("TQWidget")) {
|
|
|
|
|
TQWidget *widget = reinterpret_cast<TQWidget*>(ptr);
|
|
|
|
|
|
|
|
|
|
if (::tqqt_cast<TQMenuBar*>(widget) ||
|
|
|
|
|
::tqqt_cast<TQPopupMenu*>(widget)) {
|
|
|
|
|
if (::tqt_cast<TQMenuBar*>(widget) ||
|
|
|
|
|
::tqt_cast<TQPopupMenu*>(widget)) {
|
|
|
|
|
widget->setBackgroundMode(PaletteBackground);
|
|
|
|
|
} else if (::tqqt_cast<TQFrame*>(widget) ||
|
|
|
|
|
} else if (::tqt_cast<TQFrame*>(widget) ||
|
|
|
|
|
widget->inherits(TQTOOLBAREXTENSION) ||
|
|
|
|
|
(!qstrcmp(widget->name(), KTOOLBARWIDGET))) {
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
} else if (highlights_ && // highlighting
|
|
|
|
|
(::tqqt_cast<TQPushButton*>(widget) ||
|
|
|
|
|
::tqqt_cast<TQComboBox*>(widget) ||
|
|
|
|
|
::tqqt_cast<TQSpinWidget*>(widget) ||
|
|
|
|
|
::tqqt_cast<TQCheckBox*>(widget) ||
|
|
|
|
|
::tqqt_cast<TQRadioButton*>(widget) ||
|
|
|
|
|
::tqqt_cast<TQSlider*>(widget) ||
|
|
|
|
|
(::tqt_cast<TQPushButton*>(widget) ||
|
|
|
|
|
::tqt_cast<TQComboBox*>(widget) ||
|
|
|
|
|
::tqt_cast<TQSpinWidget*>(widget) ||
|
|
|
|
|
::tqt_cast<TQCheckBox*>(widget) ||
|
|
|
|
|
::tqt_cast<TQRadioButton*>(widget) ||
|
|
|
|
|
::tqt_cast<TQSlider*>(widget) ||
|
|
|
|
|
widget->inherits(TQSPLITTERHANDLE))) {
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
} else if (highlights_ && ::tqqt_cast<TQTabBar*>(widget)) {
|
|
|
|
|
} else if (highlights_ && ::tqt_cast<TQTabBar*>(widget)) {
|
|
|
|
|
widget->setMouseTracking(false);
|
|
|
|
|
removeObjectEventHandler(ceData, elementFlags, ptr, this);
|
|
|
|
|
}
|
|
|
|
@ -895,7 +895,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
|
|
|
|
|
bool flat = true;
|
|
|
|
|
|
|
|
|
|
if (ceData.parentWidgetData.widgetObjectTypes.contains("TQToolBar")) {
|
|
|
|
|
TQToolBar *toolbar = ::tqqt_cast<TQToolBar*>(widget->parent());
|
|
|
|
|
TQToolBar *toolbar = ::tqt_cast<TQToolBar*>(widget->parent());
|
|
|
|
|
if (toolbar) {
|
|
|
|
|
// toolbar not floating or in a TQMainWindow
|
|
|
|
|
flat = flatToolbar(ceData, elementFlags, toolbar);
|
|
|
|
@ -1203,7 +1203,7 @@ void PhaseStyle::drawControl(ControlElement element,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case CE_PushButtonLabel: {
|
|
|
|
|
const TQPushButton* button = ::tqqt_cast<const TQPushButton*>(widget);
|
|
|
|
|
const TQPushButton* button = ::tqt_cast<const TQPushButton*>(widget);
|
|
|
|
|
if (!button) {
|
|
|
|
|
TDEStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
flags, option, widget);
|
|
|
|
@ -1280,7 +1280,7 @@ void PhaseStyle::drawControl(ControlElement element,
|
|
|
|
|
|
|
|
|
|
case CE_CheckBoxLabel:
|
|
|
|
|
case CE_RadioButtonLabel: {
|
|
|
|
|
const TQButton *b = ::tqqt_cast<const TQButton*>(widget);
|
|
|
|
|
const TQButton *b = ::tqt_cast<const TQButton*>(widget);
|
|
|
|
|
if (!b) return;
|
|
|
|
|
|
|
|
|
|
int alignment = reverse_ ? AlignRight : AlignLeft;
|
|
|
|
@ -1298,7 +1298,7 @@ void PhaseStyle::drawControl(ControlElement element,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case CE_DockWindowEmptyArea: {
|
|
|
|
|
const TQToolBar *tb = ::tqqt_cast<const TQToolBar*>(widget);
|
|
|
|
|
const TQToolBar *tb = ::tqt_cast<const TQToolBar*>(widget);
|
|
|
|
|
if (tb) {
|
|
|
|
|
// toolbar not floating or in a TQMainWindow
|
|
|
|
|
if (flatToolbar(ceData, elementFlags, tb)) {
|
|
|
|
@ -1318,7 +1318,7 @@ void PhaseStyle::drawControl(ControlElement element,
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
case CE_MenuBarItem: {
|
|
|
|
|
const TQMenuBar *mbar = ::tqqt_cast<const TQMenuBar*>(widget);
|
|
|
|
|
const TQMenuBar *mbar = ::tqt_cast<const TQMenuBar*>(widget);
|
|
|
|
|
if (!mbar) {
|
|
|
|
|
TDEStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
flags, option, widget);
|
|
|
|
@ -1550,7 +1550,7 @@ void PhaseStyle::drawControl(ControlElement element,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case CE_ToolBoxTab: {
|
|
|
|
|
const TQToolBox *box = ::tqqt_cast<const TQToolBox*>(widget);
|
|
|
|
|
const TQToolBox *box = ::tqt_cast<const TQToolBox*>(widget);
|
|
|
|
|
if (!box) {
|
|
|
|
|
TDEStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
flags, option, widget);
|
|
|
|
@ -1777,7 +1777,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case CC_SpinWidget: {
|
|
|
|
|
const TQSpinWidget *spin = ::tqqt_cast<const TQSpinWidget*>(widget);
|
|
|
|
|
const TQSpinWidget *spin = ::tqt_cast<const TQSpinWidget*>(widget);
|
|
|
|
|
if (!spin) {
|
|
|
|
|
TDEStyle::drawComplexControl(control, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
flags, controls, active, option, widget);
|
|
|
|
@ -1837,7 +1837,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
case CC_ToolButton: {
|
|
|
|
|
const TQToolButton *btn = ::tqqt_cast<const TQToolButton*>(widget);
|
|
|
|
|
const TQToolButton *btn = ::tqt_cast<const TQToolButton*>(widget);
|
|
|
|
|
|
|
|
|
|
TQToolBar *toolbar;
|
|
|
|
|
bool horiz = true;
|
|
|
|
@ -1848,7 +1848,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
|
|
|
|
|
|
|
|
|
|
// check for TQToolBar parent
|
|
|
|
|
if (ceData.parentWidgetData.widgetObjectTypes.contains("TQToolBar")) {
|
|
|
|
|
toolbar = (btn)?::tqqt_cast<TQToolBar*>(btn->parent()):NULL;
|
|
|
|
|
toolbar = (btn)?::tqt_cast<TQToolBar*>(btn->parent()):NULL;
|
|
|
|
|
horiz = (ceData.toolBarData.orientation == TQt::Horizontal);
|
|
|
|
|
if (normal) { // draw background
|
|
|
|
|
if (toolbar && flatToolbar(ceData, elementFlags, toolbar)) {
|
|
|
|
@ -1871,8 +1871,8 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
|
|
|
|
|
// check for TQToolBarExtensionWidget parent
|
|
|
|
|
else if (btn && ceData.parentWidgetData.widgetObjectTypes.contains(TQTOOLBAREXTENSION)) {
|
|
|
|
|
TQWidget *extension;
|
|
|
|
|
if ((extension = ::tqqt_cast<TQWidget*>(btn->parent()))) {
|
|
|
|
|
toolbar = ::tqqt_cast<TQToolBar*>(extension->parent());
|
|
|
|
|
if ((extension = ::tqt_cast<TQWidget*>(btn->parent()))) {
|
|
|
|
|
toolbar = ::tqt_cast<TQToolBar*>(extension->parent());
|
|
|
|
|
if (toolbar) {
|
|
|
|
|
horiz = (toolbar->orientation() == TQt::Horizontal);
|
|
|
|
|
if (normal) { // draw background
|
|
|
|
@ -2140,7 +2140,7 @@ TQSize PhaseStyle::sizeFromContents(ContentsType contents,
|
|
|
|
|
|
|
|
|
|
switch (contents) {
|
|
|
|
|
case CT_PushButton: {
|
|
|
|
|
const TQPushButton* button = ::tqqt_cast<const TQPushButton*>(widget);
|
|
|
|
|
const TQPushButton* button = ::tqt_cast<const TQPushButton*>(widget);
|
|
|
|
|
if (!button) {
|
|
|
|
|
return TDEStyle::sizeFromContents(contents, ceData, elementFlags, contentsize,
|
|
|
|
|
option, widget);
|
|
|
|
@ -2280,21 +2280,21 @@ bool PhaseStyle::objectEventHandler( const TQStyleControlElementData &ceData, Co
|
|
|
|
|
// TDE Toolbar Widget
|
|
|
|
|
// patch by Daniel Brownlees <dbrownlees@paradise.net.nz>
|
|
|
|
|
if (object->parent() && !qstrcmp(object->name(), KTOOLBARWIDGET)) {
|
|
|
|
|
if (0 == (widget = ::tqqt_cast<TQWidget*>(object))) return false;
|
|
|
|
|
TQWidget *parent = ::tqqt_cast<TQWidget*>(object->parent());
|
|
|
|
|
if (0 == (widget = ::tqt_cast<TQWidget*>(object))) return false;
|
|
|
|
|
TQWidget *parent = ::tqt_cast<TQWidget*>(object->parent());
|
|
|
|
|
int px = ceData.rect.x(), py = ceData.rect.y();
|
|
|
|
|
// find the toolbar
|
|
|
|
|
while (parent && parent->parent()
|
|
|
|
|
&& !::tqqt_cast<TQToolBar*>(parent)) {
|
|
|
|
|
&& !::tqt_cast<TQToolBar*>(parent)) {
|
|
|
|
|
px += parent->x();
|
|
|
|
|
py += parent->y();
|
|
|
|
|
parent = ::tqqt_cast<TQWidget*>(parent->parent());
|
|
|
|
|
parent = ::tqt_cast<TQWidget*>(parent->parent());
|
|
|
|
|
}
|
|
|
|
|
if (!parent) return false;
|
|
|
|
|
ceData.rect.rect(&x, &y, &w, &h);
|
|
|
|
|
TQRect prect = parent->rect();
|
|
|
|
|
|
|
|
|
|
toolbar = ::tqqt_cast<TQToolBar*>(parent);
|
|
|
|
|
toolbar = ::tqt_cast<TQToolBar*>(parent);
|
|
|
|
|
horiz = (toolbar) ? (toolbar->orientation() == TQt::Horizontal)
|
|
|
|
|
: (prect.height() < prect.width());
|
|
|
|
|
TQPainter painter(widget);
|
|
|
|
@ -2318,8 +2318,8 @@ bool PhaseStyle::objectEventHandler( const TQStyleControlElementData &ceData, Co
|
|
|
|
|
|
|
|
|
|
// TQToolBarExtensionWidget
|
|
|
|
|
else if (object && object->isWidgetType() && object->parent() &&
|
|
|
|
|
(toolbar = ::tqqt_cast<TQToolBar*>(object->parent()))) {
|
|
|
|
|
if (0 == (widget = ::tqqt_cast<TQWidget*>(object))) return false;
|
|
|
|
|
(toolbar = ::tqt_cast<TQToolBar*>(object->parent()))) {
|
|
|
|
|
if (0 == (widget = ::tqt_cast<TQWidget*>(object))) return false;
|
|
|
|
|
horiz = (toolbar->orientation() == TQt::Horizontal);
|
|
|
|
|
TQPainter painter(widget);
|
|
|
|
|
ceData.rect.rect(&x, &y, &w, &h);
|
|
|
|
@ -2349,7 +2349,7 @@ bool PhaseStyle::objectEventHandler( const TQStyleControlElementData &ceData, Co
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// TQFrame lines (do this guy last)
|
|
|
|
|
else if (0 != (frame = ::tqqt_cast<TQFrame*>(object))) {
|
|
|
|
|
else if (0 != (frame = ::tqt_cast<TQFrame*>(object))) {
|
|
|
|
|
TQFrame::Shape shape = frame->frameShape();
|
|
|
|
|
switch (shape) {
|
|
|
|
|
case TQFrame::HLine:
|
|
|
|
|