summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--style/qtcurve.cpp490
1 files changed, 232 insertions, 258 deletions
diff --git a/style/qtcurve.cpp b/style/qtcurve.cpp
index 7fb0a53..5f95f66 100644
--- a/style/qtcurve.cpp
+++ b/style/qtcurve.cpp
@@ -235,15 +235,9 @@ static void adjust(TQRect &r, int dx1, int dy1, int dx2, int dy2)
inline bool isSpecialHover(TQWidget *w)
{
return w && (
-#if 0x039999 >= 0x030200
::tqqt_cast<TQRadioButton *>(w) ||
::tqqt_cast<TQCheckBox *>(w) ||
-#endif
::tqqt_cast<TQScrollBar *>(w) ||
-#if defined TDE_VERSION && TDE_VERSION >= 0x30400 && TDE_VERSION < 0x30500
- ::tqqt_cast<TQToolButton *>(w) ||
-
-#endif
::tqqt_cast<TQHeader *>(w) ||
::tqqt_cast<TQSpinWidget *>(w) ||
::tqqt_cast<TQComboBox *>(w) ||
@@ -481,7 +475,7 @@ static bool inStackWidget(const TQWidget *w)
return true;
w=w->parentWidget();
}
-
+
return false;
}
@@ -514,7 +508,7 @@ static bool readKdeGlobals()
if(abs(now-lastCheck)<3)
return false;
-
+
TQColor highlight(TQApplication::palette().active().highlight());
bool inactiveEnabled(false),
changeSelectionColor(false),
@@ -923,7 +917,7 @@ QtCurveStyle::QtCurveStyle()
itsButtonCols[ORIGINAL_SHADE]), itsDefBtnCols);
}
}
-
+
switch(opts.comboBtn)
{
default:
@@ -1164,10 +1158,10 @@ void QtCurveStyle::applicationPolish(const TQStyleControlElementData &ceData, Co
TQApplication *app = reinterpret_cast<TQApplication*>(ptr);
TQString appName(getFile(app->argv()[0]));
-
+
if(NULL!=getenv("QTCURVE_DEBUG"))
std::cout << "QtCurve: Application name: \"" << appName.latin1() << "\"\n";
-
+
if ("kicker"==appName || "appletproxy"==appName)
{
itsThemedApp=APP_KICKER;
@@ -1218,7 +1212,7 @@ void QtCurveStyle::applicationPolish(const TQStyleControlElementData &ceData, Co
}
else
itsThemedApp=APP_OTHER;
-
+
if(APP_OPENOFFICE==itsThemedApp)
{
//
@@ -1229,21 +1223,21 @@ void QtCurveStyle::applicationPolish(const TQStyleControlElementData &ceData, Co
if(opts.useHighlightForMenu)
{
TQMetaObject *meta=(TQMetaObject *)metaObject();
-
- #ifdef USE_QT4
- #warning Qt4 does not allow the metaobject classname to be set (skipping)
- #else // USE_QT4
+
+#ifdef USE_QT4
+#warning Qt4 does not allow the metaobject classname to be set (skipping)
+#else // USE_QT4
meta->classname="HighContrastStyle";
- #endif // USE_QT4
+#endif // USE_QT4
}
-
+
if(opts.scrollbarType==SCROLLBAR_NEXT)
opts.scrollbarType=SCROLLBAR_KDE;
else if(opts.scrollbarType==SCROLLBAR_NONE)
opts.scrollbarType=SCROLLBAR_WINDOWS;
setSbType();
}
-
+
if(SHADE_NONE!=opts.menuStripe && opts.noMenuStripeApps.contains(appName))
opts.menuStripe=SHADE_NONE;
#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
@@ -1325,7 +1319,7 @@ void QtCurveStyle::polish(TQPalette &pal)
SHADE_BLEND_SELECTED==opts.comboBtn &&
(newContrast || newButton || newMenu)),
newSortedLv(itsSortedLvColors && ( (SHADE_BLEND_SELECTED==opts.sortedLv && itsHighlightCols!=itsSortedLvColors && itsSliderCols!=itsSortedLvColors &&
- itsComboBtnCols!=itsSortedLvColors) ||
+ itsComboBtnCols!=itsSortedLvColors) ||
SHADE_DARKEN==opts.sortedLv) &&
(newContrast || (opts.lvButton ? newButton : newGray))),
newCheckRadioSelCols(itsCheckRadioSelCols && ( (SHADE_BLEND_SELECTED==opts.crColor && itsDefBtnCols!=itsCheckRadioSelCols &&
@@ -1422,7 +1416,7 @@ void QtCurveStyle::polish(TQPalette &pal)
// Force this to be re-generated!
if(SHADE_BLEND_SELECTED==opts.menuStripe)
opts.customMenuStripeColor=TQt::black;
-
+
if(APPEARANCE_STRIPED==opts.bgndAppearance)
pal.setBrush(TQColorGroup::Background, TQBrush(pal.active().background(), *createStripePixmap(pal.active().background(), true)));
}
@@ -1441,7 +1435,7 @@ TQColorGroup QtCurveStyle::setColorGroup(const TQColorGroup &old, const TQColorG
if(dis)
mid=disable(act.foreground(), old.background());
-
+
const TQColor *use(backgroundColors(old));
TQColorGroup newGrp(old.foreground(), old.button(), use[0], use[STD_BORDER],
mid, old.text(), old.brightText(),
@@ -1460,7 +1454,7 @@ TQColorGroup QtCurveStyle::setColorGroup(const TQColorGroup &old, const TQColorG
newGrp.setColor(TQColorGroup::ButtonText, disable(act.buttonText(), old.button()));
newGrp.setColor(TQColorGroup::Text, disable(act.text(), old.background()));
}
-
+
return newGrp;
}
@@ -1472,22 +1466,22 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
TQWidget *widget = reinterpret_cast<TQWidget*>(ptr);
bool enableFilter(opts.highlightFactor || opts.coloredMouseOver);
-
+
if(::isKhtmlFormWidget(widget))
{
itsKhtmlWidgets[widget]=true;
connect(widget, TQT_SIGNAL(destroyed(TQObject *)), this, TQT_SLOT(tdehtmlWidgetDestroyed(TQObject *)));
}
-
+
if(enableFilter && isSpecialHover(widget))
connect(widget, TQT_SIGNAL(destroyed(TQObject *)), this, TQT_SLOT(hoverWidgetDestroyed(TQObject *)));
-
+
if(isWindowDragWidget(TQT_TQOBJECT(widget)))
installObjectEventHandler(ceData, elementFlags, ptr, this);
-
+
if(APPEARANCE_STRIPED==opts.bgndAppearance && (::tqqt_cast<TQDialog *>(widget) || ::tqqt_cast<TQMainWindow *>(widget)))
setBgndProp(widget, APPEARANCE_STRIPED);
-
+
if(widget->parentWidget() && ::tqqt_cast<TQScrollView *>(widget) && ::tqqt_cast<TQComboBox *>(widget->parentWidget()))
{
TQPalette pal(ceData.palette);
@@ -1495,7 +1489,7 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
TQPalette orig(pal);
#endif
TQColorGroup act(pal.active());
-
+
#if 0
if(opts.gtkComboMenus)
act.setColor(TQColorGroup::Base, USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : itsBackgroundCols[ORIGINAL_SHADE]);
@@ -1504,42 +1498,44 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
: TQApplication::palette().active().base());
#endif
act.setColor(TQColorGroup::Foreground, itsBackgroundCols[STD_BORDER]);
-
+
pal.setActive(act);
widget->setPalette(pal);
#if 0
//((TQScrollView *)widget)->setMargin(1);
-
+
const TQObjectList *children(widget->children());
-
+
if(children)
{
TQObjectList::Iterator it(children->begin()),
end(children->end());
-
+
for(; it!=end; ++it)
if(::tqqt_cast<TQWidget *>(*it))
((TQWidget *)(*it))->setPalette(orig);
}
#endif
}
-
+
if (APP_MACTOR==itsThemedApp && itsMactorPal && !ceData.widgetObjectTypes.contains("TQTipLabel"))
widget->setPalette(*itsMactorPal);
-
+
// Get rid of Kontact's frame...
if(APP_KONTACT==itsThemedApp && ::tqqt_cast<TQHBox *>(widget) && widget->parentWidget() &&
0==qstrcmp(widget->parentWidget()->className(), "Kontact::MainWindow"))
((TQHBox *)widget)->setLineWidth(0);
-
+
if(!IS_FLAT_BGND(opts.menuBgndAppearance) && ::tqqt_cast<const TQPopupMenu *>(widget))
+ {
installObjectEventHandler(ceData, elementFlags, ptr, this);
-
+ }
+
#if 0
if(opts.menubarHiding && ::tqqt_cast<TQMainWindow *>(widget) && static_cast<TQMainWindow *>(widget)->menuBar())
installObjectEventHandler(ceData, elementFlags, ptr, this);
#endif
-
+
if ((opts.square&SQUARE_SCROLLVIEW) && widget &&
(::tqqt_cast<const TQScrollView *>(widget) ||
(widget->parentWidget() && ::tqqt_cast<const TQFrame *>(widget) &&
@@ -1554,21 +1550,19 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
else if ((USE_LIGHTER_POPUP_MENU || !IS_FLAT_BGND(opts.menuBgndAppearance)) && !opts.borderMenuitems &&
widget && ::tqqt_cast<const TQPopupMenu *>(widget))
((TQFrame *)widget)->setLineWidth(1);
-
+
if (::tqqt_cast<TQRadioButton *>(widget) || ::tqqt_cast<TQCheckBox *>(widget))
{
bool framelessGroupBoxCheckBox=(NO_FRAME(opts.groupBox) && isCheckBoxOfGroupBox(TQT_TQOBJECT(widget)));
-
+
if(framelessGroupBoxCheckBox || enableFilter)
{
- #if 0x039999 >= 0x030200
if(!isFormWidget(widget))
widget->setMouseTracking(true);
- #endif
if(framelessGroupBoxCheckBox)
{
TQFont fnt(ceData.font);
-
+
fnt.setBold(true);
widget->setFont(fnt);
}
@@ -1591,9 +1585,6 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
if(enableFilter)
{
installObjectEventHandler(ceData, elementFlags, ptr, this);
- #if defined TDE_VERSION && TDE_VERSION >= 0x30400 && TDE_VERSION < 0x30500
- widget->setMouseTracking(true);
- #endif
}
}
else if (::tqqt_cast<TQButton *>(widget) || ceData.widgetObjectTypes.contains("TQToolBarExtensionWidget"))
@@ -1610,17 +1601,19 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
if(NoBackground!=widget->backgroundMode()) // && onToolBar(widget))
widget->setBackgroundMode(PaletteBackground);
installObjectEventHandler(ceData, elementFlags, ptr, this);
-
+
if(DO_EFFECT && onToolBar(widget))
widget->setName(kdeToolbarWidget);
-
+
if(enableFilter)
widget->setMouseTracking(true);
-
+
if(((TQComboBox *)widget)->listBox())
- ((TQComboBox *)widget)->listBox()->installEventFilter(this);
- // FIXME
- // installObjectEventHandler(ceData, elementFlags, ptr, this);
+ {
+ ((TQComboBox *)widget)->listBox()->installEventFilter(this);
+ // FIXME
+ // installObjectEventHandler(ceData, elementFlags, ptr, this);
+ }
}
else if(::tqqt_cast<TQMenuBar *>(widget))
{
@@ -1635,7 +1628,7 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
TQPalette pal(ceData.palette);
TQColorGroup act(pal.active());
TQColorGroup inact(pal.inactive());
-
+
getMdiColors(act, true);
act.setColor(TQColorGroup::Foreground, itsActiveMdiTextColor);
inact.setColor(TQColorGroup::Foreground, opts.shadeMenubarOnlyWhenActive ? itsMdiTextColor : itsActiveMdiTextColor);
@@ -1648,18 +1641,18 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
{
TQPalette pal(ceData.palette);
TQColorGroup act(pal.active());
-
+
act.setColor(TQColorGroup::Foreground, opts.customMenuTextColor
? opts.customMenuNormTextColor
: TQApplication::palette().active().highlightedText());
-
+
if(!opts.shadeMenubarOnlyWhenActive)
{
TQColorGroup inact(pal.inactive());
inact.setColor(TQColorGroup::Foreground, act.color(TQColorGroup::Foreground));
pal.setInactive(inact);
}
-
+
pal.setActive(act);
widget->setPalette(pal);
}
@@ -1696,11 +1689,11 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
{
widget->setName(kdeToolbarWidget);
widget->setBackgroundMode(NoBackground); // We paint whole background.
-
+
if(!enableFilter)
installObjectEventHandler(ceData, elementFlags, ptr, this);
}
-
+
// This bit stolen form polyester...
connect(widget, TQT_SIGNAL(sliderMoved(int)), this, TQT_SLOT(sliderThumbMoved(int)));
connect(widget, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(sliderThumbMoved(int)));
@@ -1731,7 +1724,7 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
widget->setBackgroundMode(NoBackground); // We paint whole background.
}
}
-
+
if (widget->parentWidget() && ::tqqt_cast<TQMenuBar *>(widget->parentWidget()) && !qstrcmp(widget->className(), TQFRAME_OBJECT_NAME_STRING))
{
installObjectEventHandler(ceData, elementFlags, ptr, this);
@@ -1756,7 +1749,7 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
pal.setInactive(ceData.palette.active());
widget->setPalette(pal);
}
-
+
if(opts.animatedProgress)
{
installObjectEventHandler(ceData, elementFlags, ptr, this);
@@ -1777,7 +1770,7 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
// NOTE: Check if we can set it earlier (before painting), cause
// on slow machines we can see the repainting of the bar (from white to background...)
TQPalette pal(TQApplication::palette());
-
+
pal.setColor(TQColorGroup::Midlight, pal.active().background());
TQApplication::setPalette(pal);
}
@@ -1792,7 +1785,7 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
else if(opts.fixParentlessDialogs && ::tqqt_cast<TQDialog *>(widget))
{
TQDialog *dlg=(TQDialog *)widget;
-
+
// The parent->isShown is needed for KWord. It's insert picure file dialog is a child of
// the insert picture dialog - but the file dialog is shown *before* the picture dialog!
if( (SKIP_TASKBAR && !dlg->parentWidget()) ||
@@ -1800,13 +1793,13 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
/*(dlg->isModal() || ::tqqt_cast<TQProgressDialog *>(widget))*/) )
installObjectEventHandler(ceData, elementFlags, ptr, this);
}
-
+
if(opts.fixParentlessDialogs && (APP_KPRINTER==itsThemedApp || APP_KDIALOG==itsThemedApp ||
APP_KDIALOGD==itsThemedApp))
{
TQString cap(widget->caption());
int index=-1;
-
+
// Remove horrible "Open - KDialog" titles...
if( cap.length() &&
( (APP_KPRINTER==itsThemedApp && (-1!=(index=cap.find(" - KPrinter"))) &&
@@ -1818,7 +1811,7 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
widget->TQWidget::setCaption(cap.left(index));
}
#endif
-
+
if(APP_SYSTEMSETTINGS==itsThemedApp)
{
if(widget && widget->parentWidget() && widget->parentWidget()->parentWidget() &&
@@ -1826,24 +1819,24 @@ void QtCurveStyle::polish(const TQStyleControlElementData &ceData, ControlElemen
::tqqt_cast<TQFrame *>(widget->parentWidget()) &&
::tqqt_cast<TQTabWidget *>(widget->parentWidget()->parentWidget()))
((TQFrame *)widget)->setFrameShape(TQFrame::NoFrame);
-
+
if(widget->parentWidget() && widget->parentWidget()->parentWidget() &&
::tqqt_cast<TQScrollView *>(widget->parentWidget()->parentWidget()) &&
ceData.widgetObjectTypes.contains("KCMultiWidget") && widget->parentWidget()->inherits("TQViewportWidget"))
((TQScrollView *)(widget->parentWidget()->parentWidget()))->setLineWidth(0);
}
-
+
if(opts.tabBgnd && widget && widget->parentWidget() && ::tqqt_cast<TQWidgetStack *>(widget) &&
::tqqt_cast<TQTabWidget *>(widget->parentWidget()) &&
0==qstrcmp(ceData.name.ascii(), "tab pages"))
{
TQPalette pal(ceData.palette);
-
+
pal.setColor(TQColorGroup::Background, shade(pal.active().background(), TO_FACTOR(opts.tabBgnd)));
widget->setBackgroundMode(PaletteBackground);
widget->setPalette(pal);
}
-
+
if(APPEARANCE_STRIPED==opts.bgndAppearance)
widget->setBackgroundOrigin(TQWidget::WindowOrigin);
}
@@ -1858,23 +1851,23 @@ void QtCurveStyle::unPolish(const TQStyleControlElementData &ceData, ControlElem
if(isFormWidget(widget))
itsKhtmlWidgets.remove(widget);
-
+
if(!IS_FLAT_BGND(opts.menuBgndAppearance) && ::tqqt_cast<const TQPopupMenu *>(widget))
+ {
removeObjectEventHandler(ceData, elementFlags, ptr, this);
-
+ }
+
#if 0
if(opts.menubarHiding && ::tqqt_cast<TQMainWindow *>(widget) && static_cast<TQMainWindow *>(widget)->menuBar())
removeObjectEventHandler(ceData, elementFlags, ptr, this);
#endif
-
+
if(isWindowDragWidget(TQT_TQOBJECT(widget)))
removeObjectEventHandler(ceData, elementFlags, ptr, this);
-
+
if (::tqqt_cast<TQRadioButton *>(widget) || ::tqqt_cast<TQCheckBox *>(widget))
{
- #if 0x039999 >= 0x030200
widget->setMouseTracking(false);
- #endif
removeObjectEventHandler(ceData, elementFlags, ptr, this);
}
else if (::tqqt_cast<TQHeader *>(widget) || ::tqqt_cast<TQTabBar *>(widget) || ::tqqt_cast<TQSpinWidget *>(widget) /*||
@@ -1894,9 +1887,6 @@ void QtCurveStyle::unPolish(const TQStyleControlElementData &ceData, ControlElem
if(NoBackground!=widget->backgroundMode()) // && onToolBar(widget))
widget->setBackgroundMode(PaletteButton);
removeObjectEventHandler(ceData, elementFlags, ptr, this);
- #if defined TDE_VERSION && TDE_VERSION >= 0x30400 && TDE_VERSION < 0x30500
- widget->setMouseTracking(false);
- #endif
}
else if (::tqqt_cast<TQComboBox *>(widget))
{
@@ -1905,9 +1895,11 @@ void QtCurveStyle::unPolish(const TQStyleControlElementData &ceData, ControlElem
removeObjectEventHandler(ceData, elementFlags, ptr, this);
widget->setMouseTracking(false);
if(((TQComboBox *)widget)->listBox())
- ((TQComboBox *)widget)->listBox()->removeEventFilter(this);
- // FIXME
- // removeObjectEventHandler(ceData, elementFlags, ptr, this);
+ {
+ ((TQComboBox *)widget)->listBox()->removeEventFilter(this);
+ // FIXME
+ // removeObjectEventHandler(ceData, elementFlags, ptr, this);
+ }
}
else if (::tqqt_cast<TQToolBar *>(widget) || ::tqqt_cast<TQPopupMenu *>(widget))
{
@@ -2015,78 +2007,80 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
if(itsHoverWidget && TQT_BASE_OBJECT(object)==TQT_BASE_OBJECT(itsHoverWidget) && (TQEvent::Destroy==event->type() || TQEvent::Hide==event->type()))
resetHover();
-
+
#if 0
// Works for qtconfig, but k3b hangs?
if(opts.menubarHiding && TQEvent::KeyRelease==event->type() && ::tqqt_cast<TQMainWindow *>(object))
{
TQMainWindow *window=static_cast<TQMainWindow *>(object);
-
+
if(window->isVisible() && window->menuBar())
{
TQKeyEvent *k=static_cast<TQKeyEvent *>(event);
-
+
if(k->state()&TQt::ControlButton && k->state()&TQt::AltButton && TQt::Key_M==k->key())
window->menuBar()->setHidden(window->menuBar()->isVisible());
}
}
#endif
-
+
if(object->parent() && 0==qstrcmp(object->name(), kdeToolbarWidget))
{
// Draw background for custom widgets in the toolbar that have specified a
// "tde toolbar widget" name.
if(TQEvent::Paint==event->type())
{
- TQWidget *widget(TQT_TQWIDGET(object)),
- *parent(TQT_TQWIDGET(object->parent()));
-
- if(IS_FLAT(opts.toolbarAppearance))
- TQPainter(widget).fillRect(ceData.rect, parent->colorGroup().background());
- else
- {
- int y_offset(ceData.rect.y());
-
- while(parent && parent->parent() && 0==qstrcmp(parent->name(), kdeToolbarWidget))
+ TQWidget *widget(TQT_TQWIDGET(object)),
+ *parent(TQT_TQWIDGET(object->parent()));
+
+ if(IS_FLAT(opts.toolbarAppearance))
+ TQPainter(widget).fillRect(ceData.rect, parent->colorGroup().background());
+ else
{
- y_offset += parent->y();
- parent = TQT_TQWIDGET(parent->parent());
- }
-
- TQRect r(ceData.rect),
- pr(parent->rect());
- bool horiz=pr.width() > pr.height();
- TQPainter p(widget);
- TQToolBar *tb(::tqqt_cast<TQToolBar*>(parent));
-
- // If parent is a TQToolbar use its orientation, else just base on width>height.
- if (tb)
- horiz = TQt::Horizontal==ceData.orientation;
-
- TQRect bgndRect(r.x(), r.y()-y_offset, r.width(), pr.height());
-
- if(!IS_FLAT(opts.toolbarAppearance)) {
- if(horiz) {
- bgndRect.addCoords(0, -1, 0, 1);
- }
- else {
- bgndRect.addCoords(-1, 0, 1, 0);
+ int y_offset(ceData.rect.y());
+
+ while(parent && parent->parent() && 0==qstrcmp(parent->name(), kdeToolbarWidget))
+ {
+ y_offset += parent->y();
+ parent = TQT_TQWIDGET(parent->parent());
+ }
+
+ TQRect r(ceData.rect),
+ pr(parent->rect());
+ bool horiz=pr.width() > pr.height();
+ TQPainter p(widget);
+ TQToolBar *tb(::tqqt_cast<TQToolBar*>(parent));
+
+ // If parent is a TQToolbar use its orientation, else just base on width>height.
+ if (tb)
+ horiz = TQt::Horizontal==ceData.orientation;
+
+ TQRect bgndRect(r.x(), r.y()-y_offset, r.width(), pr.height());
+
+ if(!IS_FLAT(opts.toolbarAppearance)) {
+ if(horiz) {
+ bgndRect.addCoords(0, -1, 0, 1);
+ }
+ else {
+ bgndRect.addCoords(-1, 0, 1, 0);
+ }
+ }
+
+ drawMenuOrToolBarBackground(&p, bgndRect, parent->colorGroup(), false, horiz);
}
+
+ if(!::tqqt_cast<TQLineEdit*>(object) && !::tqqt_cast<TQTextEdit*>(object) &&
+ !(DO_EFFECT && ::tqqt_cast<TQComboBox*>(object)))
+ {
+ return false; // Now draw the contents
}
-
- drawMenuOrToolBarBackground(&p, bgndRect, parent->colorGroup(), false, horiz);
- }
-
- if(!::tqqt_cast<TQLineEdit*>(object) && !::tqqt_cast<TQTextEdit*>(object) &&
- !(DO_EFFECT && ::tqqt_cast<TQComboBox*>(object)))
- return false; // Now draw the contents
}
}
else if (NO_FRAME(opts.groupBox) && TQEvent::Move==event->type() && isCheckBoxOfGroupBox(object))
{
TQCheckBox *cb=static_cast<TQCheckBox *>(TQT_TQWIDGET(object));
TQRect r(cb->geometry());
-
+
removeObjectEventHandler(ceData, elementFlags, source, this);
if(TQApplication::reverseLayout())
r.setWidth(r.width()+8);
@@ -2100,61 +2094,75 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
{
if(!IS_FLAT_BGND(opts.menuBgndAppearance) && ::tqqt_cast<TQPopupMenu *>(object))
{
- TQWidget *widget=(TQWidget*)object;
- TQPainter painter(widget);
- TQColor col(USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : ceData.palette.active().background());
-
- if(APPEARANCE_STRIPED==opts.menuBgndAppearance)
- painter.drawTiledPixmap(ceData.rect, *createStripePixmap(col, false));
- else
- drawBevelGradientReal(col, &painter, ceData.rect, GT_HORIZ==opts.menuBgndGrad, false,
- opts.menuBgndAppearance, WIDGET_OTHER);
- return false;
- }
- else if (object->inherits("TDEToolBarSeparator"))
- {
- TQFrame *frame(::tqqt_cast<TQFrame *>(object));
-
- if(frame && TQFrame::NoFrame!=frame->frameShape())
- {
- TQPainter painter(frame);
- if (TQFrame::VLine==frame->frameShape())
- drawPrimitive(PE_DockWindowSeparator, &painter, TQStyleControlElementData(), CEF_None, frame->rect(),
- frame->colorGroup(), Style_Horizontal);
- else if (TQFrame::HLine==frame->frameShape())
- drawPrimitive(PE_DockWindowSeparator, &painter, TQStyleControlElementData(), CEF_None, frame->rect(),
- frame->colorGroup());
+ TQWidget *widget=(TQWidget*)object;
+ TQPainter painter(widget);
+ TQColor col(USE_LIGHTER_POPUP_MENU ? itsLighterPopupMenuBgndCol : ceData.palette.active().background());
+
+ if(APPEARANCE_STRIPED==opts.menuBgndAppearance)
+ {
+ painter.drawTiledPixmap(ceData.rect, *createStripePixmap(col, false));
+ }
else
+ {
+ drawBevelGradientReal(col, &painter, ceData.rect, GT_HORIZ==opts.menuBgndGrad, false,
+ opts.menuBgndAppearance, WIDGET_OTHER);
+ }
return false;
- return true; // been drawn!
}
+ else if (object->inherits("TDEToolBarSeparator"))
+ {
+ TQFrame *frame(::tqqt_cast<TQFrame *>(object));
+
+ if(frame && TQFrame::NoFrame!=frame->frameShape())
+ {
+ TQPainter painter(frame);
+ if (TQFrame::VLine==frame->frameShape())
+ {
+ drawPrimitive(PE_DockWindowSeparator, &painter, TQStyleControlElementData(), CEF_None, frame->rect(),
+ frame->colorGroup(), Style_Horizontal);
+ }
+ else if (TQFrame::HLine==frame->frameShape())
+ {
+ drawPrimitive(PE_DockWindowSeparator, &painter, TQStyleControlElementData(), CEF_None, frame->rect(),
+ frame->colorGroup());
+ }
+ else
+ {
+ return false;
+ }
+ return true; // been drawn!
+ }
}
else if(object->inherits("KTabCtl") && ::tqqt_cast<TQWidget*>(object))
{
- TQWidget *widget((TQWidget*)object);
- TQObject *child(object->child("_tabbar"));
- TQTabBar *tb(child ? ::tqqt_cast<TQTabBar *>(child) : 0L);
- TQPainter painter(widget);
- TQRect r(ceData.rect);
- int tbHeight(tb ? tb->height()-1 : 28);
-
- if(tb && (TQTabBar::RoundedBelow == tb->shape() ||
- TQTabBar::TriangularBelow == tb->shape()))
- r.addCoords(0, 0, 0, -tbHeight);
- else
- r.addCoords(0, tbHeight, 0, 0);
- drawPrimitive(PE_PanelTabWidget, &painter, TQStyleControlElementData(), CEF_None, r, ceData.colorGroup,
- Style_Horizontal|Style_Enabled);
- return true;
+ TQWidget *widget((TQWidget*)object);
+ TQObject *child(object->child("_tabbar"));
+ TQTabBar *tb(child ? ::tqqt_cast<TQTabBar *>(child) : 0L);
+ TQPainter painter(widget);
+ TQRect r(ceData.rect);
+ int tbHeight(tb ? tb->height()-1 : 28);
+
+ if(tb && (TQTabBar::RoundedBelow == tb->shape() ||
+ TQTabBar::TriangularBelow == tb->shape()))
+ {
+ r.addCoords(0, 0, 0, -tbHeight);
+ }
+ else
+ {
+ r.addCoords(0, tbHeight, 0, 0);
+ drawPrimitive(PE_PanelTabWidget, &painter, TQStyleControlElementData(), CEF_None, r, ceData.colorGroup,
+ Style_Horizontal|Style_Enabled);
+ }
+ return true;
}
}
-
+
// Fix mdi buttons in menubars...
if(::tqqt_cast<TQWidget*>(object) && ((TQWidget *)object)->parentWidget() &&
::tqqt_cast<TQMenuBar*>(((TQWidget *)object)->parentWidget()))
{
bool drawMenubar=false;
-
+
switch(event->type())
{
case TQEvent::Paint:
@@ -2170,24 +2178,24 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
default:
break;
}
-
+
if(drawMenubar)
{
-
+
TQWidget *widget(TQT_TQWIDGET(object)),
*parent(TQT_TQWIDGET(object->parent()));
TQRect r(ceData.rect);
TQPainter p(widget);
int y_offset(ceData.rect.y()+parent->y());
-
+
r.setY(r.y()-y_offset);
r.setHeight(parent->rect().height());
-
+
drawMenuOrToolBarBackground(&p, r, parent->colorGroup());
return true;
}
}
-
+
// Taken from plastik...
// focus highlight
if (::tqqt_cast<TQLineEdit*>(object) || ::tqqt_cast<TQTextEdit*>(object)/* || ::tqqt_cast<TQDateTimeEditBase*>(object)*/)
@@ -2195,28 +2203,28 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
if(TQEvent::FocusIn==event->type() || TQEvent::FocusOut==event->type() || TQEvent::Enter==event->type() || TQEvent::Leave==event->type())
{
TQWidget *widget(TQT_TQWIDGET(object));
-
+
if (::tqqt_cast<TQSpinWidget*>(widget->parentWidget()))
{
widget->parentWidget()->repaint(false);
return false;
}
-
+
widget->repaint(false);
}
return false;
}
-
+
if(::tqqt_cast<TQMenuBar *>(object))
{
bool useWindowCols=SHADE_WINDOW_BORDER==opts.shadeMenubars;
-
+
if( (useWindowCols || opts.customMenuTextColor || SHADE_BLEND_SELECTED==opts.shadeMenubars || SHADE_SELECTED==opts.shadeMenubars ||
SHADE_CUSTOM==opts.shadeMenubars) && TQEvent::Paint==event->type())
{
const TQColor &col(((TQWidget *)object)->palette().active().color(TQColorGroup::Foreground));
-
- // If we're relouring the menubar text, check to see if menubar palette has changed, if so set back to
+
+ // If we're recolouring the menubar text, check to see if menubar palette has changed, if so set back to
// our values. This fixes opera - which seems to change the widgets palette after it is polished.
if((opts.customMenuTextColor && col!=opts.customMenuNormTextColor) ||
( (SHADE_BLEND_SELECTED==opts.shadeMenubars || SHADE_SELECTED==opts.shadeMenubars ||
@@ -2225,25 +2233,25 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
{
TQPalette pal(((TQWidget *)object)->palette());
TQColorGroup act(pal.active());
-
+
act.setColor(TQColorGroup::Foreground, useWindowCols
? itsActiveMdiTextColor
: opts.customMenuTextColor
? opts.customMenuNormTextColor
: TQApplication::palette().active().highlightedText());
-
+
if(!opts.shadeMenubarOnlyWhenActive || useWindowCols)
{
TQColorGroup inact(pal.inactive());
inact.setColor(TQColorGroup::Foreground, useWindowCols ? itsMdiTextColor : act.color(TQColorGroup::Foreground));
pal.setInactive(inact);
}
-
+
pal.setActive(act);
((TQWidget *)object)->setPalette(pal);
}
}
-
+
if(opts.shadeMenubarOnlyWhenActive && SHADE_NONE!=opts.shadeMenubars)
switch(event->type())
{
@@ -2309,15 +2317,15 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
case TQEvent::MouseButtonRelease:
if(itsDragWidget)
{
- itsDragWidget->setMouseTracking(itsDragWidgetHadMouseTracking);
- itsDragWidget = 0L;
- return false;
+ itsDragWidget->setMouseTracking(itsDragWidgetHadMouseTracking);
+ itsDragWidget = 0L;
+ return false;
}
default:
break;
}
- #ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
+#ifdef TQTC_ENABLE_PARENTLESS_DIALOG_FIX_SUPPORT
if(opts.fixParentlessDialogs && ::tqqt_cast<TQDialog *>(object))
{
TQDialog *dlg=(TQDialog *)object;
@@ -2390,8 +2398,8 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
}
return false;
}
- #endif
-
+#endif
+
// Track show events for progress bars
if (opts.animatedProgress && ::tqqt_cast<TQProgressBar*>(object))
{
@@ -2399,49 +2407,49 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
itsAnimationTimer->start(PROGRESS_ANIMATION, false);
return false;
}
-
+
switch(event->type())
{
case TQEvent::FocusIn:
case TQEvent::FocusOut:
- if(opts.highlightScrollViews && object->isWidgetType() && ::tqqt_cast<TQScrollView*>(object))
- ((TQWidget *)object)->repaint(false);
- break;
+ if(opts.highlightScrollViews && object->isWidgetType() && ::tqqt_cast<TQScrollView*>(object))
+ ((TQWidget *)object)->repaint(false);
+ break;
case TQEvent::Hide:
case TQEvent::Show:
- if(::tqqt_cast<TQListBox *>(object) &&
- (((TQListBox *)object)->parentWidget() &&
- ::tqqt_cast<TQComboBox *>(((TQListBox *)object)->parentWidget())))
- ((TQComboBox *)(((TQListBox *)object)->parentWidget()))->repaint(false);
- // else if(::tqqt_cast<TQFrame *>(object) &&
- // (TQFrame::Box==((TQFrame *)object)->frameShape() || TQFrame::Panel==((TQFrame *)object)->frameShape() ||
- // TQFrame::WinPanel==((TQFrame *)object)->frameShape()))
- // ((TQFrame *)object)->setFrameShape(TQFrame::StyledPanel);
- break;
+ if(::tqqt_cast<TQListBox *>(object) &&
+ (((TQListBox *)object)->parentWidget() &&
+ ::tqqt_cast<TQComboBox *>(((TQListBox *)object)->parentWidget())))
+ ((TQComboBox *)(((TQListBox *)object)->parentWidget()))->repaint(false);
+// else if(::tqqt_cast<TQFrame *>(object) &&
+// (TQFrame::Box==((TQFrame *)object)->frameShape() || TQFrame::Panel==((TQFrame *)object)->frameShape() ||
+// TQFrame::WinPanel==((TQFrame *)object)->frameShape()))
+// ((TQFrame *)object)->setFrameShape(TQFrame::StyledPanel);
+ break;
case TQEvent::Enter:
if(object->isWidgetType())
{
itsHoverWidget=(TQWidget *)object;
-
+
if(itsHoverWidget && itsHoverWidget->isEnabled())
{
- if(::tqqt_cast<TQTabBar*>(object) && TQT_TQWIDGET(object)->isEnabled())
- {
- itsHoverTab=0L;
- itsHoverWidget->repaint(false);
- }
- else if(!itsHoverWidget->hasMouseTracking() ||
- (itsFormMode=isFormWidget(itsHoverWidget)))
- {
- itsHoverWidget->repaint(false);
- itsFormMode=false;
- }
+ if(::tqqt_cast<TQTabBar*>(object) && TQT_TQWIDGET(object)->isEnabled())
+ {
+ itsHoverTab=0L;
+ itsHoverWidget->repaint(false);
+ }
+ else if(!itsHoverWidget->hasMouseTracking() ||
+ (itsFormMode=isFormWidget(itsHoverWidget)))
+ {
+ itsHoverWidget->repaint(false);
+ itsFormMode=false;
+ }
}
else
itsHoverWidget=0L;
-
+
if(itsHoverWidget && !itsIsSpecialHover && isSpecialHover(itsHoverWidget))
- itsIsSpecialHover=true;
+ itsIsSpecialHover=true;
}
break;
case TQEvent::Leave:
@@ -2453,15 +2461,15 @@ bool QtCurveStyle::objectEventHandler( const TQStyleControlElementData &ceData,
break;
case TQEvent::MouseMove: // Only occurs for widgets with mouse tracking enabled
{
- TQMouseEvent *me = TQT_TQMOUSEEVENT(event);
-
- if(me && itsHoverWidget && object->isWidgetType())
- {
- if(!me->pos().isNull() && itsIsSpecialHover && redrawHoverWidget(me->pos()))
- itsHoverWidget->repaint(false);
- itsOldPos=me->pos();
- }
- break;
+ TQMouseEvent *me = TQT_TQMOUSEEVENT(event);
+
+ if(me && itsHoverWidget && object->isWidgetType())
+ {
+ if(!me->pos().isNull() && itsIsSpecialHover && redrawHoverWidget(me->pos()))
+ itsHoverWidget->repaint(false);
+ itsOldPos=me->pos();
+ }
+ break;
}
default:
break;
@@ -3203,10 +3211,6 @@ void QtCurveStyle::drawPrimitive(TQ_PrimitiveElement pe, TQPainter *p, const TQS
flags=((flags|Style_Down)^Style_Down)| Style_Sunken;
flags|=Style_Enabled;
#if defined TQTC_TQT_ONLY || !defined TDE_VERSION
-#if defined TDE_VERSION && TDE_VERSION >= 0x30400 && TDE_VERSION < 0x30500
- if(HOVER_KICKER==itsHover && itsHoverWidget) // && itsHoverWidget==p->device())
- flags|=Style_MouseOver;
-#endif
itsFormMode=itsIsTransKicker;
#endif
drawLightBevel(p, r, cg, flags|Style_Horizontal, ROUNDED_ALL,
@@ -4877,7 +4881,6 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
}
break;
}
-#if 0x039999 >= 0x030200
case CE_TabBarLabel:
{
if (data.isDefault())
@@ -4939,7 +4942,6 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
}
break;
}
-#endif
case CE_PushButtonLabel: // Taken from Highcolor and Plastik...
{
int x, y, w, h, arrowOffset=DO_EFFECT ? 1 : 0;
@@ -5458,21 +5460,15 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
const TQCheckBox *checkbox((const TQCheckBox *)widget);
if(flags&Style_MouseOver && opts.crHighlight &&
-#if 0x039999 >= 0x030200
HOVER_CHECK==itsHover && itsHoverWidget && itsHoverWidget==widget &&
-#endif
!isFormWidget(widget))
{
-#if 0x039999 >= 0x030200
TQRect cr(checkbox->rect());
TQRegion r(TQRect(cr.x(), cr.y(), visualRect(subRect(SR_CheckBoxFocusRect, ceData, elementFlags, widget),
ceData, elementFlags).width()+
pixelMetric(PM_IndicatorWidth, ceData, elementFlags)+4,
cr.height()));
-#else
- TQRegion r(ceData.rect);
-#endif
r-=visualRect(subRect(SR_CheckBoxIndicator, ceData, elementFlags, widget), ceData, elementFlags);
p->setClipRegion(r);
drawBevelGradient(shade(cg.background(), TO_FACTOR(opts.crHighlight)), p, checkbox->rect(), true,
@@ -5502,21 +5498,15 @@ void QtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQSty
const TQRadioButton *radiobutton((const TQRadioButton *)widget);
if(flags&Style_MouseOver && opts.crHighlight &&
-#if 0x039999 >= 0x030200
HOVER_RADIO==itsHover && itsHoverWidget && itsHoverWidget==widget &&
-#endif
!isFormWidget(widget))
{
-#if 0x039999 >= 0x030200
TQRect rb(radiobutton->rect());
TQRegion r(TQRect(rb.x(), rb.y(),
visualRect(subRect(SR_RadioButtonFocusRect, ceData, elementFlags, widget),
ceData, elementFlags).width()+
pixelMetric(PM_ExclusiveIndicatorWidth, ceData, elementFlags)+4,
rb.height()));
-#else
- TQRegion r(ceData.rect);
-#endif
r-=visualRect(subRect(SR_RadioButtonIndicator, ceData, elementFlags, widget), ceData, elementFlags);
p->setClipRegion(r);
drawBevelGradient(shade(cg.background(), TO_FACTOR(opts.crHighlight)), p, ceData.rect, true,
@@ -6803,7 +6793,6 @@ int QtCurveStyle::pixelMetric(PixelMetric metric, const TQStyleControlElementDat
return 7;
case PM_ButtonMargin:
return 3;
-#if 0x039999 >= 0x030200
case PM_TabBarTabShiftVertical:
{
return (ceData.widgetObjectTypes.contains(TQTABBAR_OBJECT_NAME_STRING))
@@ -6814,7 +6803,6 @@ int QtCurveStyle::pixelMetric(PixelMetric metric, const TQStyleControlElementDat
}
case PM_TabBarTabShiftHorizontal:
return 0;
-#endif
case PM_ButtonShiftHorizontal:
case PM_ButtonShiftVertical:
return 1;
@@ -8215,7 +8203,6 @@ bool QtCurveStyle::redrawHoverWidget(const TQPoint &pos)
const TQStyleControlElementData &ceData = populateControlElementDataFromWidget(itsHoverWidget, TQStyleOption());
ControlElementFlags elementFlags = getControlElementFlagsForObject(itsHoverWidget, TQStyleOption());
-#if 0x039999 >= 0x030200
//
// TQt>=3.2 sets the sensitive part of a check/radio to the image + label -> anything else
// is not sensitive. But, the widget can ocupy a larger area - and this whole area will
@@ -8248,7 +8235,6 @@ bool QtCurveStyle::redrawHoverWidget(const TQPoint &pos)
}
else
{
-#endif
TQScrollBar *sb(::tqqt_cast<TQScrollBar *>(itsHoverWidget));
if(sb) // So, are we over add button, sub button, slider, or none?
@@ -8296,16 +8282,6 @@ bool QtCurveStyle::redrawHoverWidget(const TQPoint &pos)
}
else
{
-#if defined TDE_VERSION && TDE_VERSION >= 0x30400 && TDE_VERSION < 0x30500
- TQToolButton *tb(::tqqt_cast<TQToolButton *>(itsHoverWidget));
-
- if(tb)
- {
- itsHover=APP_KICKER==itsThemedApp ? HOVER_KICKER : HOVER_NONE;
- return HOVER_KICKER==itsHover;
- }
- else
-#endif
{
TQHeader *hd(::tqqt_cast<TQHeader *>(itsHoverWidget));
@@ -8425,10 +8401,8 @@ bool QtCurveStyle::redrawHoverWidget(const TQPoint &pos)
}
}
}
-#if 0x039999 >= 0x030200
}
}
-#endif
return false;
}