summaryrefslogtreecommitdiffstats
path: root/tdestyles/klegacy/klegacystyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tdestyles/klegacy/klegacystyle.cpp')
-rw-r--r--tdestyles/klegacy/klegacystyle.cpp80
1 files changed, 39 insertions, 41 deletions
diff --git a/tdestyles/klegacy/klegacystyle.cpp b/tdestyles/klegacy/klegacystyle.cpp
index 8daf82c06..1dcfadf56 100644
--- a/tdestyles/klegacy/klegacystyle.cpp
+++ b/tdestyles/klegacy/klegacystyle.cpp
@@ -81,7 +81,6 @@
#include <tqregexp.h>
#include <tqscrollbar.h>
#include <tqscrollview.h>
-#include <tqsemimodal.h>
#include <tqsizegrip.h>
#include <tqslider.h>
#include <tqspinbox.h>
@@ -387,7 +386,7 @@ static TQPixmap *drawImage(TQImage *image, int width, int height,
// draw the image
bool mask = image->hasAlphaBuffer();
TQBitmap bm(width, height);
- bm.fill(Qt::color1);
+ bm.fill(TQt::color1);
TQImage nimage[3][3];
int xx = -1, yy = -1;
@@ -404,12 +403,12 @@ static TQPixmap *drawImage(TQImage *image, int width, int height,
if (nimage[yy][xx].isNull()) continue;
bitBlt(pixmap, x2[xx], y2[yy], &nimage[yy][xx],
- 0, 0, w2[xx], h2[yy], Qt::CopyROP);
+ 0, 0, w2[xx], h2[yy], TQt::CopyROP);
if (mask) {
TQImage am = nimage[yy][xx].createAlphaMask();
bitBlt(&bm, x2[xx], y2[yy], &am,
- 0, 0, w2[xx], h2[yy], Qt::CopyROP);
+ 0, 0, w2[xx], h2[yy], TQt::CopyROP);
}
}
}
@@ -419,14 +418,14 @@ static TQPixmap *drawImage(TQImage *image, int width, int height,
} else {
for (int y = 0; y < height; y += image->height())
for (int x = 0; x < width; x += image->width())
- bitBlt(pixmap, x, y, image, 0, 0, -1, -1, Qt::CopyROP);
+ bitBlt(pixmap, x, y, image, 0, 0, -1, -1, TQt::CopyROP);
if (image->hasAlphaBuffer()) {
TQImage mask = image->createAlphaMask();
if (! mask.isNull() && mask.depth() == 1) {
TQBitmap bm(width, height);
- bm.fill(Qt::color1);
+ bm.fill(TQt::color1);
bm = mask;
pixmap->setMask(bm);
}
@@ -707,7 +706,6 @@ static GtkObject *initialize(TQPtrDict<GtkObject> &dict) {
dict.insert(TQRadioButton::staticMetaObject(), myGtkRadioButton);
dict.insert(TQScrollBar::staticMetaObject(), myGtkScrollbar);
dict.insert(TQScrollView::staticMetaObject(), myGtkViewport);
- dict.insert(TQSemiModal::staticMetaObject(), myGtkDialog);
dict.insert(TQSizeGrip::staticMetaObject(), myGtkWidget);
dict.insert(TQSlider::staticMetaObject(), myGtkScale);
dict.insert(TQSpinBox::staticMetaObject(), myGtkSpinButton);
@@ -1210,13 +1208,13 @@ bool KLegacyStylePrivate::parseImage(KLegacyStyleData *styledata) {
if (equals.isNull() || parameter.isNull() || equals != "=") continue;
if (parameter == "UP")
- imagedata->key.data.arrowDirection = Qt::UpArrow + 1;
+ imagedata->key.data.arrowDirection = TQt::UpArrow + 1;
else if (parameter == "DOWN")
- imagedata->key.data.arrowDirection = Qt::DownArrow + 1;
+ imagedata->key.data.arrowDirection = TQt::DownArrow + 1;
else if (parameter == "LEFT")
- imagedata->key.data.arrowDirection = Qt::LeftArrow + 1;
+ imagedata->key.data.arrowDirection = TQt::LeftArrow + 1;
else if (parameter == "RIGHT")
- imagedata->key.data.arrowDirection = Qt::RightArrow + 1;
+ imagedata->key.data.arrowDirection = TQt::RightArrow + 1;
} else if (next == "border") {
filestream >> equals;
filestream >> parameter;
@@ -1323,9 +1321,9 @@ bool KLegacyStylePrivate::parseImage(KLegacyStyleData *styledata) {
if (equals.isNull() || parameter.isNull() || equals != "=") continue;
if (parameter == "VERTICAL")
- imagedata->key.data.orientation = Qt::Vertical + 1;
+ imagedata->key.data.orientation = TQt::Vertical + 1;
else if (parameter == "HORIZONTAL")
- imagedata->key.data.orientation = Qt::Horizontal + 1;
+ imagedata->key.data.orientation = TQt::Horizontal + 1;
} else if (next == "overlay_border") {
filestream >> equals;
filestream >> parameter;
@@ -1821,9 +1819,9 @@ void KLegacyStyle::polish(TQApplication *app) {
brush.setColor(gobj->backColor(KLegacy::Active));
pal.setBrush(TQPalette::Active, TQColorGroup::Button, brush);
- brush = pal.brush(TQPalette::Normal, TQColorGroup::Button);
+ brush = pal.brush(TQPalette::Active, TQColorGroup::Button);
brush.setColor(gobj->backColor(KLegacy::Normal));
- pal.setBrush(TQPalette::Normal, TQColorGroup::Button, brush);
+ pal.setBrush(TQPalette::Active, TQColorGroup::Button, brush);
brush = pal.brush(TQPalette::Disabled, TQColorGroup::Button);
brush.setColor(gobj->backColor(KLegacy::Insensitive));
@@ -1898,23 +1896,23 @@ void KLegacyStyle::polish(TQWidget *widget) {
bool immediateRender = false;
bool bgPixmap = false;
- if (widget->inherits(TQBUTTON_OBJECT_NAME_STRING)) {
+ if (widget->inherits("TQButton")) {
metaobject = TQButton::staticMetaObject();
eventFilter = true;
}
- if (widget->inherits(TQCOMBOBOX_OBJECT_NAME_STRING)) {
+ if (widget->inherits("TQComboBox")) {
metaobject = TQComboBox::staticMetaObject();
eventFilter = true;
}
- if (widget->inherits(TQSCROLLBAR_OBJECT_NAME_STRING)) {
+ if (widget->inherits("TQScrollBar")) {
metaobject = TQScrollBar::staticMetaObject();
eventFilter = true;
mouseTrack = true;
}
- if (widget->inherits(TQMENUBAR_OBJECT_NAME_STRING)) {
+ if (widget->inherits("TQMenuBar")) {
eventFilter = true;
immediateRender = true;
@@ -1930,7 +1928,7 @@ void KLegacyStyle::polish(TQWidget *widget) {
widget->setBackgroundMode(TQWidget::PaletteBackground);
}
- if (widget->inherits(TQTOOLBAR_OBJECT_NAME_STRING)) {
+ if (widget->inherits("TQToolBar")) {
metaobject = TQToolBar::staticMetaObject();
eventFilter = true;
@@ -1944,7 +1942,7 @@ void KLegacyStyle::polish(TQWidget *widget) {
widget->setBackgroundMode(TQWidget::PaletteBackground);
}
- if (widget->inherits(TQLINEEDIT_OBJECT_NAME_STRING)) {
+ if (widget->inherits("TQLineEdit")) {
metaobject = TQLineEdit::staticMetaObject();
eventFilter = true;
@@ -1968,7 +1966,7 @@ void KLegacyStyle::polish(TQWidget *widget) {
detail = "base";
}
- if (widget->inherits(TQPOPUPMENU_OBJECT_NAME_STRING)) {
+ if (widget->inherits("TQPopupMenu")) {
tqDebug("polishing popup '%s'", widget->className());
metaobject = TQPopupMenu::staticMetaObject();
widget->setBackgroundMode(TQWidget::PaletteBackground);
@@ -2216,7 +2214,7 @@ void KLegacyStyle::drawPushButton(TQPushButton *btn, TQPainter *p) {
key.data.shadow = KLegacy::In;
} else {
key.data.state = ((btn->isEnabled()) ?
- ((static_cast<TQWidget *>( btn ) == priv->lastWidget) ? KLegacy::Prelight : KLegacy::Normal) :
+ ((btn == priv->lastWidget) ? KLegacy::Prelight : KLegacy::Normal) :
KLegacy::Insensitive);
key.data.shadow = ((btn->isOn() || btn->isDown()) ?
KLegacy::In : KLegacy::Out);
@@ -2544,7 +2542,7 @@ void KLegacyStyle::drawComboButton(TQPainter *p, int x, int y, int w, int h,
key.data.state = KLegacy::Normal;
key.data.shadow = KLegacy::Out;
- if (priv->lastWidget && priv->lastWidget->inherits(TQCOMBOBOX_OBJECT_NAME_STRING))
+ if (priv->lastWidget && priv->lastWidget->inherits("TQComboBox"))
key.data.state = KLegacy::Prelight;
TQPixmap *pix = gobj->draw(key, w, h, "optionmenu");
@@ -3081,7 +3079,7 @@ bool KLegacyStyle::eventFilter(TQObject *obj, TQEvent *e) {
{
TQWidget *w = (TQWidget *) obj;
- if (w->inherits(TQPOPUPMENU_OBJECT_NAME_STRING) && w->width() < 700) {
+ if (w->inherits("TQPopupMenu") && w->width() < 700) {
GtkObject *gobj = priv->gtkDict.find(TQPopupMenu::staticMetaObject());
if (gobj) {
@@ -3151,7 +3149,7 @@ bool KLegacyStyle::eventFilter(TQObject *obj, TQEvent *e) {
if (p && (! p->isNull()))
w->setBackgroundPixmap(*p);
}
- } else if (w->inherits(TQLINEEDIT_OBJECT_NAME_STRING)) {
+ } else if (w->inherits("TQLineEdit")) {
GtkObject *gobj = priv->gtkDict.find(TQLineEdit::staticMetaObject());
if (gobj) {
@@ -3191,8 +3189,8 @@ bool KLegacyStyle::eventFilter(TQObject *obj, TQEvent *e) {
w->setPalette(pal);
}
}
- } else if (w->inherits(TQMENUBAR_OBJECT_NAME_STRING) ||
- w->inherits(TQTOOLBAR_OBJECT_NAME_STRING)) {
+ } else if (w->inherits("TQMenuBar") ||
+ w->inherits("TQToolBar")) {
GtkObject *gobj = priv->gtkDict.find(TQMenuBar::staticMetaObject());
if (gobj) {
@@ -3256,13 +3254,13 @@ bool KLegacyStyle::eventFilter(TQObject *obj, TQEvent *e) {
case TQEvent::Enter:
{
- if (obj->inherits(TQPUSHBUTTON_OBJECT_NAME_STRING) ||
- obj->inherits(TQCOMBOBOX_OBJECT_NAME_STRING) ||
- obj->inherits(TQSLIDER_OBJECT_NAME_STRING) ||
- obj->inherits(TQSCROLLBAR_OBJECT_NAME_STRING)) {
+ if (obj->inherits("TQPushButton") ||
+ obj->inherits("TQComboBox") ||
+ obj->inherits("TQSlider") ||
+ obj->inherits("TQScrollBar")) {
priv->lastWidget = (TQWidget *) obj;
priv->lastWidget->repaint(false);
- } else if (obj->inherits(TQRADIOBUTTON_OBJECT_NAME_STRING)) {
+ } else if (obj->inherits("TQRadioButton")) {
TQWidget *w = (TQWidget *) obj;
if (! w->isTopLevel() && w->isEnabled()) {
@@ -3277,11 +3275,11 @@ bool KLegacyStyle::eventFilter(TQObject *obj, TQEvent *e) {
if (pix && (! pix->isNull())) {
TQPalette pal = w->palette();
- TQBrush brush = pal.brush(TQPalette::Normal,
+ TQBrush brush = pal.brush(TQPalette::Active,
TQColorGroup::Background);
brush.setPixmap(*pix);
- pal.setBrush(TQPalette::Normal,
+ pal.setBrush(TQPalette::Active,
TQColorGroup::Background, brush);
w->setPalette(pal);
@@ -3290,7 +3288,7 @@ bool KLegacyStyle::eventFilter(TQObject *obj, TQEvent *e) {
}
}
}
- } else if (obj->inherits(TQCHECKBOX_OBJECT_NAME_STRING)) {
+ } else if (obj->inherits("TQCheckBox")) {
TQWidget *w = (TQWidget *) obj;
if (! w->isTopLevel() && w->isEnabled()) {
@@ -3305,11 +3303,11 @@ bool KLegacyStyle::eventFilter(TQObject *obj, TQEvent *e) {
if (pix && (! pix->isNull())) {
TQPalette pal = w->palette();
- TQBrush brush = pal.brush(TQPalette::Normal,
+ TQBrush brush = pal.brush(TQPalette::Active,
TQColorGroup::Background);
brush.setPixmap(*pix);
- pal.setBrush(TQPalette::Normal,
+ pal.setBrush(TQPalette::Active,
TQColorGroup::Background, brush);
w->setPalette(pal);
@@ -3328,8 +3326,8 @@ bool KLegacyStyle::eventFilter(TQObject *obj, TQEvent *e) {
if (obj == priv->lastWidget) {
priv->lastWidget = 0;
((TQWidget *) obj)->repaint(false);
- } else if (obj->inherits(TQRADIOBUTTON_OBJECT_NAME_STRING) ||
- obj->inherits(TQCHECKBOX_OBJECT_NAME_STRING)) {
+ } else if (obj->inherits("TQRadioButton") ||
+ obj->inherits("TQCheckBox")) {
TQWidget *w = (TQWidget *) obj;
if (! w->isTopLevel()) {
@@ -3346,7 +3344,7 @@ bool KLegacyStyle::eventFilter(TQObject *obj, TQEvent *e) {
{
TQMouseEvent *me = (TQMouseEvent *) e;
priv->mousePos = me->pos();
- if (obj->inherits(TQSCROLLBAR_OBJECT_NAME_STRING) &&
+ if (obj->inherits("TQScrollBar") &&
(! (me->state() & (LeftButton | MidButton | RightButton)))) {
priv->hovering = true;
((TQWidget *) obj)->repaint(false);