diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/kernel/ntqstyle.h | 9 | ||||
-rw-r--r-- | src/styles/qcommonstyle.cpp | 65 |
2 files changed, 74 insertions, 0 deletions
diff --git a/src/kernel/ntqstyle.h b/src/kernel/ntqstyle.h index de5977fe0..73543dd99 100644 --- a/src/kernel/ntqstyle.h +++ b/src/kernel/ntqstyle.h @@ -203,6 +203,8 @@ class TQStyleControlElementGenericWidgetData { TQPalette palette; TQFont font; TQColor paletteBgColor; + TQString name; + TQString caption; }; class TQStyleControlElementTabBarData { @@ -280,6 +282,10 @@ class Q_EXPORT TQStyleControlElementData { TQ_UINT32 comboBoxListBoxFlags; TQColor paletteBgColor; TQ_UINT32 parentWidgetFlags; + TQString name; + TQString caption; + TQStyleControlElementGenericWidgetData topLevelWidgetData; + TQ_UINT32 topLevelWidgetFlags; public: TQStyleControlElementData(); @@ -343,6 +349,7 @@ public: CEF_IsActiveWindow = 0x00200000, CEF_IsTopLevel = 0x00400000, CEF_IsVisible = 0x00800000, + CEF_IsShown = 0x01000000, CEF_HasMouse = 0x01000000 }; @@ -473,6 +480,8 @@ public: PE_MenuItemIndicatorIconFrame, PE_MenuItemIndicatorCheck, + PE_ScrollBarTrough, + // do not add any values below/greater this PE_CustomBase = 0xf000000 }; diff --git a/src/styles/qcommonstyle.cpp b/src/styles/qcommonstyle.cpp index 19b5aa444..4406346e1 100644 --- a/src/styles/qcommonstyle.cpp +++ b/src/styles/qcommonstyle.cpp @@ -196,6 +196,12 @@ TQStyle::ControlElementFlags getControlElementFlagsForObject(const TQObject* obj if (t->identifier() == tb->currentTab()) cef = cef | TQStyle::CEF_IsActive; } } + if (objectTypeList.contains("TQTitleBar")) { + const TQTitleBar *tb = dynamic_cast<const TQTitleBar*>(object); + if (tb) { + if (tb->isActive()) cef = cef | TQStyle::CEF_IsActive; + } + } if (objectTypeList.contains("TQToolBox")) { const TQToolBox *tb = dynamic_cast<const TQToolBox*>(object); if (tb) { @@ -233,6 +239,7 @@ TQStyle::ControlElementFlags getControlElementFlagsForObject(const TQObject* obj if (widget->isActiveWindow()) cef = cef | TQStyle::CEF_IsActiveWindow; if (widget->isTopLevel()) cef = cef | TQStyle::CEF_IsTopLevel; if (widget->isVisible()) cef = cef | TQStyle::CEF_IsVisible; + if (widget->isShown()) cef = cef | TQStyle::CEF_IsShown; } } } @@ -277,6 +284,8 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w } ceData.palette = widget->palette(); ceData.font = widget->font(); + ceData.name = widget->name(); + ceData.caption = widget->caption(); if (ceData.widgetObjectTypes.contains("TQPushButton")) { const TQPushButton *button = dynamic_cast<const TQPushButton*>(widget); if (button) { @@ -517,6 +526,8 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w } ceData.viewportData.palette = viewport->palette(); ceData.viewportData.font = viewport->font(); + ceData.viewportData.name = viewport->name(); + ceData.viewportData.caption = viewport->caption(); } } } @@ -572,6 +583,8 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w } ceData.parentWidgetData.palette = parentWidget->palette(); ceData.parentWidgetData.font = parentWidget->font(); + ceData.parentWidgetData.name = parentWidget->name(); + ceData.parentWidgetData.caption = parentWidget->caption(); const TQDockWindow * dw = dynamic_cast<const TQDockWindow*>(parentWidget); if (dw) { @@ -590,6 +603,58 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w } ceData.parentWidgetFlags = getControlElementFlagsForObject(parentWidget, ceData.parentWidgetData.widgetObjectTypes, TQStyleOption::Default, populateReliantFields); } + const TQWidget* topLevelWidget = widget->topLevelWidget(); + if (topLevelWidget) { + ceData.topLevelWidgetData.widgetObjectTypes = getObjectTypeListForObject(topLevelWidget); + ceData.topLevelWidgetData.allDataPopulated = populateReliantFields; + const TQPixmap* erasePixmap = topLevelWidget->backgroundPixmap(); + if (erasePixmap) { + ceData.topLevelWidgetData.bgPixmap = *erasePixmap; + } + if (populateReliantFields) { + ceData.topLevelWidgetData.bgBrush = topLevelWidget->backgroundBrush(); + } + ceData.topLevelWidgetData.wflags = topLevelWidget->getWFlags(); + if (populateReliantFields) { + ceData.topLevelWidgetData.windowState = (TQt::WindowState)(widget->windowState()); + } + ceData.topLevelWidgetData.bgColor = topLevelWidget->eraseColor(); + ceData.topLevelWidgetData.bgOffset = topLevelWidget->backgroundOffset(); + ceData.topLevelWidgetData.backgroundMode = topLevelWidget->backgroundMode(); + if (populateReliantFields) { + ceData.topLevelWidgetData.fgColor = topLevelWidget->foregroundColor(); + ceData.topLevelWidgetData.colorGroup = topLevelWidget->colorGroup(); + ceData.topLevelWidgetData.paletteBgColor = topLevelWidget->paletteBackgroundColor(); + } + ceData.topLevelWidgetData.geometry = topLevelWidget->geometry(); + ceData.topLevelWidgetData.rect = topLevelWidget->rect(); + ceData.topLevelWidgetData.pos = topLevelWidget->pos(); + const TQPixmap* icon = topLevelWidget->icon(); + if (icon) { + ceData.topLevelWidgetData.icon = *icon; + } + ceData.topLevelWidgetData.palette = topLevelWidget->palette(); + ceData.topLevelWidgetData.font = topLevelWidget->font(); + ceData.topLevelWidgetData.name = topLevelWidget->name(); + ceData.topLevelWidgetData.caption = topLevelWidget->caption(); + + const TQDockWindow * dw = dynamic_cast<const TQDockWindow*>(topLevelWidget); + if (dw) { + if (dw->area()) { + ceData.dwData.hasDockArea = true; + ceData.dwData.areaOrientation = dw->area()->orientation(); + } + else { + ceData.dwData.hasDockArea = false; + } + ceData.dwData.closeEnabled = dw->isCloseEnabled(); + } + const TQToolBar * toolbar = dynamic_cast<const TQToolBar*>(topLevelWidget); + if (toolbar) { + ceData.toolBarData.orientation = toolbar->orientation(); + } + ceData.topLevelWidgetFlags = getControlElementFlagsForObject(topLevelWidget, ceData.topLevelWidgetData.widgetObjectTypes, TQStyleOption::Default, populateReliantFields); + } TQCheckListItem *item = opt.checkListItem(); if (item) { |