summaryrefslogtreecommitdiffstats
path: root/src/styles
diff options
context:
space:
mode:
authorDarrell Anderson <[email protected]>2012-10-19 22:51:19 -0500
committerDarrell Anderson <[email protected]>2012-10-19 22:51:19 -0500
commite230650065e8fd82816319f8fa1c63507027d022 (patch)
tree1bbb6c6e5ec8b92bd94f34eee95d01a863d4c61e /src/styles
parent06e01077e1826d986821404d87de10399a7c1b6e (diff)
parent691129fbcb6c0f377abac61c6051700b4148efc4 (diff)
downloadtqt3-e230650065e8fd82816319f8fa1c63507027d022.tar.gz
tqt3-e230650065e8fd82816319f8fa1c63507027d022.zip
Merge branch 'master' of http://scm.trinitydesktop.org/scm/git/tqt3
Diffstat (limited to 'src/styles')
-rw-r--r--src/styles/qcommonstyle.cpp35
-rw-r--r--src/styles/qmotifplusstyle.cpp31
2 files changed, 42 insertions, 24 deletions
diff --git a/src/styles/qcommonstyle.cpp b/src/styles/qcommonstyle.cpp
index 8557734cf..0caac2c64 100644
--- a/src/styles/qcommonstyle.cpp
+++ b/src/styles/qcommonstyle.cpp
@@ -49,6 +49,7 @@
#include "ntqpixmap.h"
#include "ntqpushbutton.h"
#include "ntqtabbar.h"
+#include "ntqtabwidget.h"
#include "ntqlineedit.h"
#include "ntqscrollbar.h"
#include "ntqtoolbutton.h"
@@ -226,6 +227,7 @@ TQStyle::ControlElementFlags getControlElementFlagsForObject(const TQObject* obj
if (widget->parentWidget()) cef = cef | TQStyle::CEF_HasParentWidget;
if (widget->focusProxy()) cef = cef | TQStyle::CEF_HasFocusProxy;
if (widget->hasFocus()) cef = cef | TQStyle::CEF_HasFocus;
+ if (widget->hasMouse()) cef = cef | TQStyle::CEF_HasMouse;
if (populateReliantFields) {
if (widget->isActiveWindow()) cef = cef | TQStyle::CEF_IsActiveWindow;
if (widget->isTopLevel()) cef = cef | TQStyle::CEF_IsTopLevel;
@@ -332,6 +334,7 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
const TQTabBar *tb = dynamic_cast<const TQTabBar*>(widget);
if (tb) {
ceData.tabBarData.tabCount = tb->count();
+ ceData.tabBarData.currentTabIndex = tb->currentTab();
ceData.tabBarData.shape = tb->shape();
ceData.tabBarData.identIndexMap.clear();
const TQTab* currentTab;
@@ -341,6 +344,38 @@ TQStyleControlElementData populateControlElementDataFromWidget(const TQWidget* w
ceData.tabBarData.identIndexMap[currentTab->identifier()] = tb->indexOf(currentTab->identifier());
}
}
+ const TQTabWidget *tw = dynamic_cast<const TQTabWidget*>(tb->parent());
+ if (tw) {
+ TQWidget *cw;
+ cw = tw->cornerWidget(TQt::TopLeft);
+ if(cw) {
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopLeft].widgetObjectTypes = getObjectTypeListForObject(cw);
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopLeft].geometry = cw->geometry();
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopLeft].rect = cw->rect();
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopLeft].pos = cw->pos();
+ }
+ cw = tw->cornerWidget(TQt::TopRight);
+ if(cw) {
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopRight].widgetObjectTypes = getObjectTypeListForObject(cw);
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopRight].geometry = cw->geometry();
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopRight].rect = cw->rect();
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_TopRight].pos = cw->pos();
+ }
+ cw = tw->cornerWidget(TQt::BottomLeft);
+ if(cw) {
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomLeft].widgetObjectTypes = getObjectTypeListForObject(cw);
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomLeft].geometry = cw->geometry();
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomLeft].rect = cw->rect();
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomLeft].pos = cw->pos();
+ }
+ cw = tw->cornerWidget(TQt::BottomRight);
+ if(cw) {
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomRight].widgetObjectTypes = getObjectTypeListForObject(cw);
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomRight].geometry = cw->geometry();
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomRight].rect = cw->rect();
+ ceData.tabBarData.cornerWidgets[TQStyleControlElementTabBarData::CWL_BottomRight].pos = cw->pos();
+ }
+ }
}
}
if (ceData.widgetObjectTypes.contains("TQToolBox")) {
diff --git a/src/styles/qmotifplusstyle.cpp b/src/styles/qmotifplusstyle.cpp
index 2ad7e7f5a..65fa0df91 100644
--- a/src/styles/qmotifplusstyle.cpp
+++ b/src/styles/qmotifplusstyle.cpp
@@ -65,13 +65,10 @@
struct TQMotifPlusStylePrivate
{
TQMotifPlusStylePrivate()
- : hoverWidget(0), hovering(FALSE), sliderActive(FALSE), mousePressed(FALSE),
+ : hovering(FALSE), sliderActive(FALSE), mousePressed(FALSE),
scrollbarElement(0), lastElement(0), ref(1)
{ ; }
- void* hoverWidget;
- TQStyleControlElementData hoverWidgetData;
- TQStyle::ControlElementFlags hoverWidgetFlags;
bool hovering, sliderActive, mousePressed;
int scrollbarElement, lastElement, ref;
TQPoint mousePos;
@@ -660,9 +657,6 @@ void TQMotifPlusStyle::drawControl( ControlElement element,
const TQStyleOption& opt,
const TQWidget *widget) const
{
- if (widget == singleton->hoverWidget)
- flags |= Style_MouseOver;
-
switch (element) {
case CE_PushButton:
{
@@ -1108,9 +1102,6 @@ void TQMotifPlusStyle::drawComplexControl(ComplexControl control,
const TQStyleOption& opt,
const TQWidget *widget ) const
{
- if (widget == singleton->hoverWidget)
- flags |= Style_MouseOver;
-
switch (control) {
case CC_ScrollBar:
{
@@ -1516,30 +1507,22 @@ bool TQMotifPlusStyle::objectEventHandler( TQStyleControlElementData ceData, Con
if (!ceData.widgetObjectTypes.contains("TQWidget"))
break;
- singleton->hoverWidget = source;
- singleton->hoverWidgetData = ceData;
- singleton->hoverWidgetFlags = elementFlags;
- if (!(singleton->hoverWidgetFlags & CEF_IsEnabled)) {
- singleton->hoverWidget = 0;
- break;
- }
- widgetActionRequest(singleton->hoverWidgetData, singleton->hoverWidgetFlags, singleton->hoverWidget, WAR_Repaint);
+ widgetActionRequest(ceData, elementFlags, source, WAR_Repaint);
break;
}
case TQEvent::Leave:
{
- if (source != singleton->hoverWidget)
+ if (!ceData.widgetObjectTypes.contains("TQWidget"))
break;
- void *w = singleton->hoverWidget;
- singleton->hoverWidget = 0;
- widgetActionRequest(singleton->hoverWidgetData, singleton->hoverWidgetFlags, w, WAR_Repaint);
+
+ widgetActionRequest(ceData, elementFlags, source, WAR_Repaint);
break;
}
case TQEvent::MouseMove:
{
- if ((!ceData.widgetObjectTypes.contains("TQWidget")) || source != singleton->hoverWidget)
+ if ((!ceData.widgetObjectTypes.contains("TQWidget")))
break;
if ((!ceData.widgetObjectTypes.contains("TQScrollBar")) && (!ceData.widgetObjectTypes.contains("TQSlider")))
@@ -1548,7 +1531,7 @@ bool TQMotifPlusStyle::objectEventHandler( TQStyleControlElementData ceData, Con
singleton->mousePos = ((TQMouseEvent *) event)->pos();
if (! singleton->mousePressed) {
singleton->hovering = TRUE;
- widgetActionRequest(singleton->hoverWidgetData, singleton->hoverWidgetFlags, singleton->hoverWidget, WAR_Repaint);
+ widgetActionRequest(ceData, elementFlags, source, WAR_Repaint);
singleton->hovering = FALSE;
}