summaryrefslogtreecommitdiffstats
path: root/styles
diff options
context:
space:
mode:
Diffstat (limited to 'styles')
-rw-r--r--styles/dotnet/dotnet.cpp572
-rw-r--r--styles/dotnet/dotnet.h110
-rw-r--r--styles/phase/bitmaps.h22
-rw-r--r--styles/phase/config/phasestyleconfig.cpp24
-rw-r--r--styles/phase/config/phasestyleconfig.h2
-rw-r--r--styles/phase/phasestyle.cpp566
-rw-r--r--styles/phase/phasestyle.h128
7 files changed, 712 insertions, 712 deletions
diff --git a/styles/dotnet/dotnet.cpp b/styles/dotnet/dotnet.cpp
index 6eeb7c41..ec4987f8 100644
--- a/styles/dotnet/dotnet.cpp
+++ b/styles/dotnet/dotnet.cpp
@@ -24,34 +24,34 @@
* the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
* Boston, MA 02110-1301, USA.
*/
-#include <qstyleplugin.h>
-#include <qstylefactory.h>
-#include <qpointarray.h>
-#include <qpainter.h>
-#include <qtabbar.h>
-#include <qtabwidget.h>
-#include <qprogressbar.h>
-#include <qcombobox.h>
-#include <qlistbox.h>
-#include <qscrollbar.h>
-#include <qpushbutton.h>
-#include <qtoolbutton.h>
-#include <qtoolbar.h>
-#include <qmenubar.h>
-#include <qpopupmenu.h>
-#include <qdrawutil.h>
-#include <qapplication.h>
-#include <qvariant.h>
-#include <qpixmapcache.h>
-#include <qslider.h>
-#include <qsettings.h>
+#include <tqstyleplugin.h>
+#include <tqstylefactory.h>
+#include <tqpointarray.h>
+#include <tqpainter.h>
+#include <tqtabbar.h>
+#include <tqtabwidget.h>
+#include <tqprogressbar.h>
+#include <tqcombobox.h>
+#include <tqlistbox.h>
+#include <tqscrollbar.h>
+#include <tqpushbutton.h>
+#include <tqtoolbutton.h>
+#include <tqtoolbar.h>
+#include <tqmenubar.h>
+#include <tqpopupmenu.h>
+#include <tqdrawutil.h>
+#include <tqapplication.h>
+#include <tqvariant.h>
+#include <tqpixmapcache.h>
+#include <tqslider.h>
+#include <tqsettings.h>
#include <kpixmap.h>
#include "dotnet.h"
#include "dotnet.moc"
-/* This code registers the style with QStyleFactory, which makes it possible
- * for any code that uses QStyle to find out about it. */
+/* This code registers the style with TQStyleFactory, which makes it possible
+ * for any code that uses TQStyle to find out about it. */
// -- Style Plugin Interface -------------------------
class dotNETstylePlugin : public QStylePlugin
{
@@ -59,11 +59,11 @@ class dotNETstylePlugin : public QStylePlugin
dotNETstylePlugin() {}
~dotNETstylePlugin() {}
- QStringList keys() const {
- return QStringList() << "dotNET";
+ TQStringList keys() const {
+ return TQStringList() << "dotNET";
}
- QStyle* create( const QString& key ) {
+ TQStyle* create( const TQString& key ) {
if (key == "dotnet")
return new dotNETstyle;
return 0;
@@ -77,22 +77,22 @@ KDE_Q_EXPORT_PLUGIN( dotNETstylePlugin )
dotNETstyle::dotNETstyle() : KStyle( AllowMenuTransparency ), kickerMode(false)
{
winstyle = 0L;
- winstyle = QStyleFactory::create("Windows");
+ winstyle = TQStyleFactory::create("Windows");
if (winstyle == 0L) {
// We don't have the Windows style, neither builtin nor as a plugin.
// Use any style rather than crashing.
- winstyle = QStyleFactory::create("B3");
+ winstyle = TQStyleFactory::create("B3");
}
if (qApp->inherits("KApplication")) {
- connect( qApp, SIGNAL( kdisplayPaletteChanged() ), SLOT( paletteChanged() ));
+ connect( qApp, TQT_SIGNAL( kdisplayPaletteChanged() ), TQT_SLOT( paletteChanged() ));
}
- QSettings settings;
+ TQSettings settings;
pseudo3D = settings.readBoolEntry("/KStyle/Settings/Pseudo3D", true);
roundedCorners = settings.readBoolEntry("/KStyle/Settings/RoundedCorners", true);
useTextShadows = settings.readBoolEntry("/KStyle/Settings/UseTextShadows", false);
- reverseLayout = QApplication::QApplication::reverseLayout();
+ reverseLayout = TQApplication::TQApplication::reverseLayout();
}
@@ -100,7 +100,7 @@ dotNETstyle::~dotNETstyle()
{
}
-bool dotNETstyle::inheritsKHTML(const QWidget* w) const
+bool dotNETstyle::inheritsKHTML(const TQWidget* w) const
{
if (w->parentWidget(true) && w->parentWidget(true)->parentWidget(true) && w->parentWidget(true)->parentWidget(true)->parentWidget(true) && w->parentWidget(true)->parentWidget(true)->parentWidget(true)->inherits("KHTMLView")) {
return true;
@@ -109,7 +109,7 @@ bool dotNETstyle::inheritsKHTML(const QWidget* w) const
}
}
-void dotNETstyle::polish(QWidget* widget)
+void dotNETstyle::polish(TQWidget* widget)
{
if (!qstrcmp(qApp->argv()[0], "kicker") || widget->inherits("Kicker"))
kickerMode = true;
@@ -121,9 +121,9 @@ void dotNETstyle::polish(QWidget* widget)
// to update the palette again.
bool extraPalette = false;
- if (widget->inherits("QComboBox") && !inheritsKHTML(widget)) {
+ if (widget->inherits("TQComboBox") && !inheritsKHTML(widget)) {
widget->installEventFilter (this);
- updatePalette( (QComboBox*) widget );
+ updatePalette( (TQComboBox*) widget );
extraPalette = true;
} else {
winstyle->polish(widget);
@@ -134,32 +134,32 @@ void dotNETstyle::polish(QWidget* widget)
// other bad things (see bug #54569)
/*
if (!widget->ownPalette()) {
- if (widget->inherits("QToolBar")) {
- updatePalette( (QToolBar*) widget );
+ if (widget->inherits("TQToolBar")) {
+ updatePalette( (TQToolBar*) widget );
extraPalette = true;
- } else if (widget->inherits("QMenuBar")) {
- updatePalette( (QMenuBar*) widget );
+ } else if (widget->inherits("TQMenuBar")) {
+ updatePalette( (TQMenuBar*) widget );
extraPalette = true;
}
}
*/
}
-void dotNETstyle::unPolish(QWidget* widget)
+void dotNETstyle::unPolish(TQWidget* widget)
{
winstyle->unPolish(widget);
- if (widget->inherits("QComboBox") && !inheritsKHTML(widget)) {
+ if (widget->inherits("TQComboBox") && !inheritsKHTML(widget)) {
widget->removeEventFilter (this);
}
}
void dotNETstyle::renderMenuBlendPixmap(KPixmap &pix,
- const QColorGroup &cg,
- const QPopupMenu *popup) const
+ const TQColorGroup &cg,
+ const TQPopupMenu *popup) const
{
- QPainter p( &pix );
- if (QApplication::reverseLayout()) {
+ TQPainter p( &pix );
+ if (TQApplication::reverseLayout()) {
p.fillRect( popup->frameRect().width()-22, 0, 22, pix.height(), cg.mid() );
p.fillRect( 0, 0, popup->frameRect().width()-22, pix.height(), cg.background().light() );
} else {
@@ -174,9 +174,9 @@ void dotNETstyle::renderMenuBlendPixmap(KPixmap &pix,
* Also, take a look at the sizeMetric function and play with the
* widths that things return for different Frame elements.
*/
-void dotNETstyle::renderButton(QPainter *p,
- const QRect &r,
- const QColorGroup &g,
+void dotNETstyle::renderButton(TQPainter *p,
+ const TQRect &r,
+ const TQColorGroup &g,
bool sunken,
bool corners) const
{
@@ -193,11 +193,11 @@ void dotNETstyle::renderButton(QPainter *p,
const QCOORD iCorners[] = { x, y + h - 2, x, y + 1, x + 1, y, x + w - 2, y, x + w - 1, y + 1, x + w - 1, y + h - 2, x + w - 2, y + h - 1, x + 1, y + h - 1 };
p->fillRect(x+1, y+1, w-2, h-2, g.button());
p->setPen(g.button().dark());
- p->drawLineSegments(QPointArray(8, iCorners));
+ p->drawLineSegments(TQPointArray(8, iCorners));
if (corners) {
const QCOORD cPixels[] = { x, y, x + w - 1, y, x + w - 1, y + h - 1, x, y + h - 1 };
p->setPen(g.button());
- p->drawPoints(QPointArray(4, cPixels));
+ p->drawPoints(TQPointArray(4, cPixels));
}
} else {
p->setPen(g.button().dark());
@@ -206,9 +206,9 @@ void dotNETstyle::renderButton(QPainter *p,
}
const QCOORD oCorners[] = { x + 1, y + h - 2, x + 1, y + 1, x + w - 2, y + 1, x + w - 2, y + h - 2 };
- const QPointArray outline(4, oCorners);
+ const TQPointArray outline(4, oCorners);
p->setPen(g.button().dark(115));
- p->setBrush(QBrush::NoBrush);
+ p->setBrush(TQBrush::NoBrush);
p->drawConvexPolygon(outline);
p->setPen(g.button().light());
p->drawPolyline(outline, 0, 3);
@@ -227,9 +227,9 @@ void dotNETstyle::renderButton(QPainter *p,
* them just like normal buttons, by calling renderButton, but it also adds
* very subtle grips to the slider handle.
*/
-void dotNETstyle::renderSlider(QPainter *p,
- const QRect &r,
- const QColorGroup &g) const
+void dotNETstyle::renderSlider(TQPainter *p,
+ const TQRect &r,
+ const TQColorGroup &g) const
{
int x, y, w, h;
int offset = 6;
@@ -293,9 +293,9 @@ void dotNETstyle::renderSlider(QPainter *p,
* Changing this function will have pretty widespread effects. Also a good
* place to start if you're looking to make your own style.
*/
-void dotNETstyle::renderPanel(QPainter *p,
- const QRect &r,
- const QColorGroup &g,
+void dotNETstyle::renderPanel(TQPainter *p,
+ const TQRect &r,
+ const TQColorGroup &g,
bool sunken,
bool thick) const
{
@@ -309,11 +309,11 @@ void dotNETstyle::renderPanel(QPainter *p,
const QCOORD oCorners[] = { x, y2, x, y, x2, y, x2, y2 };
const QCOORD iCorners[] = { x+1, y2-1, x+1, y+1, x2-1, y+1, x2-1, y2-1 };
p->setPen(g.background().dark());
- p->drawConvexPolygon(QPointArray(4, oCorners));
+ p->drawConvexPolygon(TQPointArray(4, oCorners));
if (thick) {
p->setPen(g.background().dark(115));
- p->drawConvexPolygon(QPointArray(4, iCorners));
+ p->drawConvexPolygon(TQPointArray(4, iCorners));
p->setPen(g.background().light());
if (sunken) {
@@ -327,21 +327,21 @@ void dotNETstyle::renderPanel(QPainter *p,
if (roundedCorners) {
p->setPen(g.background());
- p->drawPoints(QPointArray(4, oCorners));
+ p->drawPoints(TQPointArray(4, oCorners));
}
} else {
if (sunken) {
const QCOORD corners[] = { x2, y, x2, y2, x, y2, x, y };
p->setPen(g.background().dark());
- p->drawConvexPolygon(QPointArray(4, corners));
+ p->drawConvexPolygon(TQPointArray(4, corners));
p->setPen(g.background().light());
- p->drawPolyline(QPointArray(4, corners), 0, 3);
+ p->drawPolyline(TQPointArray(4, corners), 0, 3);
} else {
const QCOORD corners[] = { x, y2, x, y, x2, y, x2, y2 };
p->setPen(g.background().dark());
- p->drawPolygon(QPointArray(4, corners));
+ p->drawPolygon(TQPointArray(4, corners));
p->setPen(g.background().light());
- p->drawPolyline(QPointArray(4, corners), 0, 3);
+ p->drawPolyline(TQPointArray(4, corners), 0, 3);
}
}
@@ -351,15 +351,15 @@ void dotNETstyle::renderPanel(QPainter *p,
if (sunken) {
const QCOORD corners[] = { x2, y, x2, y2, x, y2, x, y };
p->setPen(g.background().dark());
- p->drawConvexPolygon(QPointArray(4, corners));
+ p->drawConvexPolygon(TQPointArray(4, corners));
p->setPen(g.background().light());
- p->drawPolyline(QPointArray(4, corners), 0, 3);
+ p->drawPolyline(TQPointArray(4, corners), 0, 3);
} else {
const QCOORD corners[] = { x, y2, x, y, x2, y, x2, y2 };
p->setPen(g.background().dark());
- p->drawPolygon(QPointArray(4, corners));
+ p->drawPolygon(TQPointArray(4, corners));
p->setPen(g.background().light());
- p->drawPolyline(QPointArray(4, corners), 0, 3);
+ p->drawPolyline(TQPointArray(4, corners), 0, 3);
}
}
}
@@ -369,18 +369,18 @@ void dotNETstyle::renderPanel(QPainter *p,
void dotNETstyle::drawKStylePrimitive(KStylePrimitive kpe,
- QPainter *p,
- const QWidget* widget,
- const QRect &r,
- const QColorGroup &cg,
+ TQPainter *p,
+ const TQWidget* widget,
+ const TQRect &r,
+ const TQColorGroup &cg,
SFlags flags,
- const QStyleOption& opt) const
+ const TQStyleOption& opt) const
{
// SLIDER
// ------
switch( kpe ) {
case KPE_SliderGroove: {
- const QSlider* slider = (const QSlider*)widget;
+ const TQSlider* slider = (const TQSlider*)widget;
int x, y, w, h;
r.rect(&x, &y, &w, &h);
bool horizontal = slider->orientation() == Horizontal;
@@ -417,11 +417,11 @@ void dotNETstyle::drawKStylePrimitive(KStylePrimitive kpe,
// This function draws primitive elements as well as their masks.
void dotNETstyle::drawPrimitive(PrimitiveElement pe,
- QPainter *p,
- const QRect &r,
- const QColorGroup &cg,
+ TQPainter *p,
+ const TQRect &r,
+ const TQColorGroup &cg,
SFlags flags,
- const QStyleOption &opt ) const
+ const TQStyleOption &opt ) const
{
bool down = flags & Style_Down;
bool on = flags & Style_On;
@@ -452,8 +452,8 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
}
case PE_ButtonDefault: {
- QRect sr = r;
- p->setPen(QPen::NoPen);
+ TQRect sr = r;
+ p->setPen(TQPen::NoPen);
p->setBrush(cg.background().dark(105));
p->drawRoundRect(sr, 25, 25);
p->setBrush(cg.background().dark(110));
@@ -473,16 +473,16 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
case PE_ScrollBarAddPage:
case PE_ScrollBarSubPage: {
// draw double buffered to avoid flicker...
- QPixmap buffer(2,2);
- QRect br(buffer.rect() );
- QPainter bp(&buffer);
+ TQPixmap buffer(2,2);
+ TQRect br(buffer.rect() );
+ TQPainter bp(&buffer);
if (on || down) {
- bp.fillRect(br, QBrush(cg.mid().dark()));
+ bp.fillRect(br, TQBrush(cg.mid().dark()));
} else {
- bp.fillRect(br, QBrush(cg.background()));
+ bp.fillRect(br, TQBrush(cg.background()));
}
- bp.fillRect(br, QBrush(cg.background().light(), Dense4Pattern));
+ bp.fillRect(br, TQBrush(cg.background().light(), Dense4Pattern));
bp.end();
p->drawTiledPixmap(r, buffer);
@@ -519,7 +519,7 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
if (pseudo3D && roundedCorners) {
const QCOORD corners[] = { x, y, x, y2, x2, y, x2, y2 };
p->setPen(cg.background());
- p->drawPoints(QPointArray(4, corners));
+ p->drawPoints(TQPointArray(4, corners));
}
break;
@@ -547,9 +547,9 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
p->fillRect(r, cg.background());
p->setPen(cg.background().dark());
p->setBrush(flags & Style_Enabled ? cg.light() : cg.background());
- p->drawPolygon(QPointArray(28, outline));
+ p->drawPolygon(TQPointArray(28, outline));
p->setPen(cg.background().dark(115));
- p->drawPoints(QPointArray(10, indark));
+ p->drawPoints(TQPointArray(10, indark));
break;
}
@@ -559,7 +559,7 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
p->setPen(color1);
p->setBrush(color1);
p->translate(r.x(), r.y());
- p->drawPolygon(QPointArray(28, outline));
+ p->drawPolygon(TQPointArray(28, outline));
p->translate(-r.x(), -r.y());
break;
}
@@ -593,7 +593,7 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
if (pseudo3D && roundedCorners) {
const QCOORD corners[] = { x, y, x, y2, x2, y, x2, y2 };
p->setPen(cg.background());
- p->drawPoints(QPointArray(4, corners));
+ p->drawPoints(TQPointArray(4, corners));
}
break;
}
@@ -670,7 +670,7 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
case PE_CheckMark: {
int x = r.center().x() - 3, y = r.center().y() - 3;
const QCOORD check[] = { x, y + 2, x, y + 4, x + 2, y + 6, x + 6, y + 2, x + 6, y, x + 2, y + 4 };
- const QPointArray a(6, check);
+ const TQPointArray a(6, check);
p->setPen(flags & Style_Down ? cg.highlight() : p->pen());
p->setBrush(flags & Style_Down ? cg.highlight() : p->pen().color());
@@ -686,7 +686,7 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
case PE_ArrowDown:
case PE_ArrowLeft:
case PE_ArrowRight: {
- QPointArray a;
+ TQPointArray a;
switch (pe) {
case PE_SpinWidgetUp:
@@ -725,21 +725,21 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
if (flags & Style_Enabled) {
a.translate((r.x() + r.width()/2), (r.y() + r.height()/2));
- if (p->pen() == QPen::NoPen) {
+ if (p->pen() == TQPen::NoPen) {
p->setPen(cg.buttonText());
}
p->drawLineSegments(a, 0, 3);
p->drawPoint(a[6]);
} else {
a.translate((r.x() + r.width()/2)+1, (r.y() + r.height()/2)+1);
- if (p->pen() == QPen::NoPen) {
+ if (p->pen() == TQPen::NoPen) {
p->setPen(cg.highlightedText());
}
p->drawLineSegments(a, 0, 3);
p->drawPoint(a[6]);
a.translate(-1,-1);
- if (p->pen() == QPen::NoPen) {
+ if (p->pen() == TQPen::NoPen) {
p->setPen(cg.mid());
}
p->drawLineSegments(a, 0, 3);
@@ -758,12 +758,12 @@ void dotNETstyle::drawPrimitive(PrimitiveElement pe,
void dotNETstyle::drawControl(ControlElement element,
- QPainter *p,
- const QWidget *widget,
- const QRect &r,
- const QColorGroup &cg,
+ TQPainter *p,
+ const TQWidget *widget,
+ const TQRect &r,
+ const TQColorGroup &cg,
SFlags flags,
- const QStyleOption& opt) const
+ const TQStyleOption& opt) const
{
switch (element) {
// CHECKBOXES
@@ -785,7 +785,7 @@ void dotNETstyle::drawControl(ControlElement element,
}
case CE_ProgressBarContents: {
- const QProgressBar *pb = (const QProgressBar *)widget;
+ const TQProgressBar *pb = (const TQProgressBar *)widget;
if (pb->totalSteps()) {
int x, y, w, h;
@@ -795,7 +795,7 @@ void dotNETstyle::drawControl(ControlElement element,
p->fillRect(x + 1, y + 1, w - 2, h - 2, cg.background().light());
- if (QApplication::reverseLayout()) {
+ if (TQApplication::reverseLayout()) {
x += w - ((int)(w * percent));
y += 1; h -= 2;
w = ((int)(w * percent)) - 2;
@@ -808,7 +808,7 @@ void dotNETstyle::drawControl(ControlElement element,
if (pb->progress() < pb->totalSteps()) {
p->setPen(cg.background().dark(115));
- if (QApplication::reverseLayout()) {
+ if (TQApplication::reverseLayout()) {
p->drawLine(x - 1, y, x - 1, h);
} else {
p->drawLine(x + w, y, x + w, h);
@@ -816,13 +816,13 @@ void dotNETstyle::drawControl(ControlElement element,
}
if (pseudo3D) {
- QPointArray corners;
- if (QApplication::reverseLayout()) {
+ TQPointArray corners;
+ if (TQApplication::reverseLayout()) {
const QCOORD c[] = { x, h, x, y, x + w, y, x + w, h };
- corners = QPointArray(4, c);
+ corners = TQPointArray(4, c);
} else {
const QCOORD c[] = { x, h, x, y, w, y, w, h };
- corners = QPointArray(4, c);
+ corners = TQPointArray(4, c);
}
p->setPen(cg.highlight().dark(120));
p->drawConvexPolygon(corners);
@@ -844,7 +844,7 @@ void dotNETstyle::drawControl(ControlElement element,
if (flags & Style_On || flags & Style_Down) {
QCOORD center[] = { 4, 5, 4, 7, 5, 8, 7, 8, 8, 7, 8, 5, 7, 4, 5, 4 };
- QPointArray c(8, center);
+ TQPointArray c(8, center);
p->setPen(flags & Style_Down ? cg.highlight() : cg.text());
p->setBrush(flags & Style_Down ? cg.highlight() : cg.text());
p->drawPolygon(c);
@@ -855,34 +855,34 @@ void dotNETstyle::drawControl(ControlElement element,
// TABS
// ----
case CE_TabBarTab: {
- const QTabBar *tb = (const QTabBar *) widget;
+ const TQTabBar *tb = (const TQTabBar *) widget;
bool cornerWidget = false;
- QTabBar::Shape tbs = tb->shape();
+ TQTabBar::Shape tbs = tb->shape();
bool selected = flags & Style_Selected;
int x, x2, y, y2, w, h;
r.rect(&x, &y, &w, &h);
r.coords(&x, &y, &x2, &y2);
- if (tb->parent()->inherits("QTabWidget")) {
- const QTabWidget *tw = (const QTabWidget *)tb->parent();
- QWidget *cw = tw->cornerWidget(Qt::TopLeft);
+ if (tb->parent()->inherits("TQTabWidget")) {
+ const TQTabWidget *tw = (const TQTabWidget *)tb->parent();
+ TQWidget *cw = tw->cornerWidget(Qt::TopLeft);
if (cw) {
cornerWidget = true;
}
}
switch (tbs) {
- case QTabBar::RoundedAbove: {
+ case TQTabBar::RoundedAbove: {
y2 -= 1;
if (pseudo3D) {
p->setPen(cg.background().dark());
if (selected) {
const QCOORD oCorners[] = { x, y2, x, y, x2, y, x2, y2 };
- p->drawPolyline(QPointArray(4, oCorners));
+ p->drawPolyline(TQPointArray(4, oCorners));
if (roundedCorners) {
p->setPen(cg.background());
- p->drawPoints(QPointArray(4, oCorners), 1, 2);
+ p->drawPoints(TQPointArray(4, oCorners), 1, 2);
}
p->setPen(cg.background().dark(115));
@@ -894,11 +894,11 @@ void dotNETstyle::drawControl(ControlElement element,
/* Left inner border */
p->drawLine(x + 1, y + 1, x + 1, y + h - 1);
} else {
- QRect r2(x+1, y+3, w-2, h-5);
+ TQRect r2(x+1, y+3, w-2, h-5);
p->fillRect(r2, cg.mid().light(105));
const QCOORD oCorners[] = { x, y2, x, y + 2, x2, y + 2, x2, y2 };
- p->drawPolyline(QPointArray(4, oCorners));
+ p->drawPolyline(TQPointArray(4, oCorners));
p->setPen(cg.background());
@@ -931,7 +931,7 @@ void dotNETstyle::drawControl(ControlElement element,
p->setPen(cg.background().dark(115));
p->drawLine(x + w - 2, y + 1, x + w - 2, y + h - 3);
} else {
- QRect r2(x + 1, y + 3, w - 2, h - 4);
+ TQRect r2(x + 1, y + 3, w - 2, h - 4);
p->fillRect(r2, cg.mid());
p->setPen(cg.background().light());
@@ -947,12 +947,12 @@ void dotNETstyle::drawControl(ControlElement element,
break;
}
- case QTabBar::RoundedBelow: {
+ case TQTabBar::RoundedBelow: {
if (pseudo3D) {
p->setPen(cg.background().dark());
if (selected) {
const QCOORD oCorners[] = { x, y + 1, x, y2, x2, y2, x2, y + 1 };
- p->drawPolyline(QPointArray(4, oCorners));
+ p->drawPolyline(TQPointArray(4, oCorners));
p->setPen(cg.background().dark(115));
p->drawLine(x + 1, y + h - 2, x + w - 2, y + h - 2);
@@ -964,10 +964,10 @@ void dotNETstyle::drawControl(ControlElement element,
} else {
y2 -= 2;
const QCOORD oCorners[] = { x, y, x, y2, x2, y2, x2, y };
- QRect r2(x + 1, y + 2, w - 2, h - 5);
+ TQRect r2(x + 1, y + 2, w - 2, h - 5);
p->fillRect(r2, cg.mid().light(105));
- p->drawPolyline(QPointArray(4, oCorners));
+ p->drawPolyline(TQPointArray(4, oCorners));
p->setPen(cg.mid().dark(115));
/* Inner right border */
@@ -1004,7 +1004,7 @@ void dotNETstyle::drawControl(ControlElement element,
p->drawLine(x + w - 1, y, x + w - 1, y + h - 1);
p->drawLine(x, y + h-1, x + w - 1, y + h - 1);
} else {
- QRect r2(x, y + 1, w - 1, h - 4);
+ TQRect r2(x, y + 1, w - 1, h - 4);
p->fillRect(r2, cg.mid());
p->setPen(cg.background().dark());
@@ -1053,8 +1053,8 @@ void dotNETstyle::drawControl(ControlElement element,
}
case CE_PushButton: {
- QPushButton *button = (QPushButton *)widget;
- QRect br = r;
+ TQPushButton *button = (TQPushButton *)widget;
+ TQRect br = r;
bool btnDefault = button->isDefault();
static int di = pixelMetric(PM_ButtonDefaultIndicator);
@@ -1069,11 +1069,11 @@ void dotNETstyle::drawControl(ControlElement element,
}
case CE_PushButtonLabel: {
- const QPushButton *pb = (const QPushButton *)widget;
+ const TQPushButton *pb = (const TQPushButton *)widget;
const bool enabled = flags & Style_Enabled;
const int text_flags = AlignVCenter | AlignHCenter | ShowPrefix |
DontClip | SingleLine;
- QRect ur(r);
+ TQRect ur(r);
if (flags & Style_Down) {
p->translate(pixelMetric(PM_ButtonShiftHorizontal),
@@ -1081,12 +1081,12 @@ void dotNETstyle::drawControl(ControlElement element,
}
if (!pb->text().isEmpty() && (flags & Style_ButtonDefault)) {
- p->setFont(QFont(p->font().family(), p->font().pointSize(), 75));
+ p->setFont(TQFont(p->font().family(), p->font().pointSize(), 75));
}
if (pb->iconSet() && !pb->iconSet()->isNull()) {
- QIconSet::Mode mode = enabled ? QIconSet::Normal : QIconSet::Disabled;
- QPixmap pixmap = pb->iconSet()->pixmap(QIconSet::Small, mode);
+ TQIconSet::Mode mode = enabled ? TQIconSet::Normal : TQIconSet::Disabled;
+ TQPixmap pixmap = pb->iconSet()->pixmap(TQIconSet::Small, mode);
if (!pb->text().isEmpty())
{
@@ -1109,7 +1109,7 @@ void dotNETstyle::drawControl(ControlElement element,
}
if (pb->pixmap() && !pb->text()) {
- QRect pr(0, 0, pb->pixmap()->width(), pb->pixmap()->height());
+ TQRect pr(0, 0, pb->pixmap()->width(), pb->pixmap()->height());
pr.moveCenter(r.center());
p->drawPixmap(pr.topLeft(), *pb->pixmap());
}
@@ -1135,7 +1135,7 @@ void dotNETstyle::drawControl(ControlElement element,
// MENUBAR ITEM (sunken panel on mouse over)
// -----------------------------------------
case CE_MenuBarItem: {
- QMenuItem *mi = opt.menuItem();
+ TQMenuItem *mi = opt.menuItem();
bool active = flags & Style_Active;
bool focused = flags & Style_HasFocus;
bool down = flags & Style_Down;
@@ -1151,7 +1151,7 @@ void dotNETstyle::drawControl(ControlElement element,
if (pseudo3D && roundedCorners && !down) {
const QCOORD corners[] = { x, y2, x, y, x2, y, x2, y2 };
p->setPen(cg.background());
- p->drawPoints(QPointArray(4, corners));
+ p->drawPoints(TQPointArray(4, corners));
}
if (down) {
@@ -1180,13 +1180,13 @@ void dotNETstyle::drawControl(ControlElement element,
// POPUPMENU ITEM (highlighted on mouseover)
// ------------------------------------------
case CE_PopupMenuItem: {
- QMenuItem *mi = opt.menuItem();
+ TQMenuItem *mi = opt.menuItem();
if (!mi) {
return;
}
- const QPopupMenu *pum = (const QPopupMenu *) widget;
+ const TQPopupMenu *pum = (const TQPopupMenu *) widget;
static const int itemFrame = 2;
static const int itemHMargin = 3;
static const int itemVMargin = 3;
@@ -1209,7 +1209,7 @@ void dotNETstyle::drawControl(ControlElement element,
if (pum->erasePixmap() && !pum->erasePixmap()->isNull()) {
p->drawPixmap( x, y, *pum->erasePixmap(), x, y, w, h );
} else {
- if (!QApplication::reverseLayout()) {
+ if (!TQApplication::reverseLayout()) {
p->fillRect( x, y, 22, h, cg.mid() );
p->fillRect( x + 22, y, w - 22, h, cg.background().light() );
} else { // i wonder why exactly +1 (diego)
@@ -1220,7 +1220,7 @@ void dotNETstyle::drawControl(ControlElement element,
if (mi->isSeparator()) {
p->setPen(cg.mid());
- if (!QApplication::reverseLayout())
+ if (!TQApplication::reverseLayout())
p->drawLine(x + opt.maxIconWidth() + 6, y, x + w, y);
else
p->drawLine(w - (x + opt.maxIconWidth() + 6), y,
@@ -1235,28 +1235,28 @@ void dotNETstyle::drawControl(ControlElement element,
if (pseudo3D && roundedCorners) {
const QCOORD segments[] = { x+2, y+1, x2-2, y+1, x2-1, y+2, x2-1, y2-2, x2-2, y2-1, x+2, y2-1, x+1, y2-2, x+1, y+2 };
const QCOORD icorners[] = { x+2, y+2, x2-2, y+2, x2-2,y2-2, x+2, y2-2 };
- p->drawLineSegments(QPointArray(8, segments));
- p->drawPoints(QPointArray(4, icorners));
+ p->drawLineSegments(TQPointArray(8, segments));
+ p->drawPoints(TQPointArray(4, icorners));
} else {
const QCOORD corners[] = { x+1, y2-1, x+1, y+1, x2-1, y+1, x2-1, y2-1 };
- p->drawConvexPolygon(QPointArray(4, corners));
+ p->drawConvexPolygon(TQPointArray(4, corners));
}
p->setPen(cg.highlightedText());
}
if (mi->iconSet()) {
p->save();
- QIconSet::Mode mode =
- disabled ? QIconSet::Disabled : QIconSet::Normal;
- QPixmap pixmap = mi->iconSet()->pixmap(QIconSet::Small, mode);
+ TQIconSet::Mode mode =
+ disabled ? TQIconSet::Disabled : TQIconSet::Normal;
+ TQPixmap pixmap = mi->iconSet()->pixmap(TQIconSet::Small, mode);
int pixw = pixmap.width();
int pixh = pixmap.height();
- QRect cr(xpos, y, opt.maxIconWidth(), h);
- QRect pmr(0, 0, pixw, pixh);
+ TQRect cr(xpos, y, opt.maxIconWidth(), h);
+ TQRect pmr(0, 0, pixw, pixh);
pmr.moveCenter(cr.center());
- if (QApplication::reverseLayout())
+ if (TQApplication::reverseLayout())
pmr = visualRect( pmr, r );
p->setPen(cg.highlightedText());
@@ -1274,7 +1274,7 @@ void dotNETstyle::drawControl(ControlElement element,
mi->custom()->paint(p, cg, active, !disabled, x+xm, y+m, w-xm-tab+1, h-2*m);
return;
} else {
- QString s = mi->text();
+ TQString s = mi->text();
if(!s.isNull()) {
int t = s.find('\t');
int m = itemVMargin;
@@ -1293,12 +1293,12 @@ void dotNETstyle::drawControl(ControlElement element,
int xp;
xp = x + w - tab - rightBorder - itemHMargin - itemFrame + 1;
- QRect rr = QRect(xp, y+m, tab, h-(2*m));
- if (QApplication::reverseLayout())
+ TQRect rr = TQRect(xp, y+m, tab, h-(2*m));
+ if (TQApplication::reverseLayout())
rr = visualRect(rr, r);
if (useTextShadows) {
- QPen op = p->pen();
+ TQPen op = p->pen();
p->setPen(active && !disabled ? cg.highlight().dark(130) : cg.background().dark(115));
p->drawText(rr.x() + 1, rr.y() + 1, rr.width(), rr.height(), text_flags, s.mid(t+1));
p->setPen(op);
@@ -1308,14 +1308,14 @@ void dotNETstyle::drawControl(ControlElement element,
s = s.left(t);
}
- QRect rr = QRect(xpos, y+m, w-xm-tab+1, h-(2*m));
- if (QApplication::reverseLayout()) {
+ TQRect rr = TQRect(xpos, y+m, w-xm-tab+1, h-(2*m));
+ if (TQApplication::reverseLayout()) {
rr = visualRect(rr, r);
text_flags |= AlignRight;
}
if (useTextShadows) {
- QPen op = p->pen();
+ TQPen op = p->pen();
p->setPen(active && !disabled ? cg.highlight().dark(130) : cg.background().dark(115));
p->drawText(rr.x() + 1, rr.y() + 1, rr.width(), rr.height(), text_flags, s);
p->setPen(op);
@@ -1323,7 +1323,7 @@ void dotNETstyle::drawControl(ControlElement element,
p->drawText(rr, text_flags, s);
} else if (mi->pixmap()) {
- QPixmap *pixmap = mi->pixmap();
+ TQPixmap *pixmap = mi->pixmap();
if (pixmap->depth() == 1) {
p->setBackgroundMode(OpaqueMode);
}
@@ -1345,10 +1345,10 @@ void dotNETstyle::drawControl(ControlElement element,
p->setPen(cg.text());
- QRect rr = QRect(xpos, y + h/2 - dim/2, dim, dim);
- if (QApplication::reverseLayout())
+ TQRect rr = TQRect(xpos, y + h/2 - dim/2, dim, dim);
+ if (TQApplication::reverseLayout())
rr = visualRect( rr, r );
- drawPrimitive((QApplication::reverseLayout() ? PE_ArrowLeft : PE_ArrowRight), p, rr, cg, Style_Enabled);
+ drawPrimitive((TQApplication::reverseLayout() ? PE_ArrowLeft : PE_ArrowRight), p, rr, cg, Style_Enabled);
}
if (checkable) {
@@ -1362,8 +1362,8 @@ void dotNETstyle::drawControl(ControlElement element,
else
cflags |= Style_On;
- QRect rr = QRect( xp + 6, y + 6, 16, h - 6 );
- if (QApplication::reverseLayout())
+ TQRect rr = TQRect( xp + 6, y + 6, 16, h - 6 );
+ if (TQApplication::reverseLayout())
rr = visualRect( rr, r );
drawPrimitive(PE_CheckMark, p, rr, cg, cflags);
@@ -1385,10 +1385,10 @@ void dotNETstyle::drawControl(ControlElement element,
}
void dotNETstyle::drawControlMask(ControlElement element,
- QPainter *p,
- const QWidget *w,
- const QRect &r,
- const QStyleOption &opt) const
+ TQPainter *p,
+ const TQWidget *w,
+ const TQRect &r,
+ const TQStyleOption &opt) const
{
switch (element) {
case CE_PushButton: {
@@ -1398,7 +1398,7 @@ void dotNETstyle::drawControlMask(ControlElement element,
QCOORD corners[] = { x1, y1, x2, y1, x1, y2, x2, y2 };
p->fillRect (r, color1);
p->setPen (color0);
- p->drawPoints (QPointArray (4, corners));
+ p->drawPoints (TQPointArray (4, corners));
} else {
// Just fill the entire thing
p->fillRect (r, color1);
@@ -1413,10 +1413,10 @@ void dotNETstyle::drawControlMask(ControlElement element,
}
void dotNETstyle::drawComplexControlMask(ComplexControl c,
- QPainter *p,
- const QWidget *w,
- const QRect &r,
- const QStyleOption &o) const
+ TQPainter *p,
+ const TQWidget *w,
+ const TQRect &r,
+ const TQStyleOption &o) const
{
switch (c) {
case CC_ComboBox: {
@@ -1426,7 +1426,7 @@ void dotNETstyle::drawComplexControlMask(ComplexControl c,
QCOORD corners[] = { x1, y1, x2, y1, x1, y2, x2, y2 };
p->fillRect (r, color1);
p->setPen (color0);
- p->drawPoints (QPointArray (4, corners));
+ p->drawPoints (TQPointArray (4, corners));
} else {
// Just fill the entire thing
p->fillRect (r, color1);
@@ -1440,21 +1440,21 @@ void dotNETstyle::drawComplexControlMask(ComplexControl c,
}
void dotNETstyle::drawComplexControl(ComplexControl control,
- QPainter *p,
- const QWidget *widget,
- const QRect &r,
- const QColorGroup &cg,
+ TQPainter *p,
+ const TQWidget *widget,
+ const TQRect &r,
+ const TQColorGroup &cg,
SFlags flags,
SCFlags controls,
SCFlags active,
- const QStyleOption& opt) const
+ const TQStyleOption& opt) const
{
switch(control) {
// COMBOBOX
// --------
case CC_ComboBox: {
int x, y, w, h;
- const QComboBox *cb = (const QComboBox *)widget;
+ const TQComboBox *cb = (const TQComboBox *)widget;
r.rect(&x, &y, &w, &h);
if (active & Style_Sunken)
@@ -1468,7 +1468,7 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
static const unsigned int handle_width = 15;
static const unsigned int handle_offset = handle_width + 1;
- QBitmap downArrow = QBitmap(7, 4, downarrow_bits, true);
+ TQBitmap downArrow = TQBitmap(7, 4, downarrow_bits, true);
downArrow.setMask(downArrow);
cb->editable() ? p->fillRect(x + 1, y + 1, w - 2, h - 2, cg.base()) : p->fillRect(x + 1, y + 1, w - 2, h - 2, cg.light());
@@ -1488,14 +1488,14 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
p->setBrush(cg.midlight());
}
- QRect hr = (pseudo3D ? QRect(w - handle_offset - 1, y, handle_width + 2, h) : QRect(w - handle_offset - 1, y + 1, handle_width + 2, h - 1));
- if (QApplication::reverseLayout()) { hr = visualRect(hr, r); }
+ TQRect hr = (pseudo3D ? TQRect(w - handle_offset - 1, y, handle_width + 2, h) : TQRect(w - handle_offset - 1, y + 1, handle_width + 2, h - 1));
+ if (TQApplication::reverseLayout()) { hr = visualRect(hr, r); }
p->drawRect(hr);
p->setBrush(NoBrush);
- QRect rr = (pseudo3D ? QRect(x + 1, y + 1, w - 2, h - 2) : QRect(x + 1, y + 1, w - 1, h - 1));
+ TQRect rr = (pseudo3D ? TQRect(x + 1, y + 1, w - 2, h - 2) : TQRect(x + 1, y + 1, w - 1, h - 1));
- if (QApplication::reverseLayout()) { rr = visualRect( rr, r ); }
+ if (TQApplication::reverseLayout()) { rr = visualRect( rr, r ); }
if (flags & Style_HasFocus || cg.highlight() == cg.midlight() ||
(cb->listBox() && cb->listBox()->isVisible())) {
@@ -1506,12 +1506,12 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
(cb->listBox() && cb->listBox()->isVisible()))) {
p->save();
p->setBrush(NoBrush);
- QColor test = ((flags & Style_HasFocus) ? cg.highlight() : cg.midlight());
+ TQColor test = ((flags & Style_HasFocus) ? cg.highlight() : cg.midlight());
p->setPen(test.dark());
p->drawRect(hr);
hr.moveBy(1,1);
- hr.setSize(QSize(hr.width() -2, hr.height() -2));
- QPointArray ca(3);
+ hr.setSize(TQSize(hr.width() -2, hr.height() -2));
+ TQPointArray ca(3);
ca.setPoint(0, hr.topRight());
ca.setPoint(1, hr.bottomRight());
ca.setPoint(2, hr.bottomLeft());
@@ -1529,7 +1529,7 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
p->drawPoint(r.bottomRight());
p->setPen(cg.background().dark());
hr.moveBy(-1,-1);
- hr.setSize(QSize(hr.width() + 2, hr.height() + 2));
+ hr.setSize(TQSize(hr.width() + 2, hr.height() + 2));
p->drawPoint(hr.topLeft());
p->drawPoint(hr.bottomLeft());
}
@@ -1540,10 +1540,10 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
p->setPen(cg.text());
}
- QRect cr(w - handle_offset, y, handle_width, h - 2);
- QRect pmr(0, 0, 7, 4);
+ TQRect cr(w - handle_offset, y, handle_width, h - 2);
+ TQRect pmr(0, 0, 7, 4);
pmr.moveCenter(cr.center());
- if (QApplication::reverseLayout()) {
+ if (TQApplication::reverseLayout()) {
pmr = visualRect( pmr, r );
}
@@ -1556,9 +1556,9 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
// TOOLBUTTON
// ----------
case CC_ToolButton: {
- const QToolButton *tb = (const QToolButton *) widget;
+ const TQToolButton *tb = (const TQToolButton *) widget;
- QRect button, menuarea;
+ TQRect button, menuarea;
button = querySubControlMetrics(control, widget, SC_ToolButton, opt);
menuarea = querySubControlMetrics(control, widget, SC_ToolButtonMenu, opt);
@@ -1578,7 +1578,7 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
} else if (tb->parentWidget() &&
tb->parentWidget()->backgroundPixmap() &&
!tb->parentWidget()->backgroundPixmap()->isNull()) {
- QPixmap pixmap = *(tb->parentWidget()->backgroundPixmap());
+ TQPixmap pixmap = *(tb->parentWidget()->backgroundPixmap());
p->drawTiledPixmap( r, pixmap, tb->pos() );
}
}
@@ -1592,7 +1592,7 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
}
if (tb->hasFocus() && !tb->focusProxy()) {
- QRect fr = tb->rect();
+ TQRect fr = tb->rect();
fr.addCoords(2, 2, -2, -2);
drawPrimitive(PE_FocusRect, p, fr, cg);
}
@@ -1603,11 +1603,11 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
// SPINWIDGETS
// -----------
case CC_SpinWidget: {
- const QSpinWidget *sw = (const QSpinWidget *) widget;
+ const TQSpinWidget *sw = (const TQSpinWidget *) widget;
SFlags flags;
PrimitiveElement pe;
- QRect swf = querySubControlMetrics(control, sw, SC_SpinWidgetFrame);
+ TQRect swf = querySubControlMetrics(control, sw, SC_SpinWidgetFrame);
swf = visualRect( swf, sw );
if (controls & SC_SpinWidgetFrame) {
@@ -1623,18 +1623,18 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
} else
flags |= Style_Raised;
- if (sw->buttonSymbols() == QSpinWidget::PlusMinus)
+ if (sw->buttonSymbols() == TQSpinWidget::PlusMinus)
pe = PE_SpinWidgetPlus;
else
pe = PE_SpinWidgetUp;
- QRect re = sw->upRect();
- QColorGroup ucg = sw->isUpEnabled() ? cg : sw->palette().disabled();
+ TQRect re = sw->upRect();
+ TQColorGroup ucg = sw->isUpEnabled() ? cg : sw->palette().disabled();
p->fillRect(re.x() + 1, re.y() + 1, re.width() - 2, re.height() - 1, flags & Style_Raised ? ucg.background() : ucg.highlight());
if (pseudo3D) {
const QCOORD corners[] = { re.x(), re.bottom(), re.x(), re.y() + 1, re.x() + 1, re.y(), re.right() - 1, re.y(), re.right(), re.y() + 1, re.right(), re.bottom() };
p->setPen(flags & Style_Raised ? ucg.background().dark() : ucg.highlight());
- p->drawLineSegments(QPointArray(6, corners));
+ p->drawLineSegments(TQPointArray(6, corners));
p->setPen(flags & Style_Raised ? ucg.background().light() : ucg.highlight());
p->drawLine(re.x() + 1, re.y() + 1, re.x() + 1, re.bottom());
p->drawLine(re.x() + 1, re.y() + 1, re.right()-1, re.y() + 1);
@@ -1655,13 +1655,13 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
} else
flags |= Style_Raised;
- if (sw->buttonSymbols() == QSpinWidget::PlusMinus)
+ if (sw->buttonSymbols() == TQSpinWidget::PlusMinus)
pe = PE_SpinWidgetMinus;
else
pe = PE_SpinWidgetDown;
- QRect re = sw->downRect();
- QColorGroup dcg = sw->isDownEnabled() ? cg : sw->palette().disabled();
+ TQRect re = sw->downRect();
+ TQColorGroup dcg = sw->isDownEnabled() ? cg : sw->palette().disabled();
p->fillRect(re.x() + 1, re.y(), re.width() - 2, re.height() - 1, flags & Style_Raised ? dcg.background() : dcg.highlight());
if (pseudo3D) {
const QCOORD corners[] = {
@@ -1673,7 +1673,7 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
re.right(), re.y()
};
p->setPen(flags & Style_Raised ? dcg.background().dark() : dcg.highlight());
- p->drawLineSegments(QPointArray(6, corners));
+ p->drawLineSegments(TQPointArray(6, corners));
p->setPen(flags & Style_Raised ? dcg.background().light() : dcg.highlight());
p->drawLine(re.x() + 1, re.y(), re.x() + 1, re.bottom());
p->setPen(flags & Style_Raised ? dcg.background().dark(115) : dcg.highlight());
@@ -1698,7 +1698,7 @@ void dotNETstyle::drawComplexControl(ComplexControl control,
}
-QRect dotNETstyle::subRect(SubRect r, const QWidget *widget) const
+TQRect dotNETstyle::subRect(SubRect r, const TQWidget *widget) const
{
// Don't use KStyles progressbar subrect
switch (r) {
@@ -1707,7 +1707,7 @@ QRect dotNETstyle::subRect(SubRect r, const QWidget *widget) const
}
case SR_PushButtonFocusRect: {
- QRect rect = widget->rect();
+ TQRect rect = widget->rect();
int margin = pixelMetric(PM_ButtonDefaultIndicator, widget) + pixelMetric(PM_DefaultFrameWidth, widget) + 2;
rect.addCoords(margin, margin, -margin, -margin);
@@ -1725,21 +1725,21 @@ QRect dotNETstyle::subRect(SubRect r, const QWidget *widget) const
}
}
-QRect dotNETstyle::querySubControlMetrics(ComplexControl control,
- const QWidget *widget,
+TQRect dotNETstyle::querySubControlMetrics(ComplexControl control,
+ const TQWidget *widget,
SubControl subcontrol,
- const QStyleOption &opt) const
+ const TQStyleOption &opt) const
{
if (!widget) {
- return QRect();
+ return TQRect();
}
- QRect r(widget->rect());
+ TQRect r(widget->rect());
switch (control) {
case CC_ComboBox: {
switch (subcontrol) {
case SC_ComboBoxEditField: {
- return QRect(r.x() + 2, r.y() + 2, r.width() - 19, r.height() - 4);
+ return TQRect(r.x() + 2, r.y() + 2, r.width() - 19, r.height() - 4);
}
default: {
return KStyle::querySubControlMetrics(control, widget, subcontrol, opt);
@@ -1750,7 +1750,7 @@ QRect dotNETstyle::querySubControlMetrics(ComplexControl control,
case CC_SpinWidget: {
int fw = pixelMetric(PM_SpinBoxFrameWidth, widget);
- QSize bs;
+ TQSize bs;
bs.setHeight(QMAX(8, widget->height()/2));
bs.setWidth(QMIN(bs.height() * 8 / 5, widget->width() / 4));
@@ -1762,19 +1762,19 @@ QRect dotNETstyle::querySubControlMetrics(ComplexControl control,
switch (subcontrol) {
case SC_SpinWidgetUp: {
- return QRect(x, y-1, bs.width(), bs.height());
+ return TQRect(x, y-1, bs.width(), bs.height());
}
case SC_SpinWidgetDown: {
- return QRect(x, y + bs.height()-1, bs.width(), bs.height());
+ return TQRect(x, y + bs.height()-1, bs.width(), bs.height());
}
case SC_SpinWidgetFrame: {
- return QRect(0, 0, widget->width() - (bs.width() + 2), widget->height());
+ return TQRect(0, 0, widget->width() - (bs.width() + 2), widget->height());
}
case SC_SpinWidgetEditField: {
- return QRect(lx, fw, widget->width() - (bs.width() + 4), widget->height() - 2 * fw);
+ return TQRect(lx, fw, widget->width() - (bs.width() + 4), widget->height() - 2 * fw);
}
case SC_SpinWidgetButtonField: {
- return QRect(x, y, bs.width(), widget->height() - 2 * fw);
+ return TQRect(x, y, bs.width(), widget->height() - 2 * fw);
}
default: {
}
@@ -1787,24 +1787,24 @@ QRect dotNETstyle::querySubControlMetrics(ComplexControl control,
return KStyle::querySubControlMetrics(control, widget, subcontrol, opt);
}
-int dotNETstyle::pixelMetric(PixelMetric m, const QWidget *widget) const
+int dotNETstyle::pixelMetric(PixelMetric m, const TQWidget *widget) const
{
switch(m) {
// TABS
// ----
case PM_TabBarTabVSpace: {
- const QTabBar * tb = (const QTabBar *) widget;
- if (tb->shape() == QTabBar::RoundedAbove ||
- tb->shape() == QTabBar::RoundedBelow)
+ const TQTabBar * tb = (const TQTabBar *) widget;
+ if (tb->shape() == TQTabBar::RoundedAbove ||
+ tb->shape() == TQTabBar::RoundedBelow)
return 12;
else
return 0;
}
case PM_TabBarTabOverlap: {
- const QTabBar* tb = (const QTabBar*)widget;
- if (tb->shape() != QTabBar::RoundedAbove &&
- tb->shape() != QTabBar::RoundedBelow)
+ const TQTabBar* tb = (const TQTabBar*)widget;
+ if (tb->shape() != TQTabBar::RoundedAbove &&
+ tb->shape() != TQTabBar::RoundedBelow)
return 3; // Leave standard size alone
else
return 1; // Change size for our tabs only
@@ -1857,10 +1857,10 @@ int dotNETstyle::pixelMetric(PixelMetric m, const QWidget *widget) const
return 1;
} else {
if (widget &&
- (widget->inherits("QPopupMenu") ||
- widget->inherits("QMenuBar") ||
- widget->inherits("QRangeControl") ||
- widget->inherits("QScrollView"))) {
+ (widget->inherits("TQPopupMenu") ||
+ widget->inherits("TQMenuBar") ||
+ widget->inherits("TQRangeControl") ||
+ widget->inherits("TQScrollView"))) {
return 1;
} else {
return 2;
@@ -1883,10 +1883,10 @@ int dotNETstyle::pixelMetric(PixelMetric m, const QWidget *widget) const
}
-QSize dotNETstyle::sizeFromContents(ContentsType t,
- const QWidget *widget,
- const QSize &s,
- const QStyleOption &opt) const
+TQSize dotNETstyle::sizeFromContents(ContentsType t,
+ const TQWidget *widget,
+ const TQSize &s,
+ const TQStyleOption &opt) const
{
switch (t) {
@@ -1894,8 +1894,8 @@ QSize dotNETstyle::sizeFromContents(ContentsType t,
if (!widget || opt.isDefault())
break;
- const QPopupMenu *popup = (const QPopupMenu *)widget;
- QMenuItem *mi = opt.menuItem();
+ const TQPopupMenu *popup = (const TQPopupMenu *)widget;
+ TQMenuItem *mi = opt.menuItem();
int maxpmw = opt.maxIconWidth();
int w = s.width(), h = s.height();
bool checkable = popup->isCheckable();
@@ -1916,7 +1916,7 @@ QSize dotNETstyle::sizeFromContents(ContentsType t,
h = QMAX(h, widget->fontMetrics().height() + 10);
if (mi->iconSet()) {
- h = QMAX(h, mi->iconSet()->pixmap(QIconSet::Small, QIconSet::Normal).height() + 8);
+ h = QMAX(h, mi->iconSet()->pixmap(TQIconSet::Small, TQIconSet::Normal).height() + 8);
}
}
@@ -1938,19 +1938,19 @@ QSize dotNETstyle::sizeFromContents(ContentsType t,
w += 20;
- return QSize(w, h);
+ return TQSize(w, h);
}
case CT_PushButton: {
- const QPushButton* button = (const QPushButton*) widget;
+ const TQPushButton* button = (const TQPushButton*) widget;
int w = s.width();
int h = s.height();
int bm = pixelMetric( PM_ButtonMargin, widget );
int fw = pixelMetric( PM_DefaultFrameWidth, widget ) * 2;
//We use bold font sometimes, so that make take more space than Qt allocated.
- QFontMetrics origFM = button->fontMetrics();
- QFontMetrics boldFM = QFontMetrics(QFont(button->font().family(), button->font().pointSize(), 75));
+ TQFontMetrics origFM = button->fontMetrics();
+ TQFontMetrics boldFM = TQFontMetrics(TQFont(button->font().family(), button->font().pointSize(), 75));
int origTextWidth = origFM.size(ShowPrefix, button->text()).width();
int boldTextWidth = boldFM.size(ShowPrefix, button->text()).width();
@@ -1974,12 +1974,12 @@ QSize dotNETstyle::sizeFromContents(ContentsType t,
if ( h < 22 )
h = 22;
- return QSize( w, h );
+ return TQSize( w, h );
}
case CT_ComboBox: {
int arrow = 21;
- return QSize(s.width() + arrow, QMAX(s.height() + 4, 16));
+ return TQSize(s.width() + arrow, QMAX(s.height() + 4, 16));
}
default:
@@ -1992,81 +1992,81 @@ QSize dotNETstyle::sizeFromContents(ContentsType t,
void dotNETstyle::paletteChanged()
{
- QComboBox *combo = 0L;
- QMenuBar *menuBar = 0L;
- QToolBar *toolBar = 0L;
- QWidget *widget = 0L;
+ TQComboBox *combo = 0L;
+ TQMenuBar *menuBar = 0L;
+ TQToolBar *toolBar = 0L;
+ TQWidget *widget = 0L;
- QValueListIterator<QWidget*> it = m_widgets.begin();
+ TQValueListIterator<TQWidget*> it = m_widgets.begin();
for ( ; it != m_widgets.end(); ++it ) {
widget = *it;
- if ((combo = dynamic_cast<QComboBox*>( widget )))
+ if ((combo = dynamic_cast<TQComboBox*>( widget )))
updatePalette( combo );
- else if ((toolBar = dynamic_cast<QToolBar*>( widget )))
+ else if ((toolBar = dynamic_cast<TQToolBar*>( widget )))
updatePalette( toolBar );
- else if ((menuBar = dynamic_cast<QMenuBar*>( widget )))
+ else if ((menuBar = dynamic_cast<TQMenuBar*>( widget )))
updatePalette( menuBar );
}
}
-void dotNETstyle::updatePalette( QComboBox *combo )
+void dotNETstyle::updatePalette( TQComboBox *combo )
{
- QPalette pal = QApplication::palette();
- pal.setColor(QColorGroup::Dark,
- pal.active().color(QColorGroup::Base));
- pal.setColor(QColorGroup::Midlight,
- pal.active().color(QColorGroup::Background));
+ TQPalette pal = TQApplication::palette();
+ pal.setColor(TQColorGroup::Dark,
+ pal.active().color(TQColorGroup::Base));
+ pal.setColor(TQColorGroup::Midlight,
+ pal.active().color(TQColorGroup::Background));
combo->setPalette(pal);
}
-void dotNETstyle::updatePalette( QToolBar *bar )
+void dotNETstyle::updatePalette( TQToolBar *bar )
{
- QPalette pal = QApplication::palette();
- pal.setColor(QColorGroup::Button,
- pal.active().color(QColorGroup::Background));
+ TQPalette pal = TQApplication::palette();
+ pal.setColor(TQColorGroup::Button,
+ pal.active().color(TQColorGroup::Background));
bar->setPalette(pal);
}
-void dotNETstyle::updatePalette( QMenuBar *bar )
+void dotNETstyle::updatePalette( TQMenuBar *bar )
{
- QPalette pal = QApplication::palette();
- pal.setColor(QColorGroup::Button,
- pal.active().color(QColorGroup::Background));
+ TQPalette pal = TQApplication::palette();
+ pal.setColor(TQColorGroup::Button,
+ pal.active().color(TQColorGroup::Background));
bar->setPalette(pal);
}
void dotNETstyle::slotDestroyed()
{
- m_widgets.remove( (QWidget*) sender() );
+ m_widgets.remove( (TQWidget*) sender() );
}
-bool dotNETstyle::eventFilter(QObject *obj, QEvent *ev)
+bool dotNETstyle::eventFilter(TQObject *obj, TQEvent *ev)
{
- if (obj->inherits("QComboBox")) {
- if (ev->type() == QEvent::Enter) {
- QWidget *btn = (QWidget *)obj;
+ if (obj->inherits("TQComboBox")) {
+ if (ev->type() == TQEvent::Enter) {
+ TQWidget *btn = (TQWidget *)obj;
if (btn->isEnabled()) {
- QPalette pal = btn->palette();
- pal.setColor(QColorGroup::Dark,
- pal.active().color(QColorGroup::Highlight).dark());
- pal.setColor(QColorGroup::Midlight,
- pal.active().color(QColorGroup::Highlight));
+ TQPalette pal = btn->palette();
+ pal.setColor(TQColorGroup::Dark,
+ pal.active().color(TQColorGroup::Highlight).dark());
+ pal.setColor(TQColorGroup::Midlight,
+ pal.active().color(TQColorGroup::Highlight));
btn->setPalette(pal);
}
- } else if (ev->type() == QEvent::Leave) {
- QWidget *btn = (QWidget *)obj;
- QPalette pal = btn->palette();
- pal.setColor(QColorGroup::Dark,
- pal.active().color(QColorGroup::Base));
- pal.setColor(QColorGroup::Midlight,
- pal.active().color(QColorGroup::Background));
+ } else if (ev->type() == TQEvent::Leave) {
+ TQWidget *btn = (TQWidget *)obj;
+ TQPalette pal = btn->palette();
+ pal.setColor(TQColorGroup::Dark,
+ pal.active().color(TQColorGroup::Base));
+ pal.setColor(TQColorGroup::Midlight,
+ pal.active().color(TQColorGroup::Background));
btn->setPalette(pal);
}
- } else if (obj->inherits("QButton")) {
- QWidget *btn = (QWidget *)obj;
- QPalette pal = btn->palette();
- pal.setColor(QColorGroup::Button,
- pal.active().color(QColorGroup::Background));
+ } else if (obj->inherits("TQButton")) {
+ TQWidget *btn = (TQWidget *)obj;
+ TQPalette pal = btn->palette();
+ pal.setColor(TQColorGroup::Button,
+ pal.active().color(TQColorGroup::Background));
btn->setPalette(pal);
}
diff --git a/styles/dotnet/dotnet.h b/styles/dotnet/dotnet.h
index dce41e97..8225da28 100644
--- a/styles/dotnet/dotnet.h
+++ b/styles/dotnet/dotnet.h
@@ -23,7 +23,7 @@
#define __DOTNET_H
#include <kstyle.h>
-#include <qbitmap.h>
+#include <tqbitmap.h>
#define u_arrow -4,1, 2,1, -3,0, 1,0, -2,-1, 0,-1, -1,-2
#define d_arrow -4,-2, 2,-2, -3,-1, 1,-1, -2,0, 0,0, -1,1
@@ -40,90 +40,90 @@ public:
dotNETstyle();
virtual ~dotNETstyle();
- bool inheritsKHTML( const QWidget* widget ) const;
- void polish( QWidget* widget );
- void unPolish( QWidget* widget );
+ bool inheritsKHTML( const TQWidget* widget ) const;
+ void polish( TQWidget* widget );
+ void unPolish( TQWidget* widget );
- void renderMenuBlendPixmap( KPixmap&, const QColorGroup&, const QPopupMenu * ) const;
+ void renderMenuBlendPixmap( KPixmap&, const TQColorGroup&, const TQPopupMenu * ) const;
void drawKStylePrimitive( KStylePrimitive kpe,
- QPainter* p,
- const QWidget* widget,
- const QRect &r,
- const QColorGroup &cg,
+ TQPainter* p,
+ const TQWidget* widget,
+ const TQRect &r,
+ const TQColorGroup &cg,
SFlags flags = Style_Default,
- const QStyleOption& = QStyleOption::Default ) const;
+ const TQStyleOption& = TQStyleOption::Default ) const;
void drawPrimitive( PrimitiveElement pe,
- QPainter *p,
- const QRect &r,
- const QColorGroup &cg,
+ TQPainter *p,
+ const TQRect &r,
+ const TQColorGroup &cg,
SFlags flags = Style_Default,
- const QStyleOption &opt = QStyleOption::Default ) const;
+ const TQStyleOption &opt = TQStyleOption::Default ) const;
void drawControl( ControlElement element,
- QPainter *p,
- const QWidget *widget,
- const QRect &r,
- const QColorGroup &cg,
+ TQPainter *p,
+ const TQWidget *widget,
+ const TQRect &r,
+ const TQColorGroup &cg,
SFlags flags = Style_Default,
- const QStyleOption& = QStyleOption::Default ) const;
+ const TQStyleOption& = TQStyleOption::Default ) const;
- void drawControlMask( ControlElement, QPainter *, const QWidget *, const QRect &, const QStyleOption &) const;
+ void drawControlMask( ControlElement, TQPainter *, const TQWidget *, const TQRect &, const TQStyleOption &) const;
void drawComplexControl( ComplexControl control,
- QPainter *p,
- const QWidget *widget,
- const QRect &r,
- const QColorGroup &cg,
+ TQPainter *p,
+ const TQWidget *widget,
+ const TQRect &r,
+ const TQColorGroup &cg,
SFlags flags = Style_Default,
SCFlags controls = SC_All,
SCFlags active = SC_None,
- const QStyleOption& = QStyleOption::Default ) const;
+ const TQStyleOption& = TQStyleOption::Default ) const;
int pixelMetric( PixelMetric m,
- const QWidget *widget = 0 ) const;
+ const TQWidget *widget = 0 ) const;
- QRect subRect( SubRect r,
- const QWidget *widget ) const;
+ TQRect subRect( SubRect r,
+ const TQWidget *widget ) const;
- QRect querySubControlMetrics( ComplexControl control,
- const QWidget *widget,
+ TQRect querySubControlMetrics( ComplexControl control,
+ const TQWidget *widget,
SubControl subcontrol,
- const QStyleOption &opt = QStyleOption::Default ) const;
+ const TQStyleOption &opt = TQStyleOption::Default ) const;
- void drawComplexControlMask(QStyle::ComplexControl c,
- QPainter *p,
- const QWidget *w,
- const QRect &r,
- const QStyleOption &o=QStyleOption::Default) const;
+ void drawComplexControlMask(TQStyle::ComplexControl c,
+ TQPainter *p,
+ const TQWidget *w,
+ const TQRect &r,
+ const TQStyleOption &o=TQStyleOption::Default) const;
- QSize sizeFromContents(QStyle::ContentsType t,
- const QWidget *w,
- const QSize &s,
- const QStyleOption &o) const;
+ TQSize sizeFromContents(TQStyle::ContentsType t,
+ const TQWidget *w,
+ const TQSize &s,
+ const TQStyleOption &o) const;
protected:
- void renderButton(QPainter *p,
- const QRect &r,
- const QColorGroup &g,
+ void renderButton(TQPainter *p,
+ const TQRect &r,
+ const TQColorGroup &g,
bool sunken = false,
bool corners = false) const;
- void renderPanel(QPainter *p,
- const QRect &r,
- const QColorGroup &g,
+ void renderPanel(TQPainter *p,
+ const TQRect &r,
+ const TQColorGroup &g,
bool sunken = true,
bool thick = true) const;
- void renderSlider(QPainter *p,
- const QRect &r,
- const QColorGroup &g) const;
- bool eventFilter(QObject *, QEvent *);
+ void renderSlider(TQPainter *p,
+ const TQRect &r,
+ const TQColorGroup &g) const;
+ bool eventFilter(TQObject *, TQEvent *);
- void updatePalette( QComboBox * );
- void updatePalette( QToolBar * );
- void updatePalette( QMenuBar * );
+ void updatePalette( TQComboBox * );
+ void updatePalette( TQToolBar * );
+ void updatePalette( TQMenuBar * );
protected slots:
void slotDestroyed();
@@ -133,11 +133,11 @@ private:
// Disable copy constructor and = operator
dotNETstyle( const dotNETstyle & );
dotNETstyle& operator=( const dotNETstyle & );
- QStyle *winstyle;
+ TQStyle *winstyle;
bool pseudo3D, useTextShadows, roundedCorners, reverseLayout, kickerMode;
- QValueList<QWidget*> m_widgets;
+ TQValueList<TQWidget*> m_widgets;
};
#endif
diff --git a/styles/phase/bitmaps.h b/styles/phase/bitmaps.h
index d1b8c712..1163e103 100644
--- a/styles/phase/bitmaps.h
+++ b/styles/phase/bitmaps.h
@@ -11,57 +11,57 @@
// Arrows (6x6)
-static QBitmap uarrow;
+static TQBitmap uarrow;
static const unsigned char uarrow_bits[] = {
0x00, 0x0c, 0x1e, 0x3f, 0x3f, 0x00};
-static QBitmap darrow;
+static TQBitmap darrow;
static const unsigned char darrow_bits[] = {
0x00, 0x3f, 0x3f, 0x1e, 0x0c, 0x00};
-static QBitmap larrow;
+static TQBitmap larrow;
static const unsigned char larrow_bits[] = {
0x18, 0x1c, 0x1e, 0x1e, 0x1c, 0x18};
-static QBitmap rarrow;
+static TQBitmap rarrow;
static const unsigned char rarrow_bits[] = {
0x06, 0x0e, 0x1e, 0x1e, 0x0e, 0x06};
// plus/minus "arrows"
-static QBitmap bplus;
+static TQBitmap bplus;
static const unsigned char bplus_bits[] = {
0x0c, 0x0c, 0x3f, 0x3f, 0x0c, 0x0c};
-static QBitmap bminus;
+static TQBitmap bminus;
static const unsigned char bminus_bits[] = {
0x00, 0x00, 0x3f, 0x3f, 0x00, 0x00};
// checkmark (9x9)
-static QBitmap bcheck;
+static TQBitmap bcheck;
static const unsigned char bcheck_bits[] = {
0x00, 0x00, 0x80, 0x01, 0xc0, 0x01, 0xe0, 0x00, 0x73, 0x00, 0x3f, 0x00,
0x1e, 0x00, 0x0c, 0x00, 0x00, 0x00};
// expander arrows (9x9)
-static QBitmap dexpand;
+static TQBitmap dexpand;
static const unsigned char dexpand_bits[] = {
0x00, 0x00, 0x00, 0x00, 0xff, 0x01, 0xfe, 0x00, 0x7c, 0x00, 0x38, 0x00,
0x10, 0x00, 0x00, 0x00, 0x00, 0x00};
-static QBitmap rexpand;
+static TQBitmap rexpand;
static const unsigned char rexpand_bits[] = {
0x04, 0x00, 0x0c, 0x00, 0x1c, 0x00, 0x3c, 0x00, 0x7c, 0x00, 0x3c, 0x00,
0x1c, 0x00, 0x0c, 0x00, 0x04, 0x00};
// scrollbar doodads (4x4)
-static QBitmap doodad_mid;
+static TQBitmap doodad_mid;
static const unsigned char doodad_mid_bits[] = {
0x07, 0x01, 0x01, 0x00};
-static QBitmap doodad_light;
+static TQBitmap doodad_light;
static const unsigned char doodad_light_bits[] = {
0x00, 0x08, 0x08, 0x0e};
diff --git a/styles/phase/config/phasestyleconfig.cpp b/styles/phase/config/phasestyleconfig.cpp
index 8543214c..4f7e200d 100644
--- a/styles/phase/config/phasestyleconfig.cpp
+++ b/styles/phase/config/phasestyleconfig.cpp
@@ -7,10 +7,10 @@
// Please see the header file for copyright and license information.
//////////////////////////////////////////////////////////////////////////////
-#include <qsettings.h>
-#include <qcheckbox.h>
-#include <qgroupbox.h>
-#include <qwhatsthis.h>
+#include <tqsettings.h>
+#include <tqcheckbox.h>
+#include <tqgroupbox.h>
+#include <tqwhatsthis.h>
#include <klocale.h>
#include <kglobal.h>
@@ -26,11 +26,11 @@
// ----------------
// Constructor
-PhaseStyleConfig::PhaseStyleConfig(QWidget* parent) : StyleDialog(parent)
+PhaseStyleConfig::PhaseStyleConfig(TQWidget* parent) : StyleDialog(parent)
{
KGlobal::locale()->insertCatalogue("kstyle_phase_config");
- QSettings settings;
+ TQSettings settings;
oldgradients =
settings.readBoolEntry("/phasestyle/Settings/gradients", true);
gradients->setChecked(oldgradients);
@@ -39,10 +39,10 @@ PhaseStyleConfig::PhaseStyleConfig(QWidget* parent) : StyleDialog(parent)
highlights->setChecked(oldhighlights);
// connections
- connect(gradients, SIGNAL(toggled(bool)),
- this, SLOT(updateChanged()));
- connect(highlights, SIGNAL(toggled(bool)),
- this, SLOT(updateChanged()));
+ connect(gradients, TQT_SIGNAL(toggled(bool)),
+ this, TQT_SLOT(updateChanged()));
+ connect(highlights, TQT_SIGNAL(toggled(bool)),
+ this, TQT_SLOT(updateChanged()));
}
//////////////////////////////////////////////////////////////////////////////
@@ -79,7 +79,7 @@ void PhaseStyleConfig::updateChanged()
void PhaseStyleConfig::save()
{
- QSettings settings;
+ TQSettings settings;
settings.writeEntry("/phasestyle/Settings/gradients",
gradients->isChecked());
settings.writeEntry("/phasestyle/Settings/highlights",
@@ -103,7 +103,7 @@ void PhaseStyleConfig::defaults()
extern "C"
{
- KDE_EXPORT QObject* allocate_kstyle_config(QWidget* parent) {
+ KDE_EXPORT TQObject* allocate_kstyle_config(TQWidget* parent) {
return(new PhaseStyleConfig(parent));
}
}
diff --git a/styles/phase/config/phasestyleconfig.h b/styles/phase/config/phasestyleconfig.h
index 8f15531c..f77c5a3a 100644
--- a/styles/phase/config/phasestyleconfig.h
+++ b/styles/phase/config/phasestyleconfig.h
@@ -35,7 +35,7 @@ class PhaseStyleConfig : public StyleDialog
{
Q_OBJECT
public:
- PhaseStyleConfig(QWidget* parent);
+ PhaseStyleConfig(TQWidget* parent);
~PhaseStyleConfig();
signals:
diff --git a/styles/phase/phasestyle.cpp b/styles/phase/phasestyle.cpp
index 7ce112b2..d2b14e46 100644
--- a/styles/phase/phasestyle.cpp
+++ b/styles/phase/phasestyle.cpp
@@ -26,30 +26,30 @@
#include <kpixmap.h>
#include <kpixmapeffect.h>
-#include <qapplication.h>
-#include <qintdict.h>
-#include <qpainter.h>
-#include <qpointarray.h>
-#include <qsettings.h>
-#include <qstyleplugin.h>
-
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qheader.h>
-#include <qmainwindow.h>
-#include <qmenubar.h>
-#include <qpopupmenu.h>
-#include <qprogressbar.h>
-#include <qpushbutton.h>
-#include <qradiobutton.h>
-#include <qscrollbar.h>
-#include <qslider.h>
-#include <qsplitter.h>
-#include <qtabbar.h>
-#include <qtabwidget.h>
-#include <qtoolbar.h>
-#include <qtoolbox.h>
-#include <qtoolbutton.h>
+#include <tqapplication.h>
+#include <tqintdict.h>
+#include <tqpainter.h>
+#include <tqpointarray.h>
+#include <tqsettings.h>
+#include <tqstyleplugin.h>
+
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqheader.h>
+#include <tqmainwindow.h>
+#include <tqmenubar.h>
+#include <tqpopupmenu.h>
+#include <tqprogressbar.h>
+#include <tqpushbutton.h>
+#include <tqradiobutton.h>
+#include <tqscrollbar.h>
+#include <tqslider.h>
+#include <tqsplitter.h>
+#include <tqtabbar.h>
+#include <tqtabwidget.h>
+#include <tqtoolbar.h>
+#include <tqtoolbox.h>
+#include <tqtoolbutton.h>
#include "phasestyle.h"
#include "bitmaps.h"
@@ -83,9 +83,9 @@ static unsigned contrast = 110;
PhaseStyle::PhaseStyle()
: KStyle(FilledFrameWorkaround | AllowMenuTransparency,
ThreeButtonScrollBar), hover_(0), hovertab_(0),
- gradients_(QPixmap::defaultDepth() > 8), kicker_(false)
+ gradients_(TQPixmap::defaultDepth() > 8), kicker_(false)
{
- QSettings settings;
+ TQSettings settings;
if (gradients_) { // don't bother setting if already false
gradients_ =
settings.readBoolEntry("/phasestyle/Settings/gradients", true);
@@ -94,31 +94,31 @@ PhaseStyle::PhaseStyle()
highlights_ =
settings.readBoolEntry("/phasestyle/Settings/highlights", true);
- gradients = new QMap<unsigned int, QIntDict<GradientSet> >;
+ gradients = new TQMap<unsigned int, TQIntDict<GradientSet> >;
- reverse_ = QApplication::reverseLayout();
+ reverse_ = TQApplication::reverseLayout();
// create bitmaps
- uarrow = QBitmap(6, 6, uarrow_bits, true);
+ uarrow = TQBitmap(6, 6, uarrow_bits, true);
uarrow.setMask(uarrow);
- darrow = QBitmap(6, 6, darrow_bits, true);
+ darrow = TQBitmap(6, 6, darrow_bits, true);
darrow.setMask(darrow);
- larrow = QBitmap(6, 6, larrow_bits, true);
+ larrow = TQBitmap(6, 6, larrow_bits, true);
larrow.setMask(larrow);
- rarrow = QBitmap(6, 6, rarrow_bits, true);
+ rarrow = TQBitmap(6, 6, rarrow_bits, true);
rarrow.setMask(rarrow);
- bplus = QBitmap(6, 6, bplus_bits, true);
+ bplus = TQBitmap(6, 6, bplus_bits, true);
bplus.setMask(bplus);
- bminus = QBitmap(6, 6, bminus_bits, true);
+ bminus = TQBitmap(6, 6, bminus_bits, true);
bminus.setMask(bminus);
- bcheck = QBitmap(9, 9, bcheck_bits, true);
+ bcheck = TQBitmap(9, 9, bcheck_bits, true);
bcheck.setMask(bcheck);
- dexpand = QBitmap(9, 9, dexpand_bits, true);
+ dexpand = TQBitmap(9, 9, dexpand_bits, true);
dexpand.setMask(dexpand);
- rexpand = QBitmap(9, 9, rexpand_bits, true);
+ rexpand = TQBitmap(9, 9, rexpand_bits, true);
rexpand.setMask(rexpand);
- doodad_mid = QBitmap(4, 4, doodad_mid_bits, true);
- doodad_light = QBitmap(4, 4, doodad_light_bits, true);
+ doodad_mid = TQBitmap(4, 4, doodad_mid_bits, true);
+ doodad_light = TQBitmap(4, 4, doodad_light_bits, true);
}
PhaseStyle::~PhaseStyle()
@@ -136,7 +136,7 @@ PhaseStyle::~PhaseStyle()
// --------
// Initialize application specific
-void PhaseStyle::polish(QApplication* app)
+void PhaseStyle::polish(TQApplication* app)
{
if (!qstrcmp(app->argv()[0], "kicker")) kicker_ = true;
}
@@ -146,28 +146,28 @@ void PhaseStyle::polish(QApplication* app)
// --------
// Initialize the appearance of a widget
-void PhaseStyle::polish(QWidget *widget)
+void PhaseStyle::polish(TQWidget *widget)
{
- if (::qt_cast<QMenuBar*>(widget) ||
- ::qt_cast<QPopupMenu*>(widget)) {
+ if (::qt_cast<TQMenuBar*>(widget) ||
+ ::qt_cast<TQPopupMenu*>(widget)) {
// anti-flicker optimization
widget->setBackgroundMode(NoBackground);
- } else if (::qt_cast<QFrame*>(widget) ||
+ } else if (::qt_cast<TQFrame*>(widget) ||
widget->inherits(QTOOLBAREXTENSION) ||
(!qstrcmp(widget->name(), KTOOLBARWIDGET))) {
// needs special handling on paint events
widget->installEventFilter(this);
} else if (highlights_ &&
- (::qt_cast<QPushButton*>(widget) ||
- ::qt_cast<QComboBox*>(widget) ||
- ::qt_cast<QSpinWidget*>(widget) ||
- ::qt_cast<QCheckBox*>(widget) ||
- ::qt_cast<QRadioButton*>(widget) ||
- ::qt_cast<QSlider*>(widget) ||
+ (::qt_cast<TQPushButton*>(widget) ||
+ ::qt_cast<TQComboBox*>(widget) ||
+ ::qt_cast<TQSpinWidget*>(widget) ||
+ ::qt_cast<TQCheckBox*>(widget) ||
+ ::qt_cast<TQRadioButton*>(widget) ||
+ ::qt_cast<TQSlider*>(widget) ||
widget->inherits(QSPLITTERHANDLE))) {
// mouseover highlighting
widget->installEventFilter(this);
- } else if (highlights_ && ::qt_cast<QTabBar*>(widget)) {
+ } else if (highlights_ && ::qt_cast<TQTabBar*>(widget)) {
// highlighting needing mouse tracking
widget->setMouseTracking(true);
widget->installEventFilter(this);
@@ -181,22 +181,22 @@ void PhaseStyle::polish(QWidget *widget)
// --------
// Initialize the palette
-void PhaseStyle::polish(QPalette &pal)
+void PhaseStyle::polish(TQPalette &pal)
{
// clear out gradients on a color change
gradients->clear();
// lighten up a bit, so the look is not so "crisp"
- if (QPixmap::defaultDepth() > 8) { // but not on low color displays
- pal.setColor(QPalette::Disabled, QColorGroup::Dark,
- pal.color(QPalette::Disabled, QColorGroup::Dark).light(contrast));
- pal.setColor(QPalette::Active, QColorGroup::Dark,
- pal.color(QPalette::Active, QColorGroup::Dark).light(contrast));
- pal.setColor(QPalette::Inactive, QColorGroup::Dark,
- pal.color(QPalette::Inactive, QColorGroup::Dark).light(contrast));
+ if (TQPixmap::defaultDepth() > 8) { // but not on low color displays
+ pal.setColor(TQPalette::Disabled, TQColorGroup::Dark,
+ pal.color(TQPalette::Disabled, TQColorGroup::Dark).light(contrast));
+ pal.setColor(TQPalette::Active, TQColorGroup::Dark,
+ pal.color(TQPalette::Active, TQColorGroup::Dark).light(contrast));
+ pal.setColor(TQPalette::Inactive, TQColorGroup::Dark,
+ pal.color(TQPalette::Inactive, TQColorGroup::Dark).light(contrast));
}
- QStyle::polish(pal);
+ TQStyle::polish(pal);
}
//////////////////////////////////////////////////////////////////////////////
@@ -204,25 +204,25 @@ void PhaseStyle::polish(QPalette &pal)
// ----------
// Undo the initialization of a widget's appearance
-void PhaseStyle::unPolish(QWidget *widget)
+void PhaseStyle::unPolish(TQWidget *widget)
{
- if (::qt_cast<QMenuBar*>(widget) ||
- ::qt_cast<QPopupMenu*>(widget)) {
+ if (::qt_cast<TQMenuBar*>(widget) ||
+ ::qt_cast<TQPopupMenu*>(widget)) {
widget->setBackgroundMode(PaletteBackground);
- } else if (::qt_cast<QFrame*>(widget) ||
+ } else if (::qt_cast<TQFrame*>(widget) ||
widget->inherits(QTOOLBAREXTENSION) ||
(!qstrcmp(widget->name(), KTOOLBARWIDGET))) {
widget->removeEventFilter(this);
} else if (highlights_ && // highlighting
- (::qt_cast<QPushButton*>(widget) ||
- ::qt_cast<QComboBox*>(widget) ||
- ::qt_cast<QSpinWidget*>(widget) ||
- ::qt_cast<QCheckBox*>(widget) ||
- ::qt_cast<QRadioButton*>(widget) ||
- ::qt_cast<QSlider*>(widget) ||
+ (::qt_cast<TQPushButton*>(widget) ||
+ ::qt_cast<TQComboBox*>(widget) ||
+ ::qt_cast<TQSpinWidget*>(widget) ||
+ ::qt_cast<TQCheckBox*>(widget) ||
+ ::qt_cast<TQRadioButton*>(widget) ||
+ ::qt_cast<TQSlider*>(widget) ||
widget->inherits(QSPLITTERHANDLE))) {
widget->removeEventFilter(this);
- } else if (highlights_ && ::qt_cast<QTabBar*>(widget)) {
+ } else if (highlights_ && ::qt_cast<TQTabBar*>(widget)) {
widget->setMouseTracking(false);
widget->removeEventFilter(this);
}
@@ -239,9 +239,9 @@ void PhaseStyle::unPolish(QWidget *widget)
// ------------------
// Draw gradient
-void PhaseStyle::drawPhaseGradient(QPainter *painter,
- const QRect &rect,
- QColor color,
+void PhaseStyle::drawPhaseGradient(TQPainter *painter,
+ const TQRect &rect,
+ TQColor color,
bool horizontal,
int px, int py,
int pw, int ph,
@@ -270,7 +270,7 @@ void PhaseStyle::drawPhaseGradient(QPainter *painter,
(*gradients)[color.rgb()].insert(size, set);
}
painter->drawTiledPixmap(rect, *set->gradient(horizontal, reverse),
- QPoint(px, py));
+ TQPoint(px, py));
}
}
@@ -279,10 +279,10 @@ void PhaseStyle::drawPhaseGradient(QPainter *painter,
// ----------------
// Draw the basic Phase bevel
-void PhaseStyle::drawPhaseBevel(QPainter *painter,
+void PhaseStyle::drawPhaseBevel(TQPainter *painter,
int x, int y, int w, int h,
- const QColorGroup &group,
- const QColor &fill,
+ const TQColorGroup &group,
+ const TQColor &fill,
bool sunken,
bool horizontal,
bool reverse) const
@@ -310,7 +310,7 @@ void PhaseStyle::drawPhaseBevel(QPainter *painter,
// sunken bevels don't get gradients
painter->fillRect(x+2, y+2, w-4, h-4, fill);
} else {
- drawPhaseGradient(painter, QRect(x+2, y+2, w-4, h-4), fill,
+ drawPhaseGradient(painter, TQRect(x+2, y+2, w-4, h-4), fill,
horizontal, 0, 0, w-4, h-4, reverse);
}
painter->restore();
@@ -321,10 +321,10 @@ void PhaseStyle::drawPhaseBevel(QPainter *painter,
// ----------------
// Draw the basic Phase button
-void PhaseStyle::drawPhaseButton(QPainter *painter,
+void PhaseStyle::drawPhaseButton(TQPainter *painter,
int x, int y, int w, int h,
- const QColorGroup &group,
- const QColor &fill,
+ const TQColorGroup &group,
+ const TQColor &fill,
bool sunken) const
{
int x2 = x + w - 1;
@@ -351,11 +351,11 @@ void PhaseStyle::drawPhaseButton(QPainter *painter,
// ----------------
// Draw the basic Phase panel
-void PhaseStyle::drawPhasePanel(QPainter *painter,
+void PhaseStyle::drawPhasePanel(TQPainter *painter,
int x, int y, int w, int h,
- const QColorGroup &group,
+ const TQColorGroup &group,
bool sunken,
- const QBrush *fill) const
+ const TQBrush *fill) const
{
int x2 = x + w - 1;
int y2 = y + h - 1;
@@ -398,14 +398,14 @@ void PhaseStyle::drawPhasePanel(QPainter *painter,
// -------------
// Draw a Phase style tab
-void PhaseStyle::drawPhaseTab(QPainter *painter,
+void PhaseStyle::drawPhaseTab(TQPainter *painter,
int x, int y, int w, int h,
- const QColorGroup &group,
- const QTabBar *bar,
- const QStyleOption &option,
+ const TQColorGroup &group,
+ const TQTabBar *bar,
+ const TQStyleOption &option,
SFlags flags) const
{
- const QTabWidget *tabwidget;
+ const TQTabWidget *tabwidget;
bool selected = (flags & Style_Selected);
bool edge; // tab is at edge of bar
const int x2 = x + w - 1;
@@ -421,11 +421,11 @@ void PhaseStyle::drawPhaseTab(QPainter *painter,
edge = false;
}
- switch (QTabBar::Shape(bar->shape())) {
- case QTabBar::RoundedAbove:
- case QTabBar::TriangularAbove: {
+ switch (TQTabBar::Shape(bar->shape())) {
+ case TQTabBar::RoundedAbove:
+ case TQTabBar::TriangularAbove: {
// is there a corner widget?
- tabwidget = ::qt_cast<QTabWidget*>(bar->parent());
+ tabwidget = ::qt_cast<TQTabWidget*>(bar->parent());
if (edge && tabwidget
&& tabwidget->cornerWidget(reverse_ ?
Qt::TopRight : Qt::TopLeft)) {
@@ -438,9 +438,9 @@ void PhaseStyle::drawPhaseTab(QPainter *painter,
if (selected) {
painter->setPen(Qt::NoPen);
painter->fillRect(x+1, y+1, w-1, h-1,
- group.brush(QColorGroup::Background));
+ group.brush(TQColorGroup::Background));
} else {
- drawPhaseGradient(painter, QRect(x+1, y+1, w-1, h-2),
+ drawPhaseGradient(painter, TQRect(x+1, y+1, w-1, h-2),
(flags & Style_MouseOver)
? group.background()
: group.background().dark(contrast),
@@ -501,10 +501,10 @@ void PhaseStyle::drawPhaseTab(QPainter *painter,
break;
}
- case QTabBar::RoundedBelow:
- case QTabBar::TriangularBelow: {
+ case TQTabBar::RoundedBelow:
+ case TQTabBar::TriangularBelow: {
// is there a corner widget?
- tabwidget = ::qt_cast<QTabWidget*>(bar->parent());
+ tabwidget = ::qt_cast<TQTabWidget*>(bar->parent());
if (edge && tabwidget
&& tabwidget->cornerWidget(reverse_ ?
Qt::BottomRight : Qt::BottomLeft)) {
@@ -572,11 +572,11 @@ void PhaseStyle::drawPhaseTab(QPainter *painter,
// Draw the primitive element
void PhaseStyle::drawPrimitive(PrimitiveElement element,
- QPainter *painter,
- const QRect &rect,
- const QColorGroup &group,
+ TQPainter *painter,
+ const TQRect &rect,
+ const TQColorGroup &group,
SFlags flags,
- const QStyleOption &option) const
+ const TQStyleOption &option) const
{
// common locals
bool down = flags & Style_Down;
@@ -586,8 +586,8 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
bool horiz = flags & Style_Horizontal;
bool mouseover = highlights_ && (flags & Style_MouseOver);
int x, y, w, h, x2, y2, n, cx, cy;
- QPointArray parray;
- QWidget* widget;
+ TQPointArray parray;
+ TQWidget* widget;
rect.rect(&x, &y, &w, &h);
x2 = rect.right();
@@ -610,7 +610,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
break;
case PE_FocusRect: {
- QPen old = painter->pen();
+ TQPen old = painter->pen();
painter->setPen(group.highlight().dark(contrast));
painter->drawRect(rect);
@@ -621,8 +621,8 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
case PE_HeaderSection: {
// covers kicker taskbar buttons and menu titles
- QHeader* header = dynamic_cast<QHeader*>(painter->device());
- widget =dynamic_cast<QWidget*>(painter->device());
+ TQHeader* header = dynamic_cast<TQHeader*>(painter->device());
+ widget =dynamic_cast<TQWidget*>(painter->device());
if (header) {
horiz = (header->orientation() == Horizontal);
@@ -630,7 +630,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
horiz = true;
}
- if ((widget) && ((widget->inherits("QPopupMenu")) ||
+ if ((widget) && ((widget->inherits("TQPopupMenu")) ||
(widget->inherits("KPopupTitle")))) {
// kicker/kdesktop menu titles
drawPhaseBevel(painter, x,y,w,h,
@@ -639,7 +639,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
// taskbar buttons (assuming no normal headers used in kicker)
if (depress) {
painter->setPen(group.dark());
- painter->setBrush(group.brush(QColorGroup::Mid));
+ painter->setBrush(group.brush(TQColorGroup::Mid));
painter->drawRect(x-1, y-1, w+1, h+1);
}
else {
@@ -650,7 +650,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
// other headers
if (depress) {
painter->setPen(group.dark());
- painter->setBrush(group.brush(QColorGroup::Mid));
+ painter->setBrush(group.brush(TQColorGroup::Mid));
painter->drawRect(x-1, y-1, w+1, h+1);
}
else {
@@ -703,7 +703,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
}
}
- drawPrimitive(arrow, painter, QRect(x,y,h,w), group, flags);
+ drawPrimitive(arrow, painter, TQRect(x,y,h,w), group, flags);
break;
}
@@ -727,8 +727,8 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
case PE_Indicator:
drawPhasePanel(painter, x+1, y+1, w-2, h-2, group, true, enabled ?
- &group.brush(QColorGroup::Base) :
- &group.brush(QColorGroup::Background));
+ &group.brush(TQColorGroup::Base) :
+ &group.brush(TQColorGroup::Background));
if (on) {
painter->setPen(mouseover
@@ -736,7 +736,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
: group.dark());
painter->drawRect(x+4, y+4, w-8, h-8);
painter->fillRect(x+5, y+5, w-10, h-10,
- group.brush(QColorGroup::Highlight));
+ group.brush(TQColorGroup::Highlight));
} else if (mouseover) {
painter->setPen(group.highlight().dark(contrast));
painter->drawRect(x+4, y+4, w-8, h-8);
@@ -754,8 +754,8 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
cy = (y + y2) / 2;
painter->setBrush(enabled
- ? group.brush(QColorGroup::Base)
- : group.brush(QColorGroup::Background));
+ ? group.brush(TQColorGroup::Base)
+ : group.brush(TQColorGroup::Background));
painter->setPen(group.dark());
parray.putPoints(0, 8,
@@ -771,7 +771,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
painter->drawPolyline(parray, 0, 4);
if (on) {
- painter->setBrush(group.brush(QColorGroup::Highlight));
+ painter->setBrush(group.brush(TQColorGroup::Highlight));
painter->setPen(mouseover
? group.highlight().dark(contrast)
: group.dark());
@@ -804,7 +804,7 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
case PE_DockWindowResizeHandle:
drawPhasePanel(painter, x, y, w, h, group, false,
- &group.brush(QColorGroup::Background));
+ &group.brush(TQColorGroup::Background));
break;
case PE_Splitter:
@@ -883,12 +883,12 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
break;
case PE_DockWindowSeparator: {
- widget = dynamic_cast<QWidget*>(painter->device());
+ widget = dynamic_cast<TQWidget*>(painter->device());
bool flat = true;
if (widget && widget->parent() &&
- widget->parent()->inherits("QToolBar")) {
- QToolBar *toolbar = ::qt_cast<QToolBar*>(widget->parent());
+ widget->parent()->inherits("TQToolBar")) {
+ TQToolBar *toolbar = ::qt_cast<TQToolBar*>(widget->parent());
if (toolbar) {
// toolbar not floating or in a QMainWindow
flat = flatToolbar(toolbar);
@@ -1009,12 +1009,12 @@ void PhaseStyle::drawPrimitive(PrimitiveElement element,
// Draw the element
void PhaseStyle::drawKStylePrimitive(KStylePrimitive element,
- QPainter *painter,
- const QWidget *widget,
- const QRect &rect,
- const QColorGroup &group,
+ TQPainter *painter,
+ const TQWidget *widget,
+ const TQRect &rect,
+ const TQColorGroup &group,
SFlags flags,
- const QStyleOption &option) const
+ const TQStyleOption &option) const
{
bool horiz = flags & Style_Horizontal;
int x, y, w, h, x2, y2, n, cx, cy;
@@ -1050,7 +1050,7 @@ void PhaseStyle::drawKStylePrimitive(KStylePrimitive element,
//case KPE_DockWindowHandle:
case KPE_GeneralHandle:
cx-=2; cy-=2;
- painter->fillRect(rect, group.brush(QColorGroup::Background));
+ painter->fillRect(rect, group.brush(TQColorGroup::Background));
if (horiz) {
for (n = -5; n <= 5; n += 5) {
@@ -1084,7 +1084,7 @@ void PhaseStyle::drawKStylePrimitive(KStylePrimitive element,
break;
case KPE_SliderGroove: {
- const QSlider* slider = ::qt_cast<const QSlider*>(widget);
+ const TQSlider* slider = ::qt_cast<const TQSlider*>(widget);
if (slider) {
if (slider->orientation() == Horizontal) {
y = cy - 3;
@@ -1095,14 +1095,14 @@ void PhaseStyle::drawKStylePrimitive(KStylePrimitive element,
}
}
drawPhasePanel(painter, x, y, w, h, group, true,
- &group.brush(QColorGroup::Mid));
+ &group.brush(TQColorGroup::Mid));
break;
}
case KPE_SliderHandle: {
- const QSlider* slider = ::qt_cast<const QSlider*>(widget);
+ const TQSlider* slider = ::qt_cast<const TQSlider*>(widget);
if (slider) {
- QColor color = (widget==hover_)
+ TQColor color = (widget==hover_)
? group.button().light(contrast)
: group.button();
if (slider->orientation() == Horizontal) {
@@ -1132,19 +1132,19 @@ void PhaseStyle::drawKStylePrimitive(KStylePrimitive element,
// Draw the control
void PhaseStyle::drawControl(ControlElement element,
- QPainter *painter,
- const QWidget *widget,
- const QRect &rect,
- const QColorGroup &group,
+ TQPainter *painter,
+ const TQWidget *widget,
+ const TQRect &rect,
+ const TQColorGroup &group,
SFlags flags,
- const QStyleOption &option) const
+ const TQStyleOption &option) const
{
bool active, enabled, depress;
int x, y, w, h, x2, y2, dx;
- QMenuItem *mi;
- QIconSet::Mode mode;
- QIconSet::State state;
- QPixmap pixmap;
+ TQMenuItem *mi;
+ TQIconSet::Mode mode;
+ TQIconSet::State state;
+ TQPixmap pixmap;
rect.rect(&x, &y, &w, &h);
x2 = rect.right();
@@ -1157,7 +1157,7 @@ void PhaseStyle::drawControl(ControlElement element,
if ((flags & Style_ButtonDefault) && !depress) {
drawPhasePanel(painter, x, y, w, h, group, true,
- &group.brush(QColorGroup::Mid));
+ &group.brush(TQColorGroup::Mid));
drawPhaseBevel(painter, x+bd, y+bd, w-bd*2, h-bd*2, group,
(widget==hover_)
? group.button().light(contrast)
@@ -1179,7 +1179,7 @@ void PhaseStyle::drawControl(ControlElement element,
}
case CE_PushButtonLabel: {
- const QPushButton* button = ::qt_cast<const QPushButton*>(widget);
+ const TQPushButton* button = ::qt_cast<const TQPushButton*>(widget);
if (!button) {
KStyle::drawControl(element, painter, widget, rect, group,
flags, option);
@@ -1195,7 +1195,7 @@ void PhaseStyle::drawControl(ControlElement element,
if (button->isMenuButton()) { // menu indicator
int dx = pixelMetric(PM_MenuButtonIndicator, widget);
drawPrimitive(PE_ArrowDown, painter,
- QRect(x+w-dx-2, y+2, dx, h-4),
+ TQRect(x+w-dx-2, y+2, dx, h-4),
group, flags, option);
w -= dx;
}
@@ -1203,21 +1203,21 @@ void PhaseStyle::drawControl(ControlElement element,
if (button->iconSet() && !button->iconSet()->isNull()) { // draw icon
if (button->isEnabled()) {
if (button->hasFocus()) {
- mode = QIconSet::Active;
+ mode = TQIconSet::Active;
} else {
- mode = QIconSet::Normal;
+ mode = TQIconSet::Normal;
}
} else {
- mode = QIconSet::Disabled;
+ mode = TQIconSet::Disabled;
}
if (button->isToggleButton() && button->isOn()) {
- state = QIconSet::On;
+ state = TQIconSet::On;
} else {
- state = QIconSet::Off;
+ state = TQIconSet::Off;
}
- pixmap = button->iconSet()->pixmap(QIconSet::Small, mode, state);
+ pixmap = button->iconSet()->pixmap(TQIconSet::Small, mode, state);
if (button->text().isEmpty() && !button->pixmap()) {
painter->drawPixmap(x+w/2 - pixmap.width()/2,
y+h/2 - pixmap.height()/2, pixmap);
@@ -1230,7 +1230,7 @@ void PhaseStyle::drawControl(ControlElement element,
if (active || button->isDefault()) { // default button
for(int n=0; n<2; n++) {
- drawItem(painter, QRect(x+n, y, w, h),
+ drawItem(painter, TQRect(x+n, y, w, h),
AlignCenter | ShowPrefix,
button->colorGroup(),
button->isEnabled(),
@@ -1241,7 +1241,7 @@ void PhaseStyle::drawControl(ControlElement element,
&button->colorGroup().mid());
}
} else { // normal button
- drawItem(painter, QRect(x, y, w, h),
+ drawItem(painter, TQRect(x, y, w, h),
AlignCenter | ShowPrefix,
button->colorGroup(),
button->isEnabled(),
@@ -1256,7 +1256,7 @@ void PhaseStyle::drawControl(ControlElement element,
case CE_CheckBoxLabel:
case CE_RadioButtonLabel: {
- const QButton *b = ::qt_cast<const QButton*>(widget);
+ const TQButton *b = ::qt_cast<const TQButton*>(widget);
if (!b) return;
int alignment = reverse_ ? AlignRight : AlignLeft;
@@ -1274,7 +1274,7 @@ void PhaseStyle::drawControl(ControlElement element,
}
case CE_DockWindowEmptyArea: {
- const QToolBar *tb = ::qt_cast<const QToolBar*>(widget);
+ const TQToolBar *tb = ::qt_cast<const TQToolBar*>(widget);
if (tb) {
// toolbar not floating or in a QMainWindow
if (flatToolbar(tb)) {
@@ -1289,24 +1289,24 @@ void PhaseStyle::drawControl(ControlElement element,
}
case CE_MenuBarEmptyArea:
- drawPhaseGradient(painter, QRect(x, y, w, h), group.background(),
+ drawPhaseGradient(painter, TQRect(x, y, w, h), group.background(),
(w<h), 0, 0, 0, 0, false);
break;
case CE_MenuBarItem: {
- const QMenuBar *mbar = ::qt_cast<const QMenuBar*>(widget);
+ const TQMenuBar *mbar = ::qt_cast<const TQMenuBar*>(widget);
if (!mbar) {
KStyle::drawControl(element, painter, widget, rect, group,
flags, option);
return;
}
mi = option.menuItem();
- QRect prect = mbar->rect();
+ TQRect prect = mbar->rect();
if ((flags & Style_Active) && (flags & Style_HasFocus)) {
if (flags & Style_Down) {
drawPhasePanel(painter, x, y, w, h, group, true,
- &group.brush(QColorGroup::Background));
+ &group.brush(TQColorGroup::Background));
} else {
drawPhaseBevel(painter, x, y, w, h,
group, group.background(),
@@ -1325,7 +1325,7 @@ void PhaseStyle::drawControl(ControlElement element,
}
case CE_PopupMenuItem: {
- const QPopupMenu *popup = ::qt_cast<const QPopupMenu*>(widget);
+ const TQPopupMenu *popup = ::qt_cast<const TQPopupMenu*>(widget);
if (!popup) {
KStyle::drawControl(element, painter, widget, rect, group,
flags, option);
@@ -1344,7 +1344,7 @@ void PhaseStyle::drawControl(ControlElement element,
bool etchtext = styleHint(SH_EtchDisabledText);
active = flags & Style_Active;
enabled = mi->isEnabled();
- QRect vrect;
+ TQRect vrect;
if (checkable) checkwidth = QMAX(checkwidth, 20);
@@ -1374,13 +1374,13 @@ void PhaseStyle::drawControl(ControlElement element,
// draw icon
if (mi->iconSet() && !mi->isChecked()) {
if (active)
- mode = enabled ? QIconSet::Active : QIconSet::Disabled;
+ mode = enabled ? TQIconSet::Active : TQIconSet::Disabled;
else
- mode = enabled ? QIconSet::Normal : QIconSet::Disabled;
+ mode = enabled ? TQIconSet::Normal : TQIconSet::Disabled;
- pixmap = mi->iconSet()->pixmap(QIconSet::Small, mode);
- QRect pmrect(0, 0, pixmap.width(), pixmap.height());
- vrect = visualRect(QRect(x, y, checkwidth, h), rect);
+ pixmap = mi->iconSet()->pixmap(TQIconSet::Small, mode);
+ TQRect pmrect(0, 0, pixmap.width(), pixmap.height());
+ vrect = visualRect(TQRect(x, y, checkwidth, h), rect);
pmrect.moveCenter(vrect.center());
painter->drawPixmap(pmrect.topLeft(), pixmap);
}
@@ -1389,7 +1389,7 @@ void PhaseStyle::drawControl(ControlElement element,
if (mi->isChecked()) {
int cx = reverse_ ? x+w - checkwidth : x;
drawPrimitive(PE_CheckMark, painter,
- QRect(cx + ITEMFRAME, y + ITEMFRAME,
+ TQRect(cx + ITEMFRAME, y + ITEMFRAME,
checkwidth - ITEMFRAME*2, h - ITEMFRAME*2),
group, Style_Default |
(active ? Style_Enabled : Style_On));
@@ -1421,7 +1421,7 @@ void PhaseStyle::drawControl(ControlElement element,
painter->restore();
}
else { // draw label
- QString text = mi->text();
+ TQString text = mi->text();
if (!text.isNull()) {
int t = text.find('\t');
@@ -1477,7 +1477,7 @@ void PhaseStyle::drawControl(ControlElement element,
if (mi->popup()) { // draw submenu arrow
PrimitiveElement arrow = reverse_ ? PE_ArrowLeft : PE_ArrowRight;
int dim = (h-2*ITEMFRAME) / 2;
- vrect = visualRect(QRect(x + w - ARROWMARGIN - ITEMFRAME - dim,
+ vrect = visualRect(TQRect(x + w - ARROWMARGIN - ITEMFRAME - dim,
y + h / 2 - dim / 2, dim, dim), rect);
drawPrimitive(arrow, painter, vrect, group,
enabled ? Style_Enabled : Style_Default);
@@ -1486,7 +1486,7 @@ void PhaseStyle::drawControl(ControlElement element,
}
case CE_TabBarTab: {
- const QTabBar* tab = ::qt_cast<const QTabBar*>(widget);
+ const TQTabBar* tab = ::qt_cast<const TQTabBar*>(widget);
if (tab) {
if ((widget == hover_) && (option.tab() == hovertab_)) {
flags |= Style_MouseOver;
@@ -1504,12 +1504,12 @@ void PhaseStyle::drawControl(ControlElement element,
case CE_ProgressBarGroove: {
drawPhasePanel(painter, x, y, w, h, group, true,
- &group.brush(QColorGroup::Base));
+ &group.brush(TQColorGroup::Base));
break;
}
case CE_ProgressBarContents: {
- const QProgressBar* pbar = ::qt_cast<const QProgressBar*>(widget);
+ const TQProgressBar* pbar = ::qt_cast<const TQProgressBar*>(widget);
if (!pbar) {
KStyle::drawControl(element, painter, widget, rect, group,
flags, option);
@@ -1517,7 +1517,7 @@ void PhaseStyle::drawControl(ControlElement element,
}
subRect(SR_ProgressBarContents, widget).rect(&x, &y, &w, &h);
- painter->setBrush(group.brush(QColorGroup::Highlight));
+ painter->setBrush(group.brush(TQColorGroup::Highlight));
painter->setPen(group.dark());
if (!pbar->totalSteps()) {
@@ -1539,7 +1539,7 @@ void PhaseStyle::drawControl(ControlElement element,
#if (QT_VERSION >= 0x030200)
case CE_ToolBoxTab: {
- const QToolBox *box = ::qt_cast<const QToolBox*>(widget);
+ const TQToolBox *box = ::qt_cast<const TQToolBox*>(widget);
if (!box) {
KStyle::drawControl(element, painter, widget, rect, group,
flags, option);
@@ -1549,7 +1549,7 @@ void PhaseStyle::drawControl(ControlElement element,
const int rx = x2 - 20;
const int cx = rx - h + 1;
- QPointArray parray(6);
+ TQPointArray parray(6);
parray.putPoints(0, 6,
x-1,y, cx,y, rx-2,y2-2, x2+1,y2-2,
x2+1,y2+2, x-1,y2+2);
@@ -1560,7 +1560,7 @@ void PhaseStyle::drawControl(ControlElement element,
painter->drawConvexPolygon(parray, 0, 6);
painter->setBrush(NoBrush);
} else {
- painter->setClipRegion(parray, QPainter::CoordPainter);
+ painter->setClipRegion(parray, TQPainter::CoordPainter);
drawPhaseGradient(painter, rect,
group.background(),
false, 0, 0, 0, h*2, false);
@@ -1588,10 +1588,10 @@ void PhaseStyle::drawControl(ControlElement element,
// Draw a bitmask for the element
void PhaseStyle::drawControlMask(ControlElement element,
- QPainter *painter,
- const QWidget *widget,
- const QRect &rect,
- const QStyleOption &option) const
+ TQPainter *painter,
+ const TQWidget *widget,
+ const TQRect &rect,
+ const TQStyleOption &option) const
{
switch (element) {
case CE_PushButton:
@@ -1610,26 +1610,26 @@ void PhaseStyle::drawControlMask(ControlElement element,
// Draw a complex control
void PhaseStyle::drawComplexControl(ComplexControl control,
- QPainter *painter,
- const QWidget *widget,
- const QRect &rect,
- const QColorGroup &group,
+ TQPainter *painter,
+ const TQWidget *widget,
+ const TQRect &rect,
+ const TQColorGroup &group,
SFlags flags,
SCFlags controls,
SCFlags active,
- const QStyleOption &option) const
+ const TQStyleOption &option) const
{
bool down = flags & Style_Down;
bool on = flags & Style_On;
bool raised = flags & Style_Raised;
bool sunken = flags & Style_Sunken;
- QRect subrect;
+ TQRect subrect;
int x, y, w, h, x2, y2;
rect.rect(&x, &y, &w, &h);
switch (control) {
case CC_ComboBox: {
- const QComboBox * combo = ::qt_cast<const QComboBox*>(widget);
+ const TQComboBox * combo = ::qt_cast<const TQComboBox*>(widget);
if (!combo) {
KStyle::drawComplexControl(control, painter, widget, rect, group,
flags, controls, active, option);
@@ -1650,8 +1650,8 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
int slot = QMAX(h/4, 6) + (h % 2);
drawPhasePanel(painter, x+3, y+(h/2)-(slot/2), w-6,
slot, group, true,
- sunken ? &group.brush(QColorGroup::Midlight)
- : &group.brush(QColorGroup::Mid));
+ sunken ? &group.brush(TQColorGroup::Midlight)
+ : &group.brush(TQColorGroup::Mid));
}
if (controls & SC_ComboBoxEditField) { // draw edit box
@@ -1670,7 +1670,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
combo), widget);
drawPrimitive(PE_FocusRect, painter, subrect, group,
Style_FocusAtBorder,
- QStyleOption(group.highlight()));
+ TQStyleOption(group.highlight()));
}
}
@@ -1680,14 +1680,14 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
case CC_ScrollBar: {
// always a three button scrollbar
- const QScrollBar *sb = ::qt_cast<const QScrollBar*>(widget);
+ const TQScrollBar *sb = ::qt_cast<const TQScrollBar*>(widget);
if (!sb) {
KStyle::drawComplexControl(control, painter, widget, rect, group,
flags, controls, active, option);
return;
}
- QRect srect;
+ TQRect srect;
bool horizontal = (sb->orientation() == Qt::Horizontal);
SFlags scrollflags = (horizontal ? Style_Horizontal : Style_Default);
@@ -1777,7 +1777,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
}
case CC_SpinWidget: {
- const QSpinWidget *spin = ::qt_cast<const QSpinWidget*>(widget);
+ const TQSpinWidget *spin = ::qt_cast<const TQSpinWidget*>(widget);
if (!spin) {
KStyle::drawComplexControl(control, painter, widget, rect, group,
flags, controls, active, option);
@@ -1809,7 +1809,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
subrect = spin->upRect();
sunken = (active == SC_SpinWidgetUp);
- if (spin->buttonSymbols() == QSpinWidget::PlusMinus)
+ if (spin->buttonSymbols() == TQSpinWidget::PlusMinus)
element = PE_SpinWidgetPlus;
else
element = PE_SpinWidgetUp;
@@ -1824,7 +1824,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
subrect = spin->downRect();
sunken = (active == SC_SpinWidgetDown);
- if (spin->buttonSymbols() == QSpinWidget::PlusMinus)
+ if (spin->buttonSymbols() == TQSpinWidget::PlusMinus)
element = PE_SpinWidgetMinus;
else
element = PE_SpinWidgetDown;
@@ -1837,23 +1837,23 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
}
case CC_ToolButton: {
- const QToolButton *btn = ::qt_cast<const QToolButton*>(widget);
+ const TQToolButton *btn = ::qt_cast<const TQToolButton*>(widget);
if (!btn) {
KStyle::drawComplexControl(control, painter, widget, rect, group,
flags, controls, active, option);
return;
}
- QToolBar *toolbar;
+ TQToolBar *toolbar;
bool horiz = true;
bool normal = !(down || on || raised); // normal button state
x2 = rect.right();
y2 = rect.bottom();
- // check for QToolBar parent
- if (btn->parent() && btn->parent()->inherits("QToolBar")) {
- toolbar = ::qt_cast<QToolBar*>(btn->parent());
+ // check for TQToolBar parent
+ if (btn->parent() && btn->parent()->inherits("TQToolBar")) {
+ toolbar = ::qt_cast<TQToolBar*>(btn->parent());
if (toolbar) {
horiz = (toolbar->orientation() == Qt::Horizontal);
if (normal) { // draw background
@@ -1878,9 +1878,9 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
// check for QToolBarExtensionWidget parent
else if (btn->parent() &&
btn->parent()->inherits(QTOOLBAREXTENSION)) {
- QWidget *extension;
- if ((extension = ::qt_cast<QWidget*>(btn->parent()))) {
- toolbar = ::qt_cast<QToolBar*>(extension->parent());
+ TQWidget *extension;
+ if ((extension = ::qt_cast<TQWidget*>(btn->parent()))) {
+ toolbar = ::qt_cast<TQToolBar*>(extension->parent());
if (toolbar) {
horiz = (toolbar->orientation() == Qt::Horizontal);
if (normal) { // draw background
@@ -1895,7 +1895,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
else if (normal && btn->parentWidget() &&
btn->parentWidget()->backgroundPixmap() &&
!btn->parentWidget()->backgroundPixmap()->isNull()) {
- QPixmap pixmap = *(btn->parentWidget()->backgroundPixmap());
+ TQPixmap pixmap = *(btn->parentWidget()->backgroundPixmap());
painter->drawTiledPixmap(rect, pixmap, btn->pos());
}
// everything else
@@ -1907,7 +1907,7 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
// now draw active buttons
if (down || on) {
drawPhasePanel(painter, x, y, w, h, group, true,
- &group.brush(QColorGroup::Button));
+ &group.brush(TQColorGroup::Button));
} else if (raised) {
drawPhaseBevel(painter, x, y, w, h, group, group.button(),
false, !horiz, true);
@@ -1929,10 +1929,10 @@ void PhaseStyle::drawComplexControl(ComplexControl control,
// Draw a bitmask for the control
void PhaseStyle::drawComplexControlMask(ComplexControl control,
- QPainter *painter,
- const QWidget *widget,
- const QRect &rect,
- const QStyleOption &option) const
+ TQPainter *painter,
+ const TQWidget *widget,
+ const TQRect &rect,
+ const TQStyleOption &option) const
{
switch (control) {
case CC_ComboBox:
@@ -1952,10 +1952,10 @@ void PhaseStyle::drawComplexControlMask(ComplexControl control,
// -------------
// Get the pixel metric for metric
-int PhaseStyle::pixelMetric(PixelMetric metric, const QWidget *widget) const
+int PhaseStyle::pixelMetric(PixelMetric metric, const TQWidget *widget) const
{
// not using widget's font, so that all metrics are uniform
- int em = QMAX(QApplication::fontMetrics().strikeOutPos() * 3, 17);
+ int em = QMAX(TQApplication::fontMetrics().strikeOutPos() * 3, 17);
switch (metric) {
case PM_DefaultFrameWidth:
@@ -1974,8 +1974,8 @@ int PhaseStyle::pixelMetric(PixelMetric metric, const QWidget *widget) const
return 24;
case PM_TabBarTabVSpace:
- if (const QTabBar *tb = ::qt_cast<const QTabBar*>(widget)) {
- if (tb->shape() == QTabBar::RoundedAbove) {
+ if (const TQTabBar *tb = ::qt_cast<const TQTabBar*>(widget)) {
+ if (tb->shape() == TQTabBar::RoundedAbove) {
return 10;
} else {
return 6;
@@ -2011,11 +2011,11 @@ int PhaseStyle::pixelMetric(PixelMetric metric, const QWidget *widget) const
// ---------
// Return subrect for the widget in logical coordinates
-QRect PhaseStyle::subRect(SubRect rect, const QWidget *widget) const
+TQRect PhaseStyle::subRect(SubRect rect, const TQWidget *widget) const
{
switch (rect) {
case SR_ComboBoxFocusRect: {
- QRect r = querySubControlMetrics(CC_ComboBox, widget,
+ TQRect r = querySubControlMetrics(CC_ComboBox, widget,
SC_ComboBoxEditField);
r.addCoords(1, 1,-1,-1);
return r;
@@ -2031,12 +2031,12 @@ QRect PhaseStyle::subRect(SubRect rect, const QWidget *widget) const
// ------------------------
// Get metrics for subcontrols of complex controls
-QRect PhaseStyle::querySubControlMetrics(ComplexControl control,
- const QWidget *widget,
+TQRect PhaseStyle::querySubControlMetrics(ComplexControl control,
+ const TQWidget *widget,
SubControl subcontrol,
- const QStyleOption &option) const
+ const TQStyleOption &option) const
{
- QRect rect;
+ TQRect rect;
const int fw = pixelMetric(PM_DefaultFrameWidth, widget);
int w = widget->width(), h = widget->height();
@@ -2071,7 +2071,7 @@ QRect PhaseStyle::querySubControlMetrics(ComplexControl control,
}
case CC_ScrollBar: {
- const QScrollBar *sb = ::qt_cast<const QScrollBar*>(widget);
+ const TQScrollBar *sb = ::qt_cast<const TQScrollBar*>(widget);
if (!sb) break;
bool horizontal = (sb->orientation() == Qt::Horizontal);
@@ -2130,17 +2130,17 @@ QRect PhaseStyle::querySubControlMetrics(ComplexControl control,
// ------------------
// Returns the size of widget based on the contentsize
-QSize PhaseStyle::sizeFromContents(ContentsType contents,
- const QWidget* widget,
- const QSize &contentsize,
- const QStyleOption &option ) const
+TQSize PhaseStyle::sizeFromContents(ContentsType contents,
+ const TQWidget* widget,
+ const TQSize &contentsize,
+ const TQStyleOption &option ) const
{
int w = contentsize.width();
int h = contentsize.height();
switch (contents) {
case CT_PushButton: {
- const QPushButton* button = ::qt_cast<const QPushButton*>(widget);
+ const TQPushButton* button = ::qt_cast<const TQPushButton*>(widget);
if (!button) {
return KStyle::sizeFromContents(contents, widget, contentsize,
option);
@@ -2156,17 +2156,17 @@ QSize PhaseStyle::sizeFromContents(ContentsType contents,
if (w < 80 && !button->pixmap()) w = 80;
}
if (h < 22) h = 22;
- return QSize(w, h);
+ return TQSize(w, h);
}
case CT_PopupMenuItem: {
if (!widget || option.isDefault()) return contentsize;
- const QPopupMenu *popup = ::qt_cast<const QPopupMenu*>(widget);
+ const TQPopupMenu *popup = ::qt_cast<const TQPopupMenu*>(widget);
if (!popup) {
return KStyle::sizeFromContents(contents, widget, contentsize,
option);
}
- QMenuItem *item = option.menuItem();
+ TQMenuItem *item = option.menuItem();
if (item->custom()) {
w = item->custom()->sizeHint().width();
@@ -2188,7 +2188,7 @@ QSize PhaseStyle::sizeFromContents(ContentsType contents,
}
if (item->iconSet())
h = QMAX(h, item->iconSet()->
- pixmap(QIconSet::Small, QIconSet::Normal).height()
+ pixmap(TQIconSet::Small, TQIconSet::Normal).height()
+ ITEMFRAME*2);
}
@@ -2199,11 +2199,11 @@ QSize PhaseStyle::sizeFromContents(ContentsType contents,
if (option.maxIconWidth() || popup->isCheckable()) {
w += QMAX(option.maxIconWidth(),
- QIconSet::iconSize(QIconSet::Small).width())
+ TQIconSet::iconSize(TQIconSet::Small).width())
+ ITEMHMARGIN*2;
}
w += RIGHTBORDER;
- return QSize(w, h);
+ return TQSize(w, h);
}
default:
@@ -2221,12 +2221,12 @@ QSize PhaseStyle::sizeFromContents(ContentsType contents,
// -------------
// Is the toolbar "flat"
-bool PhaseStyle::flatToolbar(const QToolBar *toolbar) const
+bool PhaseStyle::flatToolbar(const TQToolBar *toolbar) const
{
if (!toolbar) return true; // not on a toolbar
if (!toolbar->isMovingEnabled()) return true; // immobile toolbars are flat
if (!toolbar->area()) return true; // not docked
- if (toolbar->place() == QDockWindow::OutsideDock) return true; // ditto
+ if (toolbar->place() == TQDockWindow::OutsideDock) return true; // ditto
if (!toolbar->mainWindow()) return true; // not in a main window
return false;
}
@@ -2237,42 +2237,42 @@ bool PhaseStyle::flatToolbar(const QToolBar *toolbar) const
// Grab events we are interested in. Most of this routine is to handle the
// exceptions to the normal styling rules.
-bool PhaseStyle::eventFilter(QObject *object, QEvent *event)
+bool PhaseStyle::eventFilter(TQObject *object, TQEvent *event)
{
if (KStyle::eventFilter(object, event)) return true;
if (!object->isWidgetType()) return false;
bool horiz;
int x, y, w, h;
- QFrame *frame;
- QToolBar *toolbar;
- QWidget *widget;
+ TQFrame *frame;
+ TQToolBar *toolbar;
+ TQWidget *widget;
// painting events
- if (event->type() == QEvent::Paint) {
+ if (event->type() == TQEvent::Paint) {
// make sure we do the most specific stuff first
// KDE Toolbar Widget
// patch by Daniel Brownlees <dbrownlees@paradise.net.nz>
if (object->parent() && !qstrcmp(object->name(), KTOOLBARWIDGET)) {
- if (0 == (widget = ::qt_cast<QWidget*>(object))) return false;
- QWidget *parent = ::qt_cast<QWidget*>(object->parent());
+ if (0 == (widget = ::qt_cast<TQWidget*>(object))) return false;
+ TQWidget *parent = ::qt_cast<TQWidget*>(object->parent());
int px = widget->x(), py = widget->y();
// find the toolbar
while (parent && parent->parent()
- && !::qt_cast<QToolBar*>(parent)) {
+ && !::qt_cast<TQToolBar*>(parent)) {
px += parent->x();
py += parent->y();
- parent = ::qt_cast<QWidget*>(parent->parent());
+ parent = ::qt_cast<TQWidget*>(parent->parent());
}
if (!parent) return false;
widget->rect().rect(&x, &y, &w, &h);
- QRect prect = parent->rect();
+ TQRect prect = parent->rect();
- toolbar = ::qt_cast<QToolBar*>(parent);
+ toolbar = ::qt_cast<TQToolBar*>(parent);
horiz = (toolbar) ? (toolbar->orientation() == Qt::Horizontal)
: (prect.height() < prect.width());
- QPainter painter(widget);
+ TQPainter painter(widget);
if (flatToolbar(toolbar)) {
painter.fillRect(widget->rect(),
parent->colorGroup().background());
@@ -2293,10 +2293,10 @@ bool PhaseStyle::eventFilter(QObject *object, QEvent *event)
// QToolBarExtensionWidget
else if (object && object->isWidgetType() && object->parent() &&
- (toolbar = ::qt_cast<QToolBar*>(object->parent()))) {
- if (0 == (widget = ::qt_cast<QWidget*>(object))) return false;
+ (toolbar = ::qt_cast<TQToolBar*>(object->parent()))) {
+ if (0 == (widget = ::qt_cast<TQWidget*>(object))) return false;
horiz = (toolbar->orientation() == Qt::Horizontal);
- QPainter painter(widget);
+ TQPainter painter(widget);
widget->rect().rect(&x, &y, &w, &h);
// draw the extension
drawPhaseGradient(&painter, widget->rect(),
@@ -2323,19 +2323,19 @@ bool PhaseStyle::eventFilter(QObject *object, QEvent *event)
}
}
- // QFrame lines (do this guy last)
- else if (0 != (frame = ::qt_cast<QFrame*>(object))) {
- QFrame::Shape shape = frame->frameShape();
+ // TQFrame lines (do this guy last)
+ else if (0 != (frame = ::qt_cast<TQFrame*>(object))) {
+ TQFrame::Shape shape = frame->frameShape();
switch (shape) {
- case QFrame::HLine:
- case QFrame::VLine: {
+ case TQFrame::HLine:
+ case TQFrame::VLine: {
// NOTE: assuming lines have no content
- QPainter painter(frame);
+ TQPainter painter(frame);
frame->rect().rect(&x, &y, &w, &h);
painter.setPen(frame->colorGroup().dark());
- if (shape == QFrame::HLine) {
+ if (shape == TQFrame::HLine) {
painter.drawLine(0, h/2, w, h/2);
- } else if (shape == QFrame::VLine) {
+ } else if (shape == TQFrame::VLine) {
painter.drawLine(w/2, 0, w/2, h);
}
return true;
@@ -2346,45 +2346,45 @@ bool PhaseStyle::eventFilter(QObject *object, QEvent *event)
}
} else if (highlights_) { // "mouseover" events
- if (::qt_cast<QPushButton*>(object) ||
- ::qt_cast<QComboBox*>(object) ||
- ::qt_cast<QSpinWidget*>(object) ||
- ::qt_cast<QCheckBox*>(object) ||
- ::qt_cast<QRadioButton*>(object) ||
- ::qt_cast<QSlider*>(object) ||
+ if (::qt_cast<TQPushButton*>(object) ||
+ ::qt_cast<TQComboBox*>(object) ||
+ ::qt_cast<TQSpinWidget*>(object) ||
+ ::qt_cast<TQCheckBox*>(object) ||
+ ::qt_cast<TQRadioButton*>(object) ||
+ ::qt_cast<TQSlider*>(object) ||
object->inherits(QSPLITTERHANDLE)) {
- if (event->type() == QEvent::Enter) {
- if (0 != (widget = ::qt_cast<QWidget*>(object)) &&
+ if (event->type() == TQEvent::Enter) {
+ if (0 != (widget = ::qt_cast<TQWidget*>(object)) &&
widget->isEnabled()) {
hover_ = widget;
widget->repaint(false);
}
- } else if (event->type() == QEvent::Leave) {
- if (0 != (widget = ::qt_cast<QWidget*>(object))) {
+ } else if (event->type() == TQEvent::Leave) {
+ if (0 != (widget = ::qt_cast<TQWidget*>(object))) {
hover_ = 0;
widget->repaint(false);
}
}
- } else if (::qt_cast<QTabBar*>(object)) { // special case for qtabbar
- if (event->type() == QEvent::Enter) {
- if (0 != (widget = ::qt_cast<QWidget*>(object)) &&
+ } else if (::qt_cast<TQTabBar*>(object)) { // special case for qtabbar
+ if (event->type() == TQEvent::Enter) {
+ if (0 != (widget = ::qt_cast<TQWidget*>(object)) &&
widget->isEnabled()) {
hover_ = widget;
hovertab_ = 0;;
widget->repaint(false);
}
- } else if (event->type() == QEvent::Leave) {
- if (0 != (widget = ::qt_cast<QWidget*>(object))) {
+ } else if (event->type() == TQEvent::Leave) {
+ if (0 != (widget = ::qt_cast<TQWidget*>(object))) {
hover_ = 0;
hovertab_ = 0;;
widget->repaint(false);
}
- } else if (event->type() == QEvent::MouseMove) {
- QTabBar *tabbar;
- if (0 != (tabbar = ::qt_cast<QTabBar*>(object))) {
- QMouseEvent *me;
- if (0 != (me = dynamic_cast<QMouseEvent*>(event))) {
- QTab *tab = tabbar->selectTab(me->pos());
+ } else if (event->type() == TQEvent::MouseMove) {
+ TQTabBar *tabbar;
+ if (0 != (tabbar = ::qt_cast<TQTabBar*>(object))) {
+ TQMouseEvent *me;
+ if (0 != (me = dynamic_cast<TQMouseEvent*>(event))) {
+ TQTab *tab = tabbar->selectTab(me->pos());
if (hovertab_ != tab) {
hovertab_ = tab;
tabbar->repaint(false);
@@ -2407,7 +2407,7 @@ bool PhaseStyle::eventFilter(QObject *object, QEvent *event)
// -------------
// Constructor
-GradientSet::GradientSet(const QColor &color, int size)
+GradientSet::GradientSet(const TQColor &color, int size)
: color_(color), size_(size)
{
for (int n=0; n<GradientTypeCount; ++n) set[n] = 0;
@@ -2489,18 +2489,18 @@ class PhaseStylePlugin : public QStylePlugin
{
public:
PhaseStylePlugin();
- QStringList keys() const;
- QStyle *create(const QString &key);
+ TQStringList keys() const;
+ TQStyle *create(const TQString &key);
};
-PhaseStylePlugin::PhaseStylePlugin() : QStylePlugin() { ; }
+PhaseStylePlugin::PhaseStylePlugin() : TQStylePlugin() { ; }
-QStringList PhaseStylePlugin::keys() const
+TQStringList PhaseStylePlugin::keys() const
{
- return QStringList() << "Phase";
+ return TQStringList() << "Phase";
}
-QStyle* PhaseStylePlugin::create(const QString& key)
+TQStyle* PhaseStylePlugin::create(const TQString& key)
{
if (key.lower() == "phase")
return new PhaseStyle();
diff --git a/styles/phase/phasestyle.h b/styles/phase/phasestyle.h
index f8d4b7e0..5c44c742 100644
--- a/styles/phase/phasestyle.h
+++ b/styles/phase/phasestyle.h
@@ -28,7 +28,7 @@
#define PHASESTYLE_H
#include <kstyle.h>
-#include <qcolor.h>
+#include <tqcolor.h>
class KPixmap;
@@ -43,14 +43,14 @@ public:
GradientTypeCount
};
- GradientSet(const QColor &color, int size);
+ GradientSet(const TQColor &color, int size);
~GradientSet();
KPixmap* gradient(bool horizontal, bool reverse);
private:
KPixmap *set[GradientTypeCount];
- QColor color_;
+ TQColor color_;
int size_;
};
@@ -61,118 +61,118 @@ public:
PhaseStyle();
virtual ~PhaseStyle();
- void polish(QApplication* app);
- void polish(QWidget *widget);
- void polish(QPalette &pal);
- void unPolish(QWidget *widget);
+ void polish(TQApplication* app);
+ void polish(TQWidget *widget);
+ void polish(TQPalette &pal);
+ void unPolish(TQWidget *widget);
void drawPrimitive(PrimitiveElement element,
- QPainter *painter,
- const QRect &rect,
- const QColorGroup &group,
+ TQPainter *painter,
+ const TQRect &rect,
+ const TQColorGroup &group,
SFlags flags = Style_Default,
- const QStyleOption &option = QStyleOption::Default) const;
+ const TQStyleOption &option = TQStyleOption::Default) const;
void drawKStylePrimitive(KStylePrimitive element,
- QPainter *painter,
- const QWidget *widget,
- const QRect &rect,
- const QColorGroup &group,
+ TQPainter *painter,
+ const TQWidget *widget,
+ const TQRect &rect,
+ const TQColorGroup &group,
SFlags flags = Style_Default,
- const QStyleOption &option = QStyleOption::Default) const;
+ const TQStyleOption &option = TQStyleOption::Default) const;
void drawControl(ControlElement element,
- QPainter *painter,
- const QWidget *widget,
- const QRect &rect,
- const QColorGroup &group,
+ TQPainter *painter,
+ const TQWidget *widget,
+ const TQRect &rect,
+ const TQColorGroup &group,
SFlags flags = Style_Default,
- const QStyleOption &option = QStyleOption::Default) const;
+ const TQStyleOption &option = TQStyleOption::Default) const;
void drawControlMask(ControlElement element,
- QPainter *painter,
- const QWidget *widget,
- const QRect &rect,
- const QStyleOption &option = QStyleOption::Default) const;
+ TQPainter *painter,
+ const TQWidget *widget,
+ const TQRect &rect,
+ const TQStyleOption &option = TQStyleOption::Default) const;
void drawComplexControl(ComplexControl control,
- QPainter *painter,
- const QWidget *widget,
- const QRect &rect,
- const QColorGroup &group,
+ TQPainter *painter,
+ const TQWidget *widget,
+ const TQRect &rect,
+ const TQColorGroup &group,
SFlags flags = Style_Default,
SCFlags controls = SC_All,
SCFlags active = SC_None,
- const QStyleOption &option = QStyleOption::Default) const;
+ const TQStyleOption &option = TQStyleOption::Default) const;
void drawComplexControlMask(ComplexControl control,
- QPainter *painter,
- const QWidget *widget,
- const QRect &rect,
- const QStyleOption &option = QStyleOption::Default) const;
+ TQPainter *painter,
+ const TQWidget *widget,
+ const TQRect &rect,
+ const TQStyleOption &option = TQStyleOption::Default) const;
int pixelMetric(PixelMetric metric,
- const QWidget *widget = 0) const;
+ const TQWidget *widget = 0) const;
- QRect subRect(SubRect rect, const QWidget *widget) const;
+ TQRect subRect(SubRect rect, const TQWidget *widget) const;
- QRect querySubControlMetrics(ComplexControl control,
- const QWidget *widget,
+ TQRect querySubControlMetrics(ComplexControl control,
+ const TQWidget *widget,
SubControl subcontrol,
- const QStyleOption &option = QStyleOption::Default) const;
+ const TQStyleOption &option = TQStyleOption::Default) const;
- QSize sizeFromContents(ContentsType contents,
- const QWidget *widget,
- const QSize &contentsize,
- const QStyleOption& option = QStyleOption::Default) const;
+ TQSize sizeFromContents(ContentsType contents,
+ const TQWidget *widget,
+ const TQSize &contentsize,
+ const TQStyleOption& option = TQStyleOption::Default) const;
private:
PhaseStyle(const PhaseStyle &);
PhaseStyle& operator=(const PhaseStyle &);
- void drawPhaseBevel(QPainter *painter,
+ void drawPhaseBevel(TQPainter *painter,
int x, int y, int w, int h,
- const QColorGroup &group,
- const QColor &fill,
+ const TQColorGroup &group,
+ const TQColor &fill,
bool sunken=false,
bool horizontal=true,
bool reverse=false) const;
- void drawPhaseButton(QPainter *painter,
+ void drawPhaseButton(TQPainter *painter,
int x, int y, int w, int h,
- const QColorGroup &group,
- const QColor &fill,
+ const TQColorGroup &group,
+ const TQColor &fill,
bool sunken=false) const;
- void drawPhasePanel(QPainter *painter,
+ void drawPhasePanel(TQPainter *painter,
int x, int y, int w, int h,
- const QColorGroup &group,
+ const TQColorGroup &group,
bool sunken=false,
- const QBrush *fill=NULL) const;
+ const TQBrush *fill=NULL) const;
- void drawPhaseTab(QPainter *painter,
+ void drawPhaseTab(TQPainter *painter,
int x, int y, int w, int h,
- const QColorGroup &group,
- const QTabBar *bar,
- const QStyleOption &option,
+ const TQColorGroup &group,
+ const TQTabBar *bar,
+ const TQStyleOption &option,
const SFlags flags) const;
- void drawPhaseGradient(QPainter *painter,
- const QRect &rect,
- QColor color,
+ void drawPhaseGradient(TQPainter *painter,
+ const TQRect &rect,
+ TQColor color,
bool horizontal,
int px=0, int py=0,
int pw=-1, int ph=-1,
bool reverse=false) const;
- bool flatToolbar(const QToolBar *toolbar) const;
+ bool flatToolbar(const TQToolBar *toolbar) const;
- bool eventFilter(QObject *object, QEvent *event);
+ bool eventFilter(TQObject *object, TQEvent *event);
private:
- QWidget *hover_;
- QTab *hovertab_;
- QMap<unsigned int, QIntDict<GradientSet> > * gradients;
+ TQWidget *hover_;
+ TQTab *hovertab_;
+ TQMap<unsigned int, TQIntDict<GradientSet> > * gradients;
bool gradients_;
bool highlights_;
bool reverse_;