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