TQt4 port kwin-style-crystal

This enables compilation under both Qt3 and Qt4


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kwin-style-crystal@1239032 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 13 years ago
parent 424422475d
commit 21a1d3cffb

@ -19,7 +19,7 @@
***************************************************************************/ ***************************************************************************/
#include <qimage.h> #include <tqimage.h>
#include <math.h> #include <math.h>
#include <kimageeffect.h> #include <kimageeffect.h>
@ -29,14 +29,14 @@
ButtonImage::ButtonImage(const QRgb *d_normal,int w,int h) ButtonImage::ButtonImage(const TQRgb *d_normal,int w,int h)
{ {
normal=hovered=pressed=animated=NULL; normal=hovered=pressed=animated=NULL;
image_width=w; image_width=w;
image_height=h; image_height=h;
normal_data=hovered_data=animated_data=pressed_data=NULL; normal_data=hovered_data=animated_data=pressed_data=NULL;
org_normal_data=org_hovered_data=NULL; org_normal_data=org_hovered_data=NULL;
normal_color=hovered_color=pressed_color=QColor(255,255,255); normal_color=hovered_color=pressed_color=TQColor(255,255,255);
reset(); reset();
if (d_normal)SetNormal(d_normal,w,h); if (d_normal)SetNormal(d_normal,w,h);
} }
@ -55,10 +55,10 @@ ButtonImage::~ButtonImage()
if (org_hovered_data)delete[] org_hovered_data; if (org_hovered_data)delete[] org_hovered_data;
} }
QImage ButtonImage::CreateImage(QRgb *data,QColor color) TQImage ButtonImage::CreateImage(TQRgb *data,TQColor color)
{ {
tint(data,color); tint(data,color);
QImage img=QImage((uchar*)data,image_width,image_height,32,NULL,0,QImage::LittleEndian),img2; TQImage img=TQImage((uchar*)data,image_width,image_height,32,NULL,0,TQImage::LittleEndian),img2;
img.setAlphaBuffer(true); img.setAlphaBuffer(true);
return img; return img;
@ -86,7 +86,7 @@ void ButtonImage::reset()
drawMode=0; drawMode=0;
} }
void ButtonImage::SetNormal(const QRgb *d_normal,int w,int h) void ButtonImage::SetNormal(const TQRgb *d_normal,int w,int h)
{ {
image_width=w; image_width=w;
image_height=h; image_height=h;
@ -101,25 +101,25 @@ void ButtonImage::SetNormal(const QRgb *d_normal,int w,int h)
pressed_data=NULL; pressed_data=NULL;
if (normal_data)delete[] normal_data; if (normal_data)delete[] normal_data;
org_normal_data=new QRgb[image_width*image_height]; org_normal_data=new TQRgb[image_width*image_height];
memcpy(org_normal_data,d_normal,sizeof(QRgb)*image_width*image_height); memcpy(org_normal_data,d_normal,sizeof(TQRgb)*image_width*image_height);
normal_data=new QRgb[image_width*image_height]; normal_data=new TQRgb[image_width*image_height];
memcpy(normal_data,d_normal,sizeof(QRgb)*image_width*image_height); memcpy(normal_data,d_normal,sizeof(TQRgb)*image_width*image_height);
normal=new QImage(CreateImage(normal_data,normal_color)); normal=new TQImage(CreateImage(normal_data,normal_color));
} }
void ButtonImage::SetHovered(const QRgb *d_hovered) void ButtonImage::SetHovered(const TQRgb *d_hovered)
{ {
if (hovered)delete hovered; if (hovered)delete hovered;
if (hovered_data)delete[] hovered_data; if (hovered_data)delete[] hovered_data;
if (org_hovered_data)delete[] org_hovered_data; if (org_hovered_data)delete[] org_hovered_data;
if (d_hovered) if (d_hovered)
{ {
org_hovered_data=new QRgb[image_width*image_height]; org_hovered_data=new TQRgb[image_width*image_height];
hovered_data=new QRgb[image_width*image_height]; hovered_data=new TQRgb[image_width*image_height];
memcpy(hovered_data,d_hovered,sizeof(QRgb)*image_width*image_height); memcpy(hovered_data,d_hovered,sizeof(TQRgb)*image_width*image_height);
memcpy(org_hovered_data,d_hovered,sizeof(QRgb)*image_width*image_height); memcpy(org_hovered_data,d_hovered,sizeof(TQRgb)*image_width*image_height);
hovered=new QImage(CreateImage(hovered_data,hovered_color)); hovered=new TQImage(CreateImage(hovered_data,hovered_color));
}else{ }else{
hovered=NULL; hovered=NULL;
hovered_data=NULL; hovered_data=NULL;
@ -127,15 +127,15 @@ void ButtonImage::SetHovered(const QRgb *d_hovered)
} }
} }
void ButtonImage::SetPressed(const QRgb *d_pressed) void ButtonImage::SetPressed(const TQRgb *d_pressed)
{ {
if (pressed)delete pressed; if (pressed)delete pressed;
if (pressed_data)delete[] pressed_data; if (pressed_data)delete[] pressed_data;
if (d_pressed) if (d_pressed)
{ {
pressed_data=new QRgb[image_width*image_height]; pressed_data=new TQRgb[image_width*image_height];
memcpy(pressed_data,d_pressed,sizeof(QRgb)*image_width*image_height); memcpy(pressed_data,d_pressed,sizeof(TQRgb)*image_width*image_height);
pressed=new QImage(CreateImage(pressed_data,pressed_color)); pressed=new TQImage(CreateImage(pressed_data,pressed_color));
}else{ }else{
pressed=NULL; pressed=NULL;
pressed_data=NULL; pressed_data=NULL;
@ -156,22 +156,22 @@ void ButtonImage::finish()
} }
if (!hovered_data){ if (!hovered_data){
hovered_data=new QRgb[image_width*image_height]; hovered_data=new TQRgb[image_width*image_height];
float faktor=::factory->hovereffect?0.5:1.0; float faktor=::factory->hovereffect?0.5:1.0;
for (int i=0;i<image_width*image_height;i++) for (int i=0;i<image_width*image_height;i++)
{ {
hovered_data[i]=qRgba(qRed(org_normal_data[i]),qGreen(org_normal_data[i]),qBlue(org_normal_data[i]), hovered_data[i]=tqRgba(tqRed(org_normal_data[i]),tqGreen(org_normal_data[i]),tqBlue(org_normal_data[i]),
(int)(255.0*pow((float)qAlpha(org_normal_data[i])/255.0,faktor))); (int)(255.0*pow((float)tqAlpha(org_normal_data[i])/255.0,faktor)));
} }
if (org_hovered_data)delete[] org_hovered_data; if (org_hovered_data)delete[] org_hovered_data;
org_hovered_data=new QRgb[image_width*image_height]; org_hovered_data=new TQRgb[image_width*image_height];
memcpy(org_hovered_data,hovered_data,sizeof(QRgb)*image_width*image_height); memcpy(org_hovered_data,hovered_data,sizeof(TQRgb)*image_width*image_height);
hovered=new QImage(CreateImage(hovered_data,hovered_color)); hovered=new TQImage(CreateImage(hovered_data,hovered_color));
} }
if (!pressed_data){ if (!pressed_data){
float faktor=::factory->hovereffect?0.5:0.4; float faktor=::factory->hovereffect?0.5:0.4;
pressed_data=new QRgb[image_width*image_height]; pressed_data=new TQRgb[image_width*image_height];
if (!org_hovered_data) if (!org_hovered_data)
{ {
org_hovered_data=hovered_data; org_hovered_data=hovered_data;
@ -180,37 +180,37 @@ void ButtonImage::finish()
for (int i=0;i<image_width*image_height;i++) for (int i=0;i<image_width*image_height;i++)
{ {
pressed_data[i]=qRgba(qRed(org_hovered_data[i]),qGreen(org_hovered_data[i]),qBlue(org_hovered_data[i]), pressed_data[i]=tqRgba(tqRed(org_hovered_data[i]),tqGreen(org_hovered_data[i]),tqBlue(org_hovered_data[i]),
(int)(255.0*pow((float)qAlpha(org_hovered_data[i])/255.0,faktor))); (int)(255.0*pow((float)tqAlpha(org_hovered_data[i])/255.0,faktor)));
} }
pressed=new QImage(CreateImage(pressed_data,pressed_color)); pressed=new TQImage(CreateImage(pressed_data,pressed_color));
} }
if (!animated_data)animated_data=new QRgb[image_width*image_height]; if (!animated_data)animated_data=new TQRgb[image_width*image_height];
if (!animated) if (!animated)
{ {
animated=new QImage((uchar*)animated_data,image_width,image_height,32,NULL,0,QImage::LittleEndian); animated=new TQImage((uchar*)animated_data,image_width,image_height,32,NULL,0,TQImage::LittleEndian);
animated->setAlphaBuffer(true); animated->setAlphaBuffer(true);
} }
} }
QImage* ButtonImage::getAnimated( float anim) TQImage* ButtonImage::getAnimated( float anim)
{ {
if (!normal_data)return NULL; if (!normal_data)return NULL;
if (!animated_data)return NULL; if (!animated_data)return NULL;
for (int i=0;i<image_width*image_height;i++) for (int i=0;i<image_width*image_height;i++)
{ {
const float r1=(float)qRed(normal_data[i])/255.0f; const float r1=(float)tqRed(normal_data[i])/255.0f;
const float r2=(float)qRed(hovered_data[i])/255.0f; const float r2=(float)tqRed(hovered_data[i])/255.0f;
const float g1=(float)qGreen(normal_data[i])/255.0f; const float g1=(float)tqGreen(normal_data[i])/255.0f;
const float g2=(float)qGreen(hovered_data[i])/255.0f; const float g2=(float)tqGreen(hovered_data[i])/255.0f;
const float b1=(float)qBlue(normal_data[i])/255.0f; const float b1=(float)tqBlue(normal_data[i])/255.0f;
const float b2=(float)qBlue(hovered_data[i])/255.0f; const float b2=(float)tqBlue(hovered_data[i])/255.0f;
const float a1=(float)qAlpha(normal_data[i])/255.0f; const float a1=(float)tqAlpha(normal_data[i])/255.0f;
const float a2=(float)qAlpha(hovered_data[i])/255.0f; const float a2=(float)tqAlpha(hovered_data[i])/255.0f;
animated_data[i]=qRgba( animated_data[i]=tqRgba(
(int)((r1*(1.0f-anim)+r2*anim)*255.0f), (int)((r1*(1.0f-anim)+r2*anim)*255.0f),
(int)((g1*(1.0f-anim)+g2*anim)*255.0f), (int)((g1*(1.0f-anim)+g2*anim)*255.0f),
(int)((b1*(1.0f-anim)+b2*anim)*255.0f), (int)((b1*(1.0f-anim)+b2*anim)*255.0f),
@ -220,25 +220,25 @@ QImage* ButtonImage::getAnimated( float anim)
return animated; return animated;
} }
void ButtonImage::tint(QRgb *data,QColor color) void ButtonImage::tint(TQRgb *data,TQColor color)
{ {
float f_r=(float)color.red()/255.0; float f_r=(float)color.red()/255.0;
float f_g=(float)color.green()/255.0; float f_g=(float)color.green()/255.0;
float f_b=(float)color.blue()/255.0; float f_b=(float)color.blue()/255.0;
for (int i=0;i<image_width*image_height;i++) for (int i=0;i<image_width*image_height;i++)
{ {
float r=(float)qRed(data[i])/255.0; float r=(float)tqRed(data[i])/255.0;
float g=(float)qGreen(data[i])/255.0; float g=(float)tqGreen(data[i])/255.0;
float b=(float)qBlue(data[i])/255.0; float b=(float)tqBlue(data[i])/255.0;
r*=f_r; r*=f_r;
g*=f_g; g*=f_g;
b*=f_b; b*=f_b;
data[i]=qRgba( data[i]=tqRgba(
(int)(r*255.0), (int)(r*255.0),
(int)(g*255.0), (int)(g*255.0),
(int)(b*255.0), (int)(b*255.0),
qAlpha(data[i])); tqAlpha(data[i]));
} }
} }

@ -23,7 +23,7 @@
#ifndef _BUTTON_IMAGE_INCLUDED_ #ifndef _BUTTON_IMAGE_INCLUDED_
#define _BUTTON_IMAGE_INCLUDED_ #define _BUTTON_IMAGE_INCLUDED_
#include <qimage.h> #include <tqimage.h>
#include "crystalclient.h" #include "crystalclient.h"
#define DEFAULT_IMAGE_SIZE 14 #define DEFAULT_IMAGE_SIZE 14
@ -32,35 +32,35 @@
class ButtonImage class ButtonImage
{ {
public: public:
QImage *normal,*hovered,*pressed; TQImage *normal,*hovered,*pressed;
int image_width,image_height; int image_width,image_height;
int hSpace,vSpace; int hSpace,vSpace;
int drawMode; int drawMode;
QColor normal_color,hovered_color,pressed_color; TQColor normal_color,hovered_color,pressed_color;
QImage *animated; TQImage *animated;
QRgb *normal_data,*hovered_data,*animated_data,*pressed_data; TQRgb *normal_data,*hovered_data,*animated_data,*pressed_data;
QRgb *org_normal_data,*org_hovered_data; TQRgb *org_normal_data,*org_hovered_data;
ButtonImage(const QRgb *d_normal=NULL,int w=DEFAULT_IMAGE_SIZE,int h=DEFAULT_IMAGE_SIZE); ButtonImage(const TQRgb *d_normal=NULL,int w=DEFAULT_IMAGE_SIZE,int h=DEFAULT_IMAGE_SIZE);
virtual ~ButtonImage(); virtual ~ButtonImage();
void SetNormal(const QRgb *d_normal,int w=DEFAULT_IMAGE_SIZE,int h=DEFAULT_IMAGE_SIZE); void SetNormal(const TQRgb *d_normal,int w=DEFAULT_IMAGE_SIZE,int h=DEFAULT_IMAGE_SIZE);
void SetHovered(const QRgb *d_hovered=NULL); void SetHovered(const TQRgb *d_hovered=NULL);
void SetPressed(const QRgb *d_pressed=NULL); void SetPressed(const TQRgb *d_pressed=NULL);
void reset(); void reset();
void finish(); void finish();
bool initialized(); bool initialized();
void setSpace(int hS,int vS) { hSpace=hS; vSpace=vS; } void setSpace(int hS,int vS) { hSpace=hS; vSpace=vS; }
void setDrawMode(int dm) { drawMode=dm; } void setDrawMode(int dm) { drawMode=dm; }
void setColors(QColor n,QColor h,QColor p) { normal_color=n; hovered_color=h; pressed_color=p; } void setColors(TQColor n,TQColor h,TQColor p) { normal_color=n; hovered_color=h; pressed_color=p; }
QImage* getAnimated(float anim); TQImage* getAnimated(float anim);
private: private:
QImage CreateImage(QRgb *data,QColor color); TQImage CreateImage(TQRgb *data,TQColor color);
void tint(QRgb *data,QColor color); void tint(TQRgb *data,TQColor color);
}; };
#endif #endif

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>ConfigDialog</class> <class>ConfigDialog</class>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>ConfigDialog</cstring> <cstring>ConfigDialog</cstring>
</property> </property>
@ -22,14 +22,14 @@
<property name="margin"> <property name="margin">
<number>0</number> <number>0</number>
</property> </property>
<widget class="QTabWidget" row="0" column="0"> <widget class="TQTabWidget" row="0" column="0">
<property name="name"> <property name="name">
<cstring>tabWidget2</cstring> <cstring>tabWidget2</cstring>
</property> </property>
<property name="tabShape"> <property name="tabShape">
<enum>Rounded</enum> <enum>Rounded</enum>
</property> </property>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>tab</cstring> <cstring>tab</cstring>
</property> </property>
@ -40,7 +40,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QCheckBox" row="2" column="0" rowspan="1" colspan="2"> <widget class="TQCheckBox" row="2" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>tooltip</cstring> <cstring>tooltip</cstring>
</property> </property>
@ -64,14 +64,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>16</height> <height>16</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QButtonGroup" row="0" column="0"> <widget class="TQButtonGroup" row="0" column="0">
<property name="name"> <property name="name">
<cstring>titlealign</cstring> <cstring>titlealign</cstring>
</property> </property>
@ -90,13 +90,13 @@
<string></string> <string></string>
</property> </property>
<property name="whatsThis" stdset="0"> <property name="whatsThis" stdset="0">
<string>Use these buttons to set the alignment of the window title</string> <string>Use these buttons to set the tqalignment of the window title</string>
</property> </property>
<vbox> <vbox>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>AlignLeft</cstring> <cstring>AlignLeft</cstring>
</property> </property>
@ -110,7 +110,7 @@
<string></string> <string></string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>AlignHCenter</cstring> <cstring>AlignHCenter</cstring>
</property> </property>
@ -127,7 +127,7 @@
<string></string> <string></string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton"> <widget class="TQRadioButton">
<property name="name"> <property name="name">
<cstring>AlignRight</cstring> <cstring>AlignRight</cstring>
</property> </property>
@ -143,9 +143,9 @@
</widget> </widget>
</vbox> </vbox>
</widget> </widget>
<widget class="QButtonGroup" row="0" column="1"> <widget class="TQButtonGroup" row="0" column="1">
<property name="name"> <property name="name">
<cstring>repaintMode</cstring> <cstring>tqrepaintMode</cstring>
</property> </property>
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy> <sizepolicy>
@ -156,13 +156,13 @@
</sizepolicy> </sizepolicy>
</property> </property>
<property name="title"> <property name="title">
<string>Moving &amp;repaints window</string> <string>Moving &amp;tqrepaints window</string>
</property> </property>
<grid> <grid>
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QRadioButton" row="2" column="0" rowspan="1" colspan="2"> <widget class="TQRadioButton" row="2" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>radioButton6</cstring> <cstring>radioButton6</cstring>
</property> </property>
@ -176,7 +176,7 @@
<number>3</number> <number>3</number>
</property> </property>
</widget> </widget>
<widget class="QRadioButton" row="0" column="0" rowspan="1" colspan="2"> <widget class="TQRadioButton" row="0" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>radioButton4</cstring> <cstring>radioButton4</cstring>
</property> </property>
@ -190,7 +190,7 @@
<number>1</number> <number>1</number>
</property> </property>
</widget> </widget>
<widget class="QSpinBox" row="1" column="1"> <widget class="TQSpinBox" row="1" column="1">
<property name="name"> <property name="name">
<cstring>updateTime</cstring> <cstring>updateTime</cstring>
</property> </property>
@ -210,7 +210,7 @@
<number>200</number> <number>200</number>
</property> </property>
</widget> </widget>
<widget class="QRadioButton" row="1" column="0"> <widget class="TQRadioButton" row="1" column="0">
<property name="name"> <property name="name">
<cstring>radioButton5</cstring> <cstring>radioButton5</cstring>
</property> </property>
@ -229,14 +229,14 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="QGroupBox" row="0" column="2" rowspan="1" colspan="2"> <widget class="TQGroupBox" row="0" column="2" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>roundCorners</cstring> <cstring>roundCorners</cstring>
</property> </property>
<property name="title"> <property name="title">
<string>Round &amp;Corners</string> <string>Round &amp;Corners</string>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>AlignHCenter</set> <set>AlignHCenter</set>
</property> </property>
<grid> <grid>
@ -253,14 +253,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QCheckBox" row="0" column="2"> <widget class="TQCheckBox" row="0" column="2">
<property name="name"> <property name="name">
<cstring>trc</cstring> <cstring>trc</cstring>
</property> </property>
@ -279,7 +279,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="2" column="0"> <widget class="TQCheckBox" row="2" column="0">
<property name="name"> <property name="name">
<cstring>blc</cstring> <cstring>blc</cstring>
</property> </property>
@ -305,14 +305,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Preferred</enum> <enum>Preferred</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>10</width> <width>10</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QCheckBox" row="2" column="2"> <widget class="TQCheckBox" row="2" column="2">
<property name="name"> <property name="name">
<cstring>brc</cstring> <cstring>brc</cstring>
</property> </property>
@ -328,7 +328,7 @@
<string></string> <string></string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="0" column="0"> <widget class="TQCheckBox" row="0" column="0">
<property name="name"> <property name="name">
<cstring>tlc</cstring> <cstring>tlc</cstring>
</property> </property>
@ -357,7 +357,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Preferred</enum> <enum>Preferred</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>10</width> <width>10</width>
<height>20</height> <height>20</height>
@ -366,7 +366,7 @@
</spacer> </spacer>
</grid> </grid>
</widget> </widget>
<widget class="QLabel" row="1" column="2"> <widget class="TQLabel" row="1" column="2">
<property name="name"> <property name="name">
<cstring>textLabel2_2</cstring> <cstring>textLabel2_2</cstring>
</property> </property>
@ -385,7 +385,7 @@
<cstring>borderwidth</cstring> <cstring>borderwidth</cstring>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="2" column="2"> <widget class="TQLabel" row="2" column="2">
<property name="name"> <property name="name">
<cstring>textLabel2_2_2</cstring> <cstring>textLabel2_2_2</cstring>
</property> </property>
@ -404,7 +404,7 @@
<cstring>titlebarheight</cstring> <cstring>titlebarheight</cstring>
</property> </property>
</widget> </widget>
<widget class="QSpinBox" row="1" column="3"> <widget class="TQSpinBox" row="1" column="3">
<property name="name"> <property name="name">
<cstring>borderwidth</cstring> <cstring>borderwidth</cstring>
</property> </property>
@ -418,7 +418,7 @@
<string>Width of the borders</string> <string>Width of the borders</string>
</property> </property>
</widget> </widget>
<widget class="QSpinBox" row="2" column="3"> <widget class="TQSpinBox" row="2" column="3">
<property name="name"> <property name="name">
<cstring>titlebarheight</cstring> <cstring>titlebarheight</cstring>
</property> </property>
@ -435,7 +435,7 @@
<string>Height of the title par (independend to border width)</string> <string>Height of the title par (independend to border width)</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="1" column="1"> <widget class="TQCheckBox" row="1" column="1">
<property name="name"> <property name="name">
<cstring>textshadow</cstring> <cstring>textshadow</cstring>
</property> </property>
@ -449,7 +449,7 @@
<string>Draws a nice shadowed title bar text to improve visibility.</string> <string>Draws a nice shadowed title bar text to improve visibility.</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="1" column="0"> <widget class="TQCheckBox" row="1" column="0">
<property name="name"> <property name="name">
<cstring>drawCaption</cstring> <cstring>drawCaption</cstring>
</property> </property>
@ -463,7 +463,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="3" column="0" rowspan="1" colspan="2"> <widget class="TQCheckBox" row="3" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>wheelTask</cstring> <cstring>wheelTask</cstring>
</property> </property>
@ -485,7 +485,7 @@
<string>Wheel on titlebar cycles through visible windows. Does NOT work in compiz. Overrides settings in KDE.</string> <string>Wheel on titlebar cycles through visible windows. Does NOT work in compiz. Overrides settings in KDE.</string>
</property> </property>
</widget> </widget>
<widget class="QPushButton" row="3" column="2" rowspan="1" colspan="2"> <widget class="TQPushButton" row="3" column="2" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>infoButton</cstring> <cstring>infoButton</cstring>
</property> </property>
@ -497,7 +497,7 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="tqminimumSize">
<size> <size>
<width>80</width> <width>80</width>
<height>0</height> <height>0</height>
@ -512,7 +512,7 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>tab</cstring> <cstring>tab</cstring>
</property> </property>
@ -523,7 +523,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QCheckBox" row="1" column="1"> <widget class="TQCheckBox" row="1" column="1">
<property name="name"> <property name="name">
<cstring>animateHover</cstring> <cstring>animateHover</cstring>
</property> </property>
@ -548,7 +548,7 @@
<string>Smoothly animate the hover effect of the buttons</string> <string>Smoothly animate the hover effect of the buttons</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="1" column="0"> <widget class="TQCheckBox" row="1" column="0">
<property name="name"> <property name="name">
<cstring>hover</cstring> <cstring>hover</cstring>
</property> </property>
@ -580,14 +580,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QGroupBox" row="2" column="0" rowspan="1" colspan="2"> <widget class="TQGroupBox" row="2" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>tintButtons</cstring> <cstring>tintButtons</cstring>
</property> </property>
@ -645,7 +645,7 @@
<string>The semi transparent buttons of the titlebar will be shaded in this color</string> <string>The semi transparent buttons of the titlebar will be shaded in this color</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="2" column="0"> <widget class="TQLabel" row="2" column="0">
<property name="name"> <property name="name">
<cstring>textLabel1_3</cstring> <cstring>textLabel1_3</cstring>
</property> </property>
@ -653,7 +653,7 @@
<string>Minimize Button</string> <string>Minimize Button</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="1" column="0"> <widget class="TQLabel" row="1" column="0">
<property name="name"> <property name="name">
<cstring>textLabel5</cstring> <cstring>textLabel5</cstring>
</property> </property>
@ -777,7 +777,7 @@
<string>The semi transparent buttons of the titlebar will be shaded in this color</string> <string>The semi transparent buttons of the titlebar will be shaded in this color</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="0" column="2"> <widget class="TQLabel" row="0" column="2">
<property name="name"> <property name="name">
<cstring>textLabel3</cstring> <cstring>textLabel3</cstring>
</property> </property>
@ -785,7 +785,7 @@
<string>Hovered</string> <string>Hovered</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="0" column="3"> <widget class="TQLabel" row="0" column="3">
<property name="name"> <property name="name">
<cstring>textLabel4_2</cstring> <cstring>textLabel4_2</cstring>
</property> </property>
@ -793,7 +793,7 @@
<string>Pressed</string> <string>Pressed</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="0" column="1"> <widget class="TQLabel" row="0" column="1">
<property name="name"> <property name="name">
<cstring>textLabel2_4</cstring> <cstring>textLabel2_4</cstring>
</property> </property>
@ -888,7 +888,7 @@
<string>The semi transparent buttons of the titlebar will be shaded in this color</string> <string>The semi transparent buttons of the titlebar will be shaded in this color</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="3" column="0"> <widget class="TQLabel" row="3" column="0">
<property name="name"> <property name="name">
<cstring>textLabel1_4</cstring> <cstring>textLabel1_4</cstring>
</property> </property>
@ -925,7 +925,7 @@
<string>The semi transparent buttons of the titlebar will be shaded in this color</string> <string>The semi transparent buttons of the titlebar will be shaded in this color</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="4" column="0"> <widget class="TQLabel" row="4" column="0">
<property name="name"> <property name="name">
<cstring>textLabel1</cstring> <cstring>textLabel1</cstring>
</property> </property>
@ -1022,7 +1022,7 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="QComboBox" row="0" column="0"> <widget class="TQComboBox" row="0" column="0">
<item> <item>
<property name="text"> <property name="text">
<string>Crystal Default</string> <string>Crystal Default</string>
@ -1118,7 +1118,7 @@
<string>Select your favourite button theme here</string> <string>Select your favourite button theme here</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="0" column="1"> <widget class="TQCheckBox" row="0" column="1">
<property name="name"> <property name="name">
<cstring>menuimage</cstring> <cstring>menuimage</cstring>
</property> </property>
@ -1137,7 +1137,7 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>TabPage</cstring> <cstring>TabPage</cstring>
</property> </property>
@ -1148,11 +1148,11 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QTabWidget" row="1" column="0" rowspan="1" colspan="2"> <widget class="TQTabWidget" row="1" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>tabWidget4</cstring> <cstring>tabWidget4</cstring>
</property> </property>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>tab</cstring> <cstring>tab</cstring>
</property> </property>
@ -1163,7 +1163,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QFrame"> <widget class="TQFrame">
<property name="name"> <property name="name">
<cstring>frame3</cstring> <cstring>frame3</cstring>
</property> </property>
@ -1177,7 +1177,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QSpinBox" row="3" column="1"> <widget class="TQSpinBox" row="3" column="1">
<property name="name"> <property name="name">
<cstring>shade1</cstring> <cstring>shade1</cstring>
</property> </property>
@ -1205,7 +1205,7 @@
<string>Amount of effect</string> <string>Amount of effect</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="3" column="0"> <widget class="TQLabel" row="3" column="0">
<property name="name"> <property name="name">
<cstring>textLabel1_2</cstring> <cstring>textLabel1_2</cstring>
</property> </property>
@ -1232,7 +1232,7 @@
<string>The color of the outline frame</string> <string>The color of the outline frame</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2"> <widget class="TQCheckBox" row="0" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>userPicture1</cstring> <cstring>userPicture1</cstring>
</property> </property>
@ -1249,7 +1249,7 @@
<string>Use userdefined picture for background instead of current wallpaper</string> <string>Use userdefined picture for background instead of current wallpaper</string>
</property> </property>
</widget> </widget>
<widget class="QComboBox" row="1" column="0" rowspan="1" colspan="2"> <widget class="TQComboBox" row="1" column="0" rowspan="1" colspan="2">
<item> <item>
<property name="text"> <property name="text">
<string>Fade</string> <string>Fade</string>
@ -1300,14 +1300,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>16</height> <height>16</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QComboBox" row="4" column="0"> <widget class="TQComboBox" row="4" column="0">
<item> <item>
<property name="text"> <property name="text">
<string>No outline</string> <string>No outline</string>
@ -1337,7 +1337,7 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="QFrame"> <widget class="TQFrame">
<property name="name"> <property name="name">
<cstring>frame4</cstring> <cstring>frame4</cstring>
</property> </property>
@ -1351,7 +1351,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel" row="2" column="0"> <widget class="TQLabel" row="2" column="0">
<property name="name"> <property name="name">
<cstring>textLabel1_5</cstring> <cstring>textLabel1_5</cstring>
</property> </property>
@ -1359,7 +1359,7 @@
<string>Blur Image:</string> <string>Blur Image:</string>
</property> </property>
</widget> </widget>
<widget class="QSpinBox" row="2" column="1"> <widget class="TQSpinBox" row="2" column="1">
<property name="name"> <property name="name">
<cstring>active_blur</cstring> <cstring>active_blur</cstring>
</property> </property>
@ -1391,7 +1391,7 @@
<string>The color of the inline frame</string> <string>The color of the inline frame</string>
</property> </property>
</widget> </widget>
<widget class="QComboBox" row="3" column="0"> <widget class="TQComboBox" row="3" column="0">
<item> <item>
<property name="text"> <property name="text">
<string>No inline</string> <string>No inline</string>
@ -1429,7 +1429,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>50</height> <height>50</height>
@ -1448,7 +1448,7 @@
</widget> </widget>
</hbox> </hbox>
</widget> </widget>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>tab</cstring> <cstring>tab</cstring>
</property> </property>
@ -1459,7 +1459,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QFrame"> <widget class="TQFrame">
<property name="name"> <property name="name">
<cstring>frame3_2</cstring> <cstring>frame3_2</cstring>
</property> </property>
@ -1473,7 +1473,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QComboBox" row="1" column="0" rowspan="1" colspan="2"> <widget class="TQComboBox" row="1" column="0" rowspan="1" colspan="2">
<item> <item>
<property name="text"> <property name="text">
<string>Fade</string> <string>Fade</string>
@ -1533,7 +1533,7 @@
<string>The color of the outline frame</string> <string>The color of the outline frame</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="0" column="0" rowspan="1" colspan="2"> <widget class="TQCheckBox" row="0" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>userPicture2</cstring> <cstring>userPicture2</cstring>
</property> </property>
@ -1550,7 +1550,7 @@
<string>Use userdefined picture for background instead of current wallpaper</string> <string>Use userdefined picture for background instead of current wallpaper</string>
</property> </property>
</widget> </widget>
<widget class="QSpinBox" row="3" column="1"> <widget class="TQSpinBox" row="3" column="1">
<property name="name"> <property name="name">
<cstring>shade2</cstring> <cstring>shade2</cstring>
</property> </property>
@ -1588,14 +1588,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>16</height> <height>16</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QComboBox" row="4" column="0"> <widget class="TQComboBox" row="4" column="0">
<item> <item>
<property name="text"> <property name="text">
<string>No outline</string> <string>No outline</string>
@ -1623,7 +1623,7 @@
<string>Draw outline frame</string> <string>Draw outline frame</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="3" column="0"> <widget class="TQLabel" row="3" column="0">
<property name="name"> <property name="name">
<cstring>textLabel1_2_3</cstring> <cstring>textLabel1_2_3</cstring>
</property> </property>
@ -1633,7 +1633,7 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="QFrame"> <widget class="TQFrame">
<property name="name"> <property name="name">
<cstring>frame4_2</cstring> <cstring>frame4_2</cstring>
</property> </property>
@ -1647,7 +1647,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel" row="2" column="0"> <widget class="TQLabel" row="2" column="0">
<property name="name"> <property name="name">
<cstring>textLabel1_5_2</cstring> <cstring>textLabel1_5_2</cstring>
</property> </property>
@ -1655,7 +1655,7 @@
<string>Blur Image:</string> <string>Blur Image:</string>
</property> </property>
</widget> </widget>
<widget class="QSpinBox" row="2" column="1"> <widget class="TQSpinBox" row="2" column="1">
<property name="name"> <property name="name">
<cstring>inactive_blur</cstring> <cstring>inactive_blur</cstring>
</property> </property>
@ -1697,14 +1697,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QComboBox" row="3" column="0"> <widget class="TQComboBox" row="3" column="0">
<item> <item>
<property name="text"> <property name="text">
<string>No inline</string> <string>No inline</string>
@ -1745,7 +1745,7 @@
</hbox> </hbox>
</widget> </widget>
</widget> </widget>
<widget class="QCheckBox" row="0" column="1"> <widget class="TQCheckBox" row="0" column="1">
<property name="name"> <property name="name">
<cstring>trackdesktop</cstring> <cstring>trackdesktop</cstring>
</property> </property>
@ -1770,7 +1770,7 @@
<string>Check, if you have different wallpapers set on multiple desktops. Uncheck, when you just have one wallpaper for all desktops.</string> <string>Check, if you have different wallpapers set on multiple desktops. Uncheck, when you just have one wallpaper for all desktops.</string>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="0" column="0"> <widget class="TQCheckBox" row="0" column="0">
<property name="name"> <property name="name">
<cstring>enableTransparency</cstring> <cstring>enableTransparency</cstring>
</property> </property>
@ -1800,7 +1800,7 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>TabPage</cstring> <cstring>TabPage</cstring>
</property> </property>
@ -1811,7 +1811,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QButtonGroup" row="0" column="0" rowspan="2" colspan="2"> <widget class="TQButtonGroup" row="0" column="0" rowspan="2" colspan="2">
<property name="name"> <property name="name">
<cstring>logoEnabled</cstring> <cstring>logoEnabled</cstring>
</property> </property>
@ -1836,7 +1836,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QRadioButton" row="0" column="0"> <widget class="TQRadioButton" row="0" column="0">
<property name="name"> <property name="name">
<cstring>radioButton13</cstring> <cstring>radioButton13</cstring>
</property> </property>
@ -1853,7 +1853,7 @@
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="QRadioButton" row="0" column="1"> <widget class="TQRadioButton" row="0" column="1">
<property name="name"> <property name="name">
<cstring>radioButton14_3</cstring> <cstring>radioButton14_3</cstring>
</property> </property>
@ -1864,7 +1864,7 @@
<string></string> <string></string>
</property> </property>
</widget> </widget>
<widget class="QRadioButton" row="0" column="2"> <widget class="TQRadioButton" row="0" column="2">
<property name="name"> <property name="name">
<cstring>radioButton15</cstring> <cstring>radioButton15</cstring>
</property> </property>
@ -1877,7 +1877,7 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="QLabel" row="2" column="0"> <widget class="TQLabel" row="2" column="0">
<property name="name"> <property name="name">
<cstring>logoPreview</cstring> <cstring>logoPreview</cstring>
</property> </property>
@ -1889,13 +1889,13 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="tqminimumSize">
<size> <size>
<width>30</width> <width>30</width>
<height>30</height> <height>30</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="tqmaximumSize">
<size> <size>
<width>30</width> <width>30</width>
<height>30</height> <height>30</height>
@ -1914,7 +1914,7 @@
<string>Little preview</string> <string>Little preview</string>
</property> </property>
</widget> </widget>
<widget class="QComboBox" row="2" column="3"> <widget class="TQComboBox" row="2" column="3">
<item> <item>
<property name="text"> <property name="text">
<string>Stretch</string> <string>Stretch</string>
@ -1939,7 +1939,7 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>30</height> <height>30</height>
@ -1959,7 +1959,7 @@
</sizepolicy> </sizepolicy>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="0" column="2"> <widget class="TQLabel" row="0" column="2">
<property name="name"> <property name="name">
<cstring>textLabel1_6</cstring> <cstring>textLabel1_6</cstring>
</property> </property>
@ -1975,7 +1975,7 @@
<string>Distance to the text:</string> <string>Distance to the text:</string>
</property> </property>
</widget> </widget>
<widget class="QSpinBox" row="0" column="3"> <widget class="TQSpinBox" row="0" column="3">
<property name="name"> <property name="name">
<cstring>logoDistance</cstring> <cstring>logoDistance</cstring>
</property> </property>
@ -1997,7 +1997,7 @@
<number>5</number> <number>5</number>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" row="1" column="2" rowspan="1" colspan="2"> <widget class="TQCheckBox" row="1" column="2" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>logoActive</cstring> <cstring>logoActive</cstring>
</property> </property>
@ -2021,7 +2021,7 @@
</widget> </widget>
</grid> </grid>
</widget> </widget>
<widget class="QWidget"> <widget class="TQWidget">
<property name="name"> <property name="name">
<cstring>TabPage</cstring> <cstring>TabPage</cstring>
</property> </property>
@ -2032,7 +2032,7 @@
<property name="name"> <property name="name">
<cstring>unnamed</cstring> <cstring>unnamed</cstring>
</property> </property>
<widget class="QLabel" row="0" column="0" rowspan="1" colspan="2"> <widget class="TQLabel" row="0" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>textLabel2</cstring> <cstring>textLabel2</cstring>
</property> </property>
@ -2047,11 +2047,11 @@
<property name="text"> <property name="text">
<string>Lets you put an transparent image on top of the title bar.</string> <string>Lets you put an transparent image on top of the title bar.</string>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>AlignCenter</set> <set>AlignCenter</set>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="4" column="0" rowspan="1" colspan="2"> <widget class="TQLabel" row="4" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>textLabel4</cstring> <cstring>textLabel4</cstring>
</property> </property>
@ -2066,7 +2066,7 @@
<property name="text"> <property name="text">
<string>User defined should be a transparent png file, i.e. 1x64px</string> <string>User defined should be a transparent png file, i.e. 1x64px</string>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>AlignCenter</set> <set>AlignCenter</set>
</property> </property>
</widget> </widget>
@ -2080,14 +2080,14 @@
<property name="sizeType"> <property name="sizeType">
<enum>Expanding</enum> <enum>Expanding</enum>
</property> </property>
<property name="sizeHint"> <property name="tqsizeHint">
<size> <size>
<width>20</width> <width>20</width>
<height>40</height> <height>40</height>
</size> </size>
</property> </property>
</spacer> </spacer>
<widget class="QLabel" row="1" column="0"> <widget class="TQLabel" row="1" column="0">
<property name="name"> <property name="name">
<cstring>textLabel1_7</cstring> <cstring>textLabel1_7</cstring>
</property> </property>
@ -2095,7 +2095,7 @@
<string>Overlay for active window:</string> <string>Overlay for active window:</string>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="1" column="1"> <widget class="TQLabel" row="1" column="1">
<property name="name"> <property name="name">
<cstring>textLabel1_7_2</cstring> <cstring>textLabel1_7_2</cstring>
</property> </property>
@ -2103,7 +2103,7 @@
<string>Overlay for inactive window:</string> <string>Overlay for inactive window:</string>
</property> </property>
</widget> </widget>
<widget class="QComboBox" row="2" column="0"> <widget class="TQComboBox" row="2" column="0">
<item> <item>
<property name="text"> <property name="text">
<string>Disabled</string> <string>Disabled</string>
@ -2149,7 +2149,7 @@
<bool>false</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
<widget class="QComboBox" row="2" column="1"> <widget class="TQComboBox" row="2" column="1">
<item> <item>
<property name="text"> <property name="text">
<string>Disabled</string> <string>Disabled</string>
@ -2256,7 +2256,7 @@
<connection> <connection>
<sender>enableTransparency</sender> <sender>enableTransparency</sender>
<signal>toggled(bool)</signal> <signal>toggled(bool)</signal>
<receiver>repaintMode</receiver> <receiver>tqrepaintMode</receiver>
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
</connection> </connection>
<connection> <connection>
@ -2380,7 +2380,7 @@
<slot>setEnabled(bool)</slot> <slot>setEnabled(bool)</slot>
</connection> </connection>
</connections> </connections>
<layoutdefaults spacing="6" margin="5"/> <tqlayoutdefaults spacing="6" margin="5"/>
<includehints> <includehints>
<includehint>kcolorbutton.h</includehint> <includehint>kcolorbutton.h</includehint>
<includehint>kcolorbutton.h</includehint> <includehint>kcolorbutton.h</includehint>

@ -21,22 +21,22 @@
#include <kconfig.h> #include <kconfig.h>
#include <klocale.h> #include <klocale.h>
#include <kglobal.h> #include <kglobal.h>
#include <qbuttongroup.h> #include <tqbuttongroup.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qgroupbox.h> #include <tqgroupbox.h>
#include <qbuttongroup.h> #include <tqbuttongroup.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qradiobutton.h> #include <tqradiobutton.h>
#include <qwhatsthis.h> #include <tqwhatsthis.h>
#include <qspinbox.h> #include <tqspinbox.h>
#include <qcheckbox.h> #include <tqcheckbox.h>
#include <qcombobox.h> #include <tqcombobox.h>
#include <qwidgetstack.h> #include <tqwidgetstack.h>
#include <qlineedit.h> #include <tqlineedit.h>
#include <qfiledialog.h> #include <tqfiledialog.h>
#include <kcolorbutton.h> #include <kcolorbutton.h>
#include <kfiledialog.h> #include <kfiledialog.h>
#include <qpicture.h> #include <tqpicture.h>
#include <kapplication.h> #include <kapplication.h>
#include <kurlrequester.h> #include <kurlrequester.h>
@ -45,94 +45,94 @@
#include "crystalconfig.h" #include "crystalconfig.h"
CrystalConfig::CrystalConfig(KConfig*, QWidget* parent) CrystalConfig::CrystalConfig(KConfig*, TQWidget* tqparent)
: QObject(parent), config_(0), dialog_(0) : TQObject(tqparent), config_(0), dialog_(0)
{ {
config_ = new KConfig("kwincrystalrc"); config_ = new KConfig("kwincrystalrc");
dialog_ = new ConfigDialog(parent); dialog_ = new ConfigDialog(tqparent);
dialog_->show(); dialog_->show();
connect(dialog_->titlealign, SIGNAL(clicked(int)),this, SLOT(selectionChanged(int))); connect(dialog_->titlealign, TQT_SIGNAL(clicked(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->drawCaption, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); connect(dialog_->drawCaption, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int)));
connect(dialog_->textshadow, SIGNAL(stateChanged(int)),this, SLOT(selectionChanged(int))); connect(dialog_->textshadow, TQT_SIGNAL(stateChanged(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->tooltip,SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); connect(dialog_->tooltip,TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int)));
connect(dialog_->wheelTask,SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); connect(dialog_->wheelTask,TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int)));
connect(dialog_->trackdesktop, SIGNAL(stateChanged(int)),this, SLOT(selectionChanged(int))); connect(dialog_->trackdesktop, TQT_SIGNAL(stateChanged(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->shade1, SIGNAL(valueChanged(int)),this, SLOT(selectionChanged(int))); connect(dialog_->shade1, TQT_SIGNAL(valueChanged(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->shade2, SIGNAL(valueChanged(int)),this, SLOT(selectionChanged(int))); connect(dialog_->shade2, TQT_SIGNAL(valueChanged(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->frame1, SIGNAL(activated(int)),this, SLOT(selectionChanged(int))); connect(dialog_->frame1, TQT_SIGNAL(activated(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->frame2, SIGNAL(activated(int)),this, SLOT(selectionChanged(int))); connect(dialog_->frame2, TQT_SIGNAL(activated(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->frameColor1, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); connect(dialog_->frameColor1, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&)));
connect(dialog_->frameColor2, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); connect(dialog_->frameColor2, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&)));
connect(dialog_->inline1, SIGNAL(activated(int)),this, SLOT(selectionChanged(int))); connect(dialog_->inline1, TQT_SIGNAL(activated(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->inline2, SIGNAL(activated(int)),this, SLOT(selectionChanged(int))); connect(dialog_->inline2, TQT_SIGNAL(activated(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->inlineColor1, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); connect(dialog_->inlineColor1, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&)));
connect(dialog_->inlineColor2, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); connect(dialog_->inlineColor2, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&)));
connect(dialog_->type1,SIGNAL(activated(int)),this,SLOT(selectionChanged(int))); connect(dialog_->type1,TQT_SIGNAL(activated(int)),this,TQT_SLOT(selectionChanged(int)));
connect(dialog_->type2,SIGNAL(activated(int)),this,SLOT(selectionChanged(int))); connect(dialog_->type2,TQT_SIGNAL(activated(int)),this,TQT_SLOT(selectionChanged(int)));
connect(dialog_->enableTransparency,SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); connect(dialog_->enableTransparency,TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int)));
connect(dialog_->borderwidth, SIGNAL(valueChanged(int)),this, SLOT(selectionChanged(int))); connect(dialog_->borderwidth, TQT_SIGNAL(valueChanged(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->titlebarheight, SIGNAL(valueChanged(int)),this, SLOT(selectionChanged(int))); connect(dialog_->titlebarheight, TQT_SIGNAL(valueChanged(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->tlc, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); connect(dialog_->tlc, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int)));
connect(dialog_->trc, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); connect(dialog_->trc, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int)));
connect(dialog_->blc, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); connect(dialog_->blc, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int)));
connect(dialog_->brc, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); connect(dialog_->brc, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int)));
connect(dialog_->buttonColor1, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); connect(dialog_->buttonColor1, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&)));
connect(dialog_->buttonColor2, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); connect(dialog_->buttonColor2, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&)));
connect(dialog_->buttonColor3, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); connect(dialog_->buttonColor3, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&)));
connect(dialog_->minColor1, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); connect(dialog_->minColor1, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&)));
connect(dialog_->minColor2, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); connect(dialog_->minColor2, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&)));
connect(dialog_->minColor3, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); connect(dialog_->minColor3, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&)));
connect(dialog_->maxColor1, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); connect(dialog_->maxColor1, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&)));
connect(dialog_->maxColor2, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); connect(dialog_->maxColor2, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&)));
connect(dialog_->maxColor3, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); connect(dialog_->maxColor3, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&)));
connect(dialog_->closeColor1, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); connect(dialog_->closeColor1, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&)));
connect(dialog_->closeColor2, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); connect(dialog_->closeColor2, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&)));
connect(dialog_->closeColor3, SIGNAL(changed(const QColor&)),this,SLOT(colorChanged(const QColor&))); connect(dialog_->closeColor3, TQT_SIGNAL(changed(const TQColor&)),this,TQT_SLOT(colorChanged(const TQColor&)));
connect(dialog_->hover, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); connect(dialog_->hover, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int)));
connect(dialog_->animateHover, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); connect(dialog_->animateHover, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int)));
connect(dialog_->buttonTheme, SIGNAL(activated(int)),this,SLOT(selectionChanged(int))); connect(dialog_->buttonTheme, TQT_SIGNAL(activated(int)),this,TQT_SLOT(selectionChanged(int)));
connect(dialog_->tintButtons, SIGNAL(toggled(bool)),this,SLOT(boolChanged(bool))); connect(dialog_->tintButtons, TQT_SIGNAL(toggled(bool)),this,TQT_SLOT(boolChanged(bool)));
connect(dialog_->menuimage, SIGNAL(stateChanged(int)),this,SLOT(selectionChanged(int))); connect(dialog_->menuimage, TQT_SIGNAL(stateChanged(int)),this,TQT_SLOT(selectionChanged(int)));
connect(dialog_->repaintMode, SIGNAL(clicked(int)),this, SLOT(selectionChanged(int))); connect(dialog_->tqrepaintMode, TQT_SIGNAL(clicked(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->updateTime, SIGNAL(valueChanged(int)),this, SLOT(selectionChanged(int))); connect(dialog_->updateTime, TQT_SIGNAL(valueChanged(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->infoButton, SIGNAL(clicked(void)),this,SLOT(infoDialog(void))); connect(dialog_->infoButton, TQT_SIGNAL(clicked(void)),this,TQT_SLOT(infoDialog(void)));
connect(dialog_->active_blur, SIGNAL(valueChanged(int)),this,SLOT(selectionChanged(int))); connect(dialog_->active_blur, TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(selectionChanged(int)));
connect(dialog_->inactive_blur, SIGNAL(valueChanged(int)),this,SLOT(selectionChanged(int))); connect(dialog_->inactive_blur, TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(selectionChanged(int)));
connect(dialog_->userPicture1, SIGNAL(stateChanged(int)),this, SLOT(selectionChanged(int))); connect(dialog_->userPicture1, TQT_SIGNAL(stateChanged(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->userPicture2, SIGNAL(stateChanged(int)),this, SLOT(selectionChanged(int))); connect(dialog_->userPicture2, TQT_SIGNAL(stateChanged(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->activeFile,SIGNAL(textChanged(const QString&)),this,SLOT(textChanged( const QString& ))); connect(dialog_->activeFile,TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SLOT(textChanged( const TQString& )));
connect(dialog_->inactiveFile,SIGNAL(textChanged(const QString&)),this,SLOT(textChanged( const QString& ))); connect(dialog_->inactiveFile,TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SLOT(textChanged( const TQString& )));
connect(dialog_->overlay_active, SIGNAL(activated(int)),this, SLOT(overlay_active_changed(int))); connect(dialog_->overlay_active, TQT_SIGNAL(activated(int)),this, TQT_SLOT(overlay_active_changed(int)));
connect(dialog_->overlay_inactive, SIGNAL(activated(int)),this, SLOT(overlay_inactive_changed(int))); connect(dialog_->overlay_inactive, TQT_SIGNAL(activated(int)),this, TQT_SLOT(overlay_inactive_changed(int)));
connect(dialog_->overlay_active_file,SIGNAL(textChanged(const QString&)),this,SLOT(textChanged(const QString &))); connect(dialog_->overlay_active_file,TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SLOT(textChanged(const TQString &)));
connect(dialog_->overlay_inactive_file,SIGNAL(textChanged(const QString&)),this,SLOT(textChanged(const QString &))); connect(dialog_->overlay_inactive_file,TQT_SIGNAL(textChanged(const TQString&)),this,TQT_SLOT(textChanged(const TQString &)));
connect(dialog_->logoEnabled, SIGNAL(clicked(int)),this, SLOT(selectionChanged(int))); connect(dialog_->logoEnabled, TQT_SIGNAL(clicked(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->logoFile, SIGNAL(textChanged(const QString &)),this, SLOT(logoTextChanged(const QString&))); connect(dialog_->logoFile, TQT_SIGNAL(textChanged(const TQString &)),this, TQT_SLOT(logoTextChanged(const TQString&)));
connect(dialog_->logoStretch, SIGNAL(activated(int)),this, SLOT(selectionChanged(int))); connect(dialog_->logoStretch, TQT_SIGNAL(activated(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->logoActive, SIGNAL(stateChanged(int)),this, SLOT(selectionChanged(int))); connect(dialog_->logoActive, TQT_SIGNAL(stateChanged(int)),this, TQT_SLOT(selectionChanged(int)));
connect(dialog_->logoDistance,SIGNAL(valueChanged(int)),this,SLOT(selectionChanged(int))); connect(dialog_->logoDistance,TQT_SIGNAL(valueChanged(int)),this,TQT_SLOT(selectionChanged(int)));
load(config_); load(config_);
} }
@ -150,12 +150,12 @@ void CrystalConfig::selectionChanged(int)
void CrystalConfig::load(KConfig*) void CrystalConfig::load(KConfig*)
{ {
QColor color(255,255,255); TQColor color(255,255,255);
config_->setGroup("General"); config_->setGroup("General");
QString value = config_->readEntry("TitleAlignment", "AlignHCenter"); TQString value = config_->readEntry("TitleAlignment", "AlignHCenter");
QRadioButton *button = (QRadioButton*)dialog_->titlealign->child(value); TQRadioButton *button = (TQRadioButton*)dialog_->titlealign->child(value);
if (button) button->setChecked(true); if (button) button->setChecked(true);
dialog_->drawCaption->setChecked(config_->readBoolEntry("DrawCaption",true)); dialog_->drawCaption->setChecked(config_->readBoolEntry("DrawCaption",true));
@ -167,17 +167,17 @@ void CrystalConfig::load(KConfig*)
dialog_->trackdesktop->setChecked(config_->readBoolEntry("TrackDesktop",false)); dialog_->trackdesktop->setChecked(config_->readBoolEntry("TrackDesktop",false));
dialog_->frame1->setCurrentItem(config_->readNumEntry("ActiveFrame",1)); dialog_->frame1->setCurrentItem(config_->readNumEntry("ActiveFrame",1));
color=QColor(192,192,192); color=TQColor(192,192,192);
dialog_->frameColor1->setColor(config_->readColorEntry("FrameColor1",&color)); dialog_->frameColor1->setColor(config_->readColorEntry("FrameColor1",&color));
dialog_->frame2->setCurrentItem(config_->readNumEntry("InactiveFrame",1)); dialog_->frame2->setCurrentItem(config_->readNumEntry("InactiveFrame",1));
color=QColor(192,192,192); color=TQColor(192,192,192);
dialog_->frameColor2->setColor(config_->readColorEntry("FrameColor2",&color)); dialog_->frameColor2->setColor(config_->readColorEntry("FrameColor2",&color));
dialog_->inline1->setCurrentItem(config_->readNumEntry("ActiveInline",0)); dialog_->inline1->setCurrentItem(config_->readNumEntry("ActiveInline",0));
color=QColor(192,192,192); color=TQColor(192,192,192);
dialog_->inlineColor1->setColor(config_->readColorEntry("InlineColor1",&color)); dialog_->inlineColor1->setColor(config_->readColorEntry("InlineColor1",&color));
dialog_->inline2->setCurrentItem(config_->readNumEntry("InactiveInline",0)); dialog_->inline2->setCurrentItem(config_->readNumEntry("InactiveInline",0));
color=QColor(192,192,192); color=TQColor(192,192,192);
dialog_->inlineColor2->setColor(config_->readColorEntry("InlineColor2",&color)); dialog_->inlineColor2->setColor(config_->readColorEntry("InlineColor2",&color));
@ -203,7 +203,7 @@ void CrystalConfig::load(KConfig*)
dialog_->animateHover->setChecked(config_->readBoolEntry("AnimateHover",true)); dialog_->animateHover->setChecked(config_->readBoolEntry("AnimateHover",true));
dialog_->menuimage->setChecked(config_->readBoolEntry("MenuImage",true)); dialog_->menuimage->setChecked(config_->readBoolEntry("MenuImage",true));
color=QColor(255,255,255); color=TQColor(255,255,255);
dialog_->buttonColor1->setColor(config_->readColorEntry("ButtonColor",&color)); dialog_->buttonColor1->setColor(config_->readColorEntry("ButtonColor",&color));
dialog_->buttonColor2->setColor(config_->readColorEntry("ButtonColor2",&color)); dialog_->buttonColor2->setColor(config_->readColorEntry("ButtonColor2",&color));
dialog_->buttonColor3->setColor(config_->readColorEntry("ButtonColor3",&color)); dialog_->buttonColor3->setColor(config_->readColorEntry("ButtonColor3",&color));
@ -217,12 +217,12 @@ void CrystalConfig::load(KConfig*)
dialog_->closeColor2->setColor(config_->readColorEntry("CloseColor2",&color)); dialog_->closeColor2->setColor(config_->readColorEntry("CloseColor2",&color));
dialog_->closeColor3->setColor(config_->readColorEntry("CloseColor3",&color)); dialog_->closeColor3->setColor(config_->readColorEntry("CloseColor3",&color));
dialog_->tintButtons->setChecked(config_->readBoolEntry("TintButtons",dialog_->buttonColor1->color()!=QColor(255,255,255))); dialog_->tintButtons->setChecked(config_->readBoolEntry("TintButtons",dialog_->buttonColor1->color()!=TQColor(255,255,255)));
dialog_->buttonTheme->setCurrentItem(config_->readNumEntry("ButtonTheme",8)); dialog_->buttonTheme->setCurrentItem(config_->readNumEntry("ButtonTheme",8));
dialog_->updateTime->setValue(config_->readNumEntry("RepaintTime",200)); dialog_->updateTime->setValue(config_->readNumEntry("RepaintTime",200));
button=(QRadioButton*)dialog_->repaintMode->find(config_->readNumEntry("RepaintMode",1)); button=(TQRadioButton*)dialog_->tqrepaintMode->tqfind(config_->readNumEntry("RepaintMode",1));
if (button)button->setChecked(true); if (button)button->setChecked(true);
dialog_->active_blur->setValue(config_->readNumEntry("ActiveBlur",0)); dialog_->active_blur->setValue(config_->readNumEntry("ActiveBlur",0));
@ -255,8 +255,8 @@ void CrystalConfig::save(KConfig*)
{ {
config_->setGroup("General"); config_->setGroup("General");
QRadioButton *button = (QRadioButton*)dialog_->titlealign->selected(); TQRadioButton *button = (TQRadioButton*)dialog_->titlealign->selected();
if (button) config_->writeEntry("TitleAlignment", QString(button->name())); if (button) config_->writeEntry("TitleAlignment", TQString(button->name()));
config_->writeEntry("DrawCaption",dialog_->drawCaption->isChecked()); config_->writeEntry("DrawCaption",dialog_->drawCaption->isChecked());
config_->writeEntry("TextShadow",dialog_->textshadow->isChecked()); config_->writeEntry("TextShadow",dialog_->textshadow->isChecked());
config_->writeEntry("CaptionTooltip",dialog_->tooltip->isChecked()); config_->writeEntry("CaptionTooltip",dialog_->tooltip->isChecked());
@ -308,7 +308,7 @@ void CrystalConfig::save(KConfig*)
config_->writeEntry("MenuImage",dialog_->menuimage->isChecked()); config_->writeEntry("MenuImage",dialog_->menuimage->isChecked());
config_->writeEntry("ButtonTheme",dialog_->buttonTheme->currentItem()); config_->writeEntry("ButtonTheme",dialog_->buttonTheme->currentItem());
config_->writeEntry("RepaintMode",dialog_->repaintMode->selectedId()); config_->writeEntry("RepaintMode",dialog_->tqrepaintMode->selectedId());
config_->writeEntry("RepaintTime",dialog_->updateTime->value()); config_->writeEntry("RepaintTime",dialog_->updateTime->value());
config_->writeEntry("ActiveBlur",dialog_->active_blur->value()); config_->writeEntry("ActiveBlur",dialog_->active_blur->value());
@ -336,11 +336,11 @@ void CrystalConfig::save(KConfig*)
void CrystalConfig::infoDialog() void CrystalConfig::infoDialog()
{ {
InfoDialog d(dialog_); InfoDialog d(dialog_);
connect((QLabel*)(d.kURLLabel1),SIGNAL(leftClickedURL(const QString&)),KApplication::kApplication(),SLOT(invokeBrowser(const QString &))); connect((TQLabel*)(d.kURLLabel1),TQT_SIGNAL(leftClickedURL(const TQString&)),KApplication::kApplication(),TQT_SLOT(invokeBrowser(const TQString &)));
d.exec(); d.exec();
} }
void CrystalConfig::logoTextChanged(const QString&) void CrystalConfig::logoTextChanged(const TQString&)
{ {
updateLogo(); updateLogo();
emit changed(); emit changed();
@ -360,15 +360,15 @@ void CrystalConfig::overlay_inactive_changed(int a)
void CrystalConfig::updateLogo() void CrystalConfig::updateLogo()
{ {
QPixmap pic; TQPixmap pic;
pic.load(dialog_->logoFile->url()); pic.load(dialog_->logoFile->url());
dialog_->logoPreview->setPixmap(pic); dialog_->logoPreview->setPixmap(pic);
} }
void CrystalConfig::defaults() void CrystalConfig::defaults()
{ {
QRadioButton *button = TQRadioButton *button =
(QRadioButton*)dialog_->titlealign->child("AlignHCenter"); (TQRadioButton*)dialog_->titlealign->child("AlignHCenter");
if (button) button->setChecked(true); if (button) button->setChecked(true);
dialog_->shade1->setValue(50); dialog_->shade1->setValue(50);
dialog_->shade2->setValue(50); dialog_->shade2->setValue(50);
@ -376,8 +376,8 @@ void CrystalConfig::defaults()
extern "C" extern "C"
{ {
QObject* allocate_config(KConfig* config, QWidget* parent) { TQObject* allocate_config(KConfig* config, TQWidget* tqparent) {
return (new CrystalConfig(config, parent)); return (new CrystalConfig(config, tqparent));
} }
} }

@ -22,7 +22,7 @@
#ifndef CRYSTALCONFIG_H #ifndef CRYSTALCONFIG_H
#define CRYSTALCONFIG_H #define CRYSTALCONFIG_H
#include <qobject.h> #include <tqobject.h>
#define TOP_LEFT 1 #define TOP_LEFT 1
#define TOP_RIGHT 2 #define TOP_RIGHT 2
@ -32,11 +32,12 @@
class KConfig; class KConfig;
class ConfigDialog; class ConfigDialog;
class CrystalConfig : public QObject class CrystalConfig : public TQObject
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
CrystalConfig(KConfig* config, QWidget* parent); CrystalConfig(KConfig* config, TQWidget* tqparent);
~CrystalConfig(); ~CrystalConfig();
signals: signals:
@ -53,9 +54,9 @@ protected slots:
void overlay_active_changed(int); void overlay_active_changed(int);
void overlay_inactive_changed(int); void overlay_inactive_changed(int);
void boolChanged(bool) { selectionChanged(0); } void boolChanged(bool) { selectionChanged(0); }
void colorChanged(const QColor&) { selectionChanged(0); } void colorChanged(const TQColor&) { selectionChanged(0); }
void textChanged(const QString&) { selectionChanged(0); } void textChanged(const TQString&) { selectionChanged(0); }
void logoTextChanged(const QString&); void logoTextChanged(const TQString&);
private: private:
KConfig *config_; KConfig *config_;

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1"> <!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>InfoDialog</class> <class>InfoDialog</class>
<widget class="QDialog"> <widget class="TQDialog">
<property name="name"> <property name="name">
<cstring>InfoDialog</cstring> <cstring>InfoDialog</cstring>
</property> </property>
@ -39,7 +39,7 @@
<property name="resizeMode"> <property name="resizeMode">
<enum>Minimum</enum> <enum>Minimum</enum>
</property> </property>
<widget class="QGroupBox" row="0" column="0" rowspan="2" colspan="2"> <widget class="TQGroupBox" row="0" column="0" rowspan="2" colspan="2">
<property name="name"> <property name="name">
<cstring>groupBox3</cstring> <cstring>groupBox3</cstring>
</property> </property>
@ -54,13 +54,13 @@
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="tqminimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="tqmaximumSize">
<size> <size>
<width>32767</width> <width>32767</width>
<height>20</height> <height>20</height>
@ -78,14 +78,14 @@
<property name="title"> <property name="title">
<string>About:</string> <string>About:</string>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>AlignCenter</set> <set>AlignCenter</set>
</property> </property>
<property name="flat"> <property name="flat">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="2" column="0"> <widget class="TQLabel" row="2" column="0">
<property name="name"> <property name="name">
<cstring>textLabel1</cstring> <cstring>textLabel1</cstring>
</property> </property>
@ -109,11 +109,11 @@ You may look for the most recent version at kde-look.org:</string>
<property name="textFormat"> <property name="textFormat">
<enum>PlainText</enum> <enum>PlainText</enum>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>AlignTop|AlignLeft</set> <set>AlignTop|AlignLeft</set>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="1" column="1" rowspan="2" colspan="1"> <widget class="TQLabel" row="1" column="1" rowspan="2" colspan="1">
<property name="name"> <property name="name">
<cstring>pixmapLabel2</cstring> <cstring>pixmapLabel2</cstring>
</property> </property>
@ -143,7 +143,7 @@ You may look for the most recent version at kde-look.org:</string>
<string>http://www.kde-look.org/content/show.php?content=13969</string> <string>http://www.kde-look.org/content/show.php?content=13969</string>
</property> </property>
</widget> </widget>
<widget class="QGroupBox" row="4" column="0" rowspan="1" colspan="2"> <widget class="TQGroupBox" row="4" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>groupBox3_2</cstring> <cstring>groupBox3_2</cstring>
</property> </property>
@ -158,13 +158,13 @@ You may look for the most recent version at kde-look.org:</string>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="minimumSize"> <property name="tqminimumSize">
<size> <size>
<width>0</width> <width>0</width>
<height>20</height> <height>20</height>
</size> </size>
</property> </property>
<property name="maximumSize"> <property name="tqmaximumSize">
<size> <size>
<width>32767</width> <width>32767</width>
<height>20</height> <height>20</height>
@ -182,14 +182,14 @@ You may look for the most recent version at kde-look.org:</string>
<property name="title"> <property name="title">
<string>Usage:</string> <string>Usage:</string>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>AlignCenter</set> <set>AlignCenter</set>
</property> </property>
<property name="flat"> <property name="flat">
<bool>true</bool> <bool>true</bool>
</property> </property>
</widget> </widget>
<widget class="QLabel" row="5" column="0" rowspan="1" colspan="2"> <widget class="TQLabel" row="5" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>textLabel1_2</cstring> <cstring>textLabel1_2</cstring>
</property> </property>
@ -216,7 +216,7 @@ You may look for the most recent version at kde-look.org:</string>
<property name="textFormat"> <property name="textFormat">
<enum>PlainText</enum> <enum>PlainText</enum>
</property> </property>
<property name="alignment"> <property name="tqalignment">
<set>AlignVCenter|AlignLeft</set> <set>AlignVCenter|AlignLeft</set>
</property> </property>
</widget> </widget>
@ -234,7 +234,7 @@ You may look for the most recent version at kde-look.org:</string>
<enum>Horizontal</enum> <enum>Horizontal</enum>
</property> </property>
</widget> </widget>
<widget class="QPushButton" row="7" column="0" rowspan="1" colspan="2"> <widget class="TQPushButton" row="7" column="0" rowspan="1" colspan="2">
<property name="name"> <property name="name">
<cstring>pushButton1</cstring> <cstring>pushButton1</cstring>
</property> </property>
@ -274,10 +274,10 @@ You may look for the most recent version at kde-look.org:</string>
<slot>close()</slot> <slot>close()</slot>
</connection> </connection>
</connections> </connections>
<slots> <Q_SLOTS>
<slot>kURLLabel1_leftURL()</slot> <slot>kURLLabel1_leftURL()</slot>
</slots> </Q_SLOTS>
<layoutdefaults spacing="6" margin="11"/> <tqlayoutdefaults spacing="6" margin="11"/>
<includehints> <includehints>
<includehint>kurllabel.h</includehint> <includehint>kurllabel.h</includehint>
</includehints> </includehints>

@ -19,9 +19,9 @@
***************************************************************************/ ***************************************************************************/
#include <qimage.h> #include <tqimage.h>
#include <qtooltip.h> #include <tqtooltip.h>
#include <qpainter.h> #include <tqpainter.h>
#include "crystalclient.h" #include "crystalclient.h"
#include "crystalbutton.h" #include "crystalbutton.h"
@ -29,10 +29,10 @@
#include "imageholder.h" #include "imageholder.h"
CrystalButton::CrystalButton(CrystalClient *parent, const char *name, CrystalButton::CrystalButton(CrystalClient *tqparent, const char *name,
const QString& tip, ButtonType type, const TQString& tip, ButtonType type,
ButtonImage *vimage) ButtonImage *vimage)
: QButton(parent->widget(), name), client_(parent), type_(type), image(vimage), lastmouse_(0) : TQButton(tqparent->widget(), name), client_(tqparent), type_(type), image(vimage), lastmouse_(0)
{ {
setBackgroundMode(NoBackground); setBackgroundMode(NoBackground);
resetSize(false); resetSize(false);
@ -40,8 +40,8 @@ CrystalButton::CrystalButton(CrystalClient *parent, const char *name,
hover=first=last=false; hover=first=last=false;
animation=0.0; animation=0.0;
QToolTip::add(this, tip); TQToolTip::add(this, tip);
connect ( &animation_timer,SIGNAL(timeout()),this,SLOT(animate())); connect ( &animation_timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(animate()));
} }
CrystalButton::~CrystalButton() CrystalButton::~CrystalButton()
@ -59,12 +59,12 @@ void CrystalButton::resetSize(bool FullSize)
void CrystalButton::setBitmap(ButtonImage *newimage) void CrystalButton::setBitmap(ButtonImage *newimage)
{ {
image=newimage; image=newimage;
repaint(false); tqrepaint(false);
} }
QSize CrystalButton::sizeHint() const TQSize CrystalButton::tqsizeHint() const
{ {
return QSize(buttonSizeH(),buttonSizeV()); return TQSize(buttonSizeH(),buttonSizeV());
} }
int CrystalButton::buttonSizeH() const int CrystalButton::buttonSizeH() const
@ -85,105 +85,105 @@ int CrystalButton::buttonSizeV() const
return (factory->titlesize-1-vS>h)?h:factory->titlesize-1-vS; return (factory->titlesize-1-vS>h)?h:factory->titlesize-1-vS;
} }
void CrystalButton::enterEvent(QEvent *e) void CrystalButton::enterEvent(TQEvent *e)
{ {
hover=true; hover=true;
if (factory->hovereffect)repaint(false); if (factory->hovereffect)tqrepaint(false);
if (factory->animateHover)animation_timer.start(60); if (factory->animateHover)animation_timer.start(60);
QButton::enterEvent(e); TQButton::enterEvent(e);
} }
void CrystalButton::leaveEvent(QEvent *e) void CrystalButton::leaveEvent(TQEvent *e)
{ {
hover=false; hover=false;
if (factory->hovereffect)repaint(false); if (factory->hovereffect)tqrepaint(false);
if (factory->animateHover)animation_timer.start(80); if (factory->animateHover)animation_timer.start(80);
QButton::leaveEvent(e); TQButton::leaveEvent(e);
} }
void CrystalButton::mousePressEvent(QMouseEvent* e) void CrystalButton::mousePressEvent(TQMouseEvent* e)
{ {
lastmouse_ = e->button(); lastmouse_ = e->button();
int button; int button;
switch(e->button()) switch(e->button())
{ {
case LeftButton: case Qt::LeftButton:
button=LeftButton; button=Qt::LeftButton;
break; break;
case RightButton: case Qt::RightButton:
if ((type_ == ButtonMax) || (type_ == ButtonMin) || (type_ == ButtonMenu) || (type_ == ButtonClose)) if ((type_ == ButtonMax) || (type_ == ButtonMin) || (type_ == ButtonMenu) || (type_ == ButtonClose))
button=LeftButton; else button=NoButton; button=Qt::LeftButton; else button=Qt::NoButton;
break; break;
case MidButton: case Qt::MidButton:
if ((type_ == ButtonMax) || (type_ == ButtonMin)) if ((type_ == ButtonMax) || (type_ == ButtonMin))
button=LeftButton; else button=NoButton; button=Qt::LeftButton; else button=Qt::NoButton;
break; break;
default:button=NoButton; default:button=Qt::NoButton;
break; break;
} }
QMouseEvent me(e->type(), e->pos(), e->globalPos(),button, e->state()); TQMouseEvent me(e->type(), e->pos(), e->globalPos(),button, e->state());
QButton::mousePressEvent(&me); TQButton::mousePressEvent(&me);
} }
void CrystalButton::mouseReleaseEvent(QMouseEvent* e) void CrystalButton::mouseReleaseEvent(TQMouseEvent* e)
{ {
lastmouse_ = e->button(); lastmouse_ = e->button();
int button; int button;
switch(e->button()) switch(e->button())
{ {
case LeftButton: case Qt::LeftButton:
button=LeftButton; button=Qt::LeftButton;
break; break;
case RightButton: case Qt::RightButton:
if ((type_ == ButtonMax) || (type_ == ButtonMin) || (type_ == ButtonMenu) || (type_==ButtonClose)) if ((type_ == ButtonMax) || (type_ == ButtonMin) || (type_ == ButtonMenu) || (type_==ButtonClose))
button=LeftButton; else button=NoButton; button=Qt::LeftButton; else button=Qt::NoButton;
break; break;
case MidButton: case Qt::MidButton:
if ((type_ == ButtonMax) || (type_ == ButtonMin)) if ((type_ == ButtonMax) || (type_ == ButtonMin))
button=LeftButton; else button=NoButton; button=Qt::LeftButton; else button=Qt::NoButton;
break; break;
default:button=NoButton; default:button=Qt::NoButton;
break; break;
} }
QMouseEvent me(e->type(), e->pos(), e->globalPos(), button, e->state()); TQMouseEvent me(e->type(), e->pos(), e->globalPos(), button, e->state());
QButton::mouseReleaseEvent(&me); TQButton::mouseReleaseEvent(&me);
} }
void CrystalButton::drawButton(QPainter *painter) void CrystalButton::drawButton(TQPainter *painter)
{ {
if (!CrystalFactory::initialized()) return; if (!CrystalFactory::initialized()) return;
QColorGroup group; TQColorGroup group;
float dx, dy; float dx, dy;
int dm=0; int dm=0;
QPixmap pufferPixmap; TQPixmap pufferPixmap;
pufferPixmap.resize(width(), height()); pufferPixmap.resize(width(), height());
QPainter pufferPainter(&pufferPixmap); TQPainter pufferPainter(&pufferPixmap);
CrystalFactory *f=((CrystalFactory*)client_->factory()); CrystalFactory *f=((CrystalFactory*)client_->factory());
QPixmap *background; TQPixmap *background;
if (f->transparency)background=f->image_holder->image(client_->isActive()); if (f->transparency)background=f->image_holder->image(client_->isActive());
else background=NULL; else background=NULL;
WND_CONFIG *wndcfg=client_->isActive()?&f->active:&f->inactive; WND_CONFIG *wndcfg=client_->isActive()?&f->active:&f->inactive;
if (background && !background->isNull()) if (background && !background->isNull())
{ {
QRect r=rect(); TQRect r=rect();
QPoint p=mapToGlobal(QPoint(0,0)); TQPoint p=mapToGlobal(TQPoint(0,0));
r.moveBy(p.x(),p.y()); r.moveBy(p.x(),p.y());
pufferPainter.drawPixmap(QPoint(0,0),*background,r); pufferPainter.drawPixmap(TQPoint(0,0),*background,r);
}else{ }else{
group = client_->options()->colorGroup(KDecoration::ColorTitleBar, client_->isActive()); group = client_->options()->tqcolorGroup(KDecoration::ColorTitleBar, client_->isActive());
pufferPainter.fillRect(rect(), group.background()); pufferPainter.fillRect(rect(), group.background());
} }
if (!wndcfg->overlay.isNull()) if (!wndcfg->overlay.isNull())
{ {
pufferPainter.drawTiledPixmap(rect(),wndcfg->overlay,QPoint(x(),y())); pufferPainter.drawTiledPixmap(rect(),wndcfg->overlay,TQPoint(x(),y()));
} }
dm=0; dm=0;
@ -228,21 +228,21 @@ void CrystalButton::drawButton(QPainter *painter)
if (dx<1 || dy<=1) if (dx<1 || dy<=1)
{ {
int m=(rect().width()-2<rect().height())?rect().width()-2:rect().height(); int m=(rect().width()-2<rect().height())?rect().width()-2:rect().height();
QRect r((rect().width()-m)/2,(rect().height()-m)/2,m,m); TQRect r((rect().width()-m)/2,(rect().height()-m)/2,m,m);
// if (isDown()) { r.moveBy(1,1); } // if (isDown()) { r.moveBy(1,1); }
pufferPainter.drawPixmap(r, client_->icon().pixmap(QIconSet::Small, pufferPainter.drawPixmap(r, client_->icon().pixmap(TQIconSet::Small,
QIconSet::Normal)); TQIconSet::Normal));
}else{ }else{
// if (isDown()) { dx++; dy++; } // if (isDown()) { dx++; dy++; }
pufferPainter.drawPixmap((int)dx, (int)dy, client_->icon().pixmap(QIconSet::Small, pufferPainter.drawPixmap((int)dx, (int)dy, client_->icon().pixmap(TQIconSet::Small,
QIconSet::Normal)); TQIconSet::Normal));
} }
} else if (image && image->initialized()) { } else if (image && image->initialized()) {
// otherwise we paint the deco // otherwise we paint the deco
dx = float(width() - image->image_width) / 2.0; dx = float(width() - image->image_width) / 2.0;
dy = float(height() - image->image_height) / 2.0; dy = float(height() - image->image_height) / 2.0;
QImage *img=image->normal; TQImage *img=image->normal;
if (::factory->hovereffect) if (::factory->hovereffect)
{ {
@ -274,17 +274,17 @@ void CrystalButton::drawButton(QPainter *painter)
w=(int)((float)h*(float)image->image_width/(float)image->image_height); w=(int)((float)h*(float)image->image_width/(float)image->image_height);
} }
QRect r((rect().width()-w)/2,(rect().height()-h)/2,w,h); TQRect r((rect().width()-w)/2,(rect().height()-h)/2,w,h);
pufferPainter.drawImage(r,*img); pufferPainter.drawImage(r,*img);
if (type_ == ButtonMenu) drawMenuImage(&pufferPainter, r); if (type_ == ButtonMenu) drawMenuImage(&pufferPainter, r);
}else{ }else{
// Otherwise we just paint it // Otherwise we just paint it
if (image->drawMode==1)dy=0; if (image->drawMode==1)dy=0;
pufferPainter.drawImage(QPoint((int)dx,(int)dy),*img); pufferPainter.drawImage(TQPoint((int)dx,(int)dy),*img);
if (type_ == ButtonMenu) drawMenuImage(&pufferPainter, if (type_ == ButtonMenu) drawMenuImage(&pufferPainter,
QRect((int)dx,(int)dy,image->image_width,image->image_height)); TQRect((int)dx,(int)dy,image->image_width,image->image_height));
} }
} }
@ -292,7 +292,7 @@ void CrystalButton::drawButton(QPainter *painter)
painter->drawPixmap(0,0, pufferPixmap); painter->drawPixmap(0,0, pufferPixmap);
} }
void CrystalButton::drawMenuImage(QPainter* painter, QRect r) void CrystalButton::drawMenuImage(TQPainter* painter, TQRect r)
{ {
if (type_ != ButtonMenu) return; if (type_ != ButtonMenu) return;
// we paint the mini icon (which is 16 pixels high) // we paint the mini icon (which is 16 pixels high)
@ -304,12 +304,12 @@ void CrystalButton::drawMenuImage(QPainter* painter, QRect r)
if (dx<1 || dy<=1) if (dx<1 || dy<=1)
{ {
int m=(r.width()-2<r.height())?r.width()-2:r.height(); int m=(r.width()-2<r.height())?r.width()-2:r.height();
QRect r2(r.left()+(r.width()-m)/2,r.top()+(r.height()-m)/2,m,m); TQRect r2(r.left()+(r.width()-m)/2,r.top()+(r.height()-m)/2,m,m);
painter->drawPixmap(r2, client_->icon().pixmap(QIconSet::Small, painter->drawPixmap(r2, client_->icon().pixmap(TQIconSet::Small,
QIconSet::Normal)); TQIconSet::Normal));
}else{ }else{
painter->drawPixmap(r.left()+(int)dx, r.top()+(int)dy, client_->icon().pixmap(QIconSet::Small, painter->drawPixmap(r.left()+(int)dx, r.top()+(int)dy, client_->icon().pixmap(TQIconSet::Small,
QIconSet::Normal)); TQIconSet::Normal));
} }
} }
@ -331,7 +331,7 @@ void CrystalButton::animate()
animation_timer.stop(); animation_timer.stop();
} }
} }
repaint(false); tqrepaint(false);
} }
#include "crystalbutton.moc" #include "crystalbutton.moc"

@ -23,35 +23,36 @@
#ifndef _CRYSTALBUTTON_INCLUDED_ #ifndef _CRYSTALBUTTON_INCLUDED_
#define _CRYSTALBUTTON_INCLUDED_ #define _CRYSTALBUTTON_INCLUDED_
#include <qbutton.h> #include <tqbutton.h>
class CrystalClient; class CrystalClient;
class ButtonImage; class ButtonImage;
class CrystalButton : public QButton class CrystalButton : public TQButton
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
CrystalButton(CrystalClient *parent=0, const char *name=0, CrystalButton(CrystalClient *tqparent=0, const char *name=0,
const QString &tip=NULL, const TQString &tip=NULL,
ButtonType type=ButtonHelp, ButtonType type=ButtonHelp,
ButtonImage *vimage=NULL); ButtonImage *vimage=NULL);
virtual ~CrystalButton(); virtual ~CrystalButton();
void setBitmap(ButtonImage *newimage); void setBitmap(ButtonImage *newimage);
QSize sizeHint() const; TQSize tqsizeHint() const;
int lastMousePress() const { return lastmouse_; } int lastMousePress() const { return lastmouse_; }
void reset() { repaint(false); } void reset() { tqrepaint(false); }
void setFirstLast(bool vfirst,bool vlast) { first|=vfirst; last|=vlast; } void setFirstLast(bool vfirst,bool vlast) { first|=vfirst; last|=vlast; }
void resetSize(bool FullSize); void resetSize(bool FullSize);
private: private:
void enterEvent(QEvent *e); void enterEvent(TQEvent *e);
void leaveEvent(QEvent *e); void leaveEvent(TQEvent *e);
void mousePressEvent(QMouseEvent *e); void mousePressEvent(TQMouseEvent *e);
void mouseReleaseEvent(QMouseEvent *e); void mouseReleaseEvent(TQMouseEvent *e);
void drawButton(QPainter *painter); void drawButton(TQPainter *painter);
void drawMenuImage(QPainter *painter, QRect r); void drawMenuImage(TQPainter *painter, TQRect r);
int buttonSizeH() const; int buttonSizeH() const;
int buttonSizeV() const; int buttonSizeV() const;
@ -60,7 +61,7 @@ private slots:
void animate(); void animate();
private: private:
QTimer animation_timer; TQTimer animation_timer;
bool first,last; bool first,last;
bool hover; bool hover;
float animation; float animation;

@ -25,13 +25,13 @@
#include <klocale.h> #include <klocale.h>
#include <kdebug.h> #include <kdebug.h>
#include <qbitmap.h> #include <tqbitmap.h>
#include <qlabel.h> #include <tqlabel.h>
#include <qpainter.h> #include <tqpainter.h>
#include <qtooltip.h> #include <tqtooltip.h>
#include <qapplication.h> #include <tqapplication.h>
#include <qimage.h> #include <tqimage.h>
#include <qpopupmenu.h> #include <tqpopupmenu.h>
#include <kwin.h> #include <kwin.h>
#include <kprocess.h> #include <kprocess.h>
@ -48,7 +48,7 @@
CrystalFactory* factory=NULL; CrystalFactory* factory=NULL;
bool CrystalFactory::initialized_ = false; bool CrystalFactory::initialized_ = false;
Qt::AlignmentFlags CrystalFactory::titlealign_ = Qt::AlignHCenter; TQt::AlignmentFlags CrystalFactory::titlealign_ = TQt::AlignHCenter;
extern "C" KDecorationFactory* create_factory() extern "C" KDecorationFactory* create_factory()
@ -60,17 +60,17 @@ extern "C" KDecorationFactory* create_factory()
/***************** /*****************
* Tooltip class for the titlebar * Tooltip class for the titlebar
**/ **/
class CCrystalTooltip:public QToolTip class CCrystalTooltip:public TQToolTip
{ {
private: private:
CrystalClient *client; CrystalClient *client;
public: public:
CCrystalTooltip(QWidget *widget,CrystalClient *vc):QToolTip(widget),client(vc) {} CCrystalTooltip(TQWidget *widget,CrystalClient *vc):TQToolTip(widget),client(vc) {}
virtual void maybeTip(const QPoint& p) virtual void maybeTip(const TQPoint& p)
{ {
if (client->titlebar_->geometry().contains(p)) if (client->titlebar_->tqgeometry().tqcontains(p))
{ {
tip(client->titlebar_->geometry(),client->caption()); tip(client->titlebar_->tqgeometry(),client->caption());
} }
} }
}; };
@ -87,7 +87,7 @@ CrystalFactory::CrystalFactory()
readConfig(); readConfig();
initialized_ = true; initialized_ = true;
if (transparency)image_holder=new QImageHolder(active.userdefinedPicture,inactive.userdefinedPicture); if (transparency)image_holder=new TQImageHolder(active.userdefinedPicture,inactive.userdefinedPicture);
else image_holder=NULL; else image_holder=NULL;
CreateButtonImages(); CreateButtonImages();
} }
@ -117,9 +117,9 @@ bool CrystalFactory::reset(unsigned long /*changed*/)
if (transparency) if (transparency)
{ {
if (!image_holder)image_holder=new QImageHolder(active.userdefinedPicture,inactive.userdefinedPicture); if (!image_holder)image_holder=new TQImageHolder(active.userdefinedPicture,inactive.userdefinedPicture);
image_holder->setUserdefinedPictures(active.userdefinedPicture,inactive.userdefinedPicture); image_holder->setUserdefinedPictures(active.userdefinedPicture,inactive.userdefinedPicture);
image_holder->repaint(true); image_holder->tqrepaint(true);
}else{ }else{
if (image_holder)delete image_holder; if (image_holder)delete image_holder;
image_holder=NULL; image_holder=NULL;
@ -141,7 +141,7 @@ bool CrystalFactory::supports(Ability ability)
} }
} }
void setupOverlay(WND_CONFIG *cfg,int mode,QString filename) void setupOverlay(WND_CONFIG *cfg,int mode,TQString filename)
{ {
cfg->overlay.resize(0,0); cfg->overlay.resize(0,0);
switch(mode) switch(mode)
@ -149,27 +149,27 @@ void setupOverlay(WND_CONFIG *cfg,int mode,QString filename)
case 0: break; case 0: break;
case 1:{ case 1:{
cfg->overlay.resize(0,0); cfg->overlay.resize(0,0);
QImage img=QImage((uchar*)lighting_overlay_data,1,60,32,NULL,0,QImage::LittleEndian); TQImage img=TQImage((uchar*)lighting_overlay_data,1,60,32,NULL,0,TQImage::LittleEndian);
img.setAlphaBuffer(true); img.setAlphaBuffer(true);
cfg->overlay.convertFromImage(img.smoothScale(256,::factory->titlesize)); cfg->overlay.convertFromImage(img.smoothScale(256,::factory->titlesize));
break; break;
} }
case 2:{ case 2:{
cfg->overlay.resize(0,0); cfg->overlay.resize(0,0);
QImage img=QImage((uchar*)glass_overlay_data,20,64,32,NULL,0,QImage::LittleEndian); TQImage img=TQImage((uchar*)glass_overlay_data,20,64,32,NULL,0,TQImage::LittleEndian);
img.setAlphaBuffer(true); img.setAlphaBuffer(true);
cfg->overlay.convertFromImage(img.smoothScale(256,::factory->titlesize)); cfg->overlay.convertFromImage(img.smoothScale(256,::factory->titlesize));
break; break;
} }
case 3:{ case 3:{
cfg->overlay.resize(0,0); cfg->overlay.resize(0,0);
QImage img=QImage((uchar*)steel_overlay_data,28,64,32,NULL,0,QImage::LittleEndian); TQImage img=TQImage((uchar*)steel_overlay_data,28,64,32,NULL,0,TQImage::LittleEndian);
img.setAlphaBuffer(true); img.setAlphaBuffer(true);
cfg->overlay.convertFromImage(img.smoothScale(256,::factory->titlesize)); cfg->overlay.convertFromImage(img.smoothScale(256,::factory->titlesize));
break; break;
} }
case 4:{ case 4:{
QImage img; TQImage img;
if (img.load(filename)) if (img.load(filename))
{ {
img.setAlphaBuffer(true); img.setAlphaBuffer(true);
@ -185,12 +185,12 @@ bool CrystalFactory::readConfig()
// create a config object // create a config object
KConfig config("kwincrystalrc"); KConfig config("kwincrystalrc");
config.setGroup("General"); config.setGroup("General");
QColor c; TQColor c;
QString value = config.readEntry("TitleAlignment", "AlignHCenter"); TQString value = config.readEntry("TitleAlignment", "AlignHCenter");
if (value == "AlignLeft") titlealign_ = Qt::AlignLeft; if (value == "AlignLeft") titlealign_ = TQt::AlignLeft;
else if (value == "AlignHCenter") titlealign_ = Qt::AlignHCenter; else if (value == "AlignHCenter") titlealign_ = TQt::AlignHCenter;
else if (value == "AlignRight") titlealign_ = Qt::AlignRight; else if (value == "AlignRight") titlealign_ = TQt::AlignRight;
drawcaption=(bool)config.readBoolEntry("DrawCaption",true); drawcaption=(bool)config.readBoolEntry("DrawCaption",true);
textshadow=(bool)config.readBoolEntry("TextShadow",true); textshadow=(bool)config.readBoolEntry("TextShadow",true);
@ -205,23 +205,23 @@ bool CrystalFactory::readConfig()
inactive.amount=(double)config.readNumEntry("InactiveShade",-30)/100.0; inactive.amount=(double)config.readNumEntry("InactiveShade",-30)/100.0;
active.outlineMode=(int)config.readNumEntry("ActiveFrame",1); active.outlineMode=(int)config.readNumEntry("ActiveFrame",1);
inactive.outlineMode=(int)config.readNumEntry("InactiveFrame",1); inactive.outlineMode=(int)config.readNumEntry("InactiveFrame",1);
c=QColor(160,160,160); c=TQColor(160,160,160);
active.frameColor=config.readColorEntry("FrameColor1",&c); active.frameColor=config.readColorEntry("FrameColor1",&c);
c=QColor(128,128,128); c=TQColor(128,128,128);
inactive.frameColor=config.readColorEntry("FrameColor2",&c); inactive.frameColor=config.readColorEntry("FrameColor2",&c);
active.inlineMode=(int)config.readNumEntry("ActiveInline",0); active.inlineMode=(int)config.readNumEntry("ActiveInline",0);
inactive.inlineMode=(int)config.readNumEntry("InactiveInline",0); inactive.inlineMode=(int)config.readNumEntry("InactiveInline",0);
c=QColor(160,160,160); c=TQColor(160,160,160);
active.inlineColor=config.readColorEntry("InlineColor1",&c); active.inlineColor=config.readColorEntry("InlineColor1",&c);
c=QColor(160,160,160); c=TQColor(160,160,160);
inactive.inlineColor=config.readColorEntry("InlineColor2",&c); inactive.inlineColor=config.readColorEntry("InlineColor2",&c);
active.blur=config.readNumEntry("ActiveBlur",0); active.blur=config.readNumEntry("ActiveBlur",0);
inactive.blur=config.readNumEntry("InactiveBlur",0); inactive.blur=config.readNumEntry("InactiveBlur",0);
active.userdefinedPicture=QImage(); active.userdefinedPicture=TQImage();
inactive.userdefinedPicture=QImage(); inactive.userdefinedPicture=TQImage();
if ((bool)config.readBoolEntry("ActiveUserdefined",false)) if ((bool)config.readBoolEntry("ActiveUserdefined",false))
{ {
active.userdefinedPicture.load(config.readEntry("ActiveUserdefinedPicture")); active.userdefinedPicture.load(config.readEntry("ActiveUserdefinedPicture"));
@ -234,19 +234,19 @@ bool CrystalFactory::readConfig()
borderwidth=config.readNumEntry("Borderwidth",5); borderwidth=config.readNumEntry("Borderwidth",5);
titlesize=config.readNumEntry("Titlebarheight",21); titlesize=config.readNumEntry("Titlebarheight",21);
buttonColor_normal=QColor(255,255,255); buttonColor_normal=TQColor(255,255,255);
buttonColor_normal=config.readColorEntry("ButtonColor",&buttonColor_normal); buttonColor_normal=config.readColorEntry("ButtonColor",&buttonColor_normal);
buttonColor_hovered=config.readColorEntry("ButtonColor2",&buttonColor_normal); buttonColor_hovered=config.readColorEntry("ButtonColor2",&buttonColor_normal);
buttonColor_pressed=config.readColorEntry("ButtonColor3",&buttonColor_normal); buttonColor_pressed=config.readColorEntry("ButtonColor3",&buttonColor_normal);
minColor_normal=QColor(255,255,255); minColor_normal=TQColor(255,255,255);
minColor_normal=config.readColorEntry("MinColor",&buttonColor_normal); minColor_normal=config.readColorEntry("MinColor",&buttonColor_normal);
minColor_hovered=config.readColorEntry("MinColor2",&buttonColor_normal); minColor_hovered=config.readColorEntry("MinColor2",&buttonColor_normal);
minColor_pressed=config.readColorEntry("MinColor3",&buttonColor_normal); minColor_pressed=config.readColorEntry("MinColor3",&buttonColor_normal);
maxColor_normal=QColor(255,255,255); maxColor_normal=TQColor(255,255,255);
maxColor_normal=config.readColorEntry("MaxColor",&buttonColor_normal); maxColor_normal=config.readColorEntry("MaxColor",&buttonColor_normal);
maxColor_hovered=config.readColorEntry("MaxColor2",&buttonColor_normal); maxColor_hovered=config.readColorEntry("MaxColor2",&buttonColor_normal);
maxColor_pressed=config.readColorEntry("MaxColor3",&buttonColor_normal); maxColor_pressed=config.readColorEntry("MaxColor3",&buttonColor_normal);
closeColor_normal=QColor(255,255,255); closeColor_normal=TQColor(255,255,255);
closeColor_normal=config.readColorEntry("CloseColor",&closeColor_normal); closeColor_normal=config.readColorEntry("CloseColor",&closeColor_normal);
closeColor_hovered=config.readColorEntry("CloseColor2",&closeColor_normal); closeColor_hovered=config.readColorEntry("CloseColor2",&closeColor_normal);
closeColor_pressed=config.readColorEntry("CloseColor3",&closeColor_normal); closeColor_pressed=config.readColorEntry("CloseColor3",&closeColor_normal);
@ -257,8 +257,8 @@ bool CrystalFactory::readConfig()
animateHover=config.readBoolEntry("AnimateHover",true); animateHover=config.readBoolEntry("AnimateHover",true);
tintButtons=config.readBoolEntry("TintButtons",false); tintButtons=config.readBoolEntry("TintButtons",false);
menuImage=config.readBoolEntry("MenuImage",true); menuImage=config.readBoolEntry("MenuImage",true);
repaintMode=config.readNumEntry("RepaintMode",1); tqrepaintMode=config.readNumEntry("RepaintMode",1);
repaintTime=config.readNumEntry("RepaintTime",200); tqrepaintTime=config.readNumEntry("RepaintTime",200);
buttontheme=config.readNumEntry("ButtonTheme",8); buttontheme=config.readNumEntry("ButtonTheme",8);
@ -269,7 +269,7 @@ bool CrystalFactory::readConfig()
logoStretch=config.readNumEntry("LogoStretch",0); logoStretch=config.readNumEntry("LogoStretch",0);
logoActive=config.readBoolEntry("LogoActive",0); logoActive=config.readBoolEntry("LogoActive",0);
logoDistance=config.readNumEntry("LogoDistance",0); logoDistance=config.readNumEntry("LogoDistance",0);
QString filename=config.readEntry("LogoFile",""); TQString filename=config.readEntry("LogoFile","");
if (!filename.isNull() && logoEnabled!=1) if (!filename.isNull() && logoEnabled!=1)
{ {
if (logo.load(filename)) if (logo.load(filename))
@ -289,7 +289,7 @@ void CrystalFactory::CreateButtonImages()
{ {
if (buttonImages[i])buttonImages[i]->reset(); else if (buttonImages[i])buttonImages[i]->reset(); else
buttonImages[i]=new ButtonImage; buttonImages[i]=new ButtonImage;
if (!tintButtons)buttonImages[i]->setColors(Qt::white,Qt::white,Qt::white); if (!tintButtons)buttonImages[i]->setColors(TQt::white,TQt::white,TQt::white);
else switch(i) else switch(i)
{ {
case ButtonImageMin: case ButtonImageMin:
@ -759,50 +759,50 @@ void CrystalClient::init()
// for flicker-free redraws // for flicker-free redraws
widget()->setBackgroundMode(NoBackground); widget()->setBackgroundMode(NoBackground);
// setup layout // setup tqlayout
mainlayout = new QGridLayout(widget(), 4, 3); // 4x3 grid maintqlayout = new TQGridLayout(widget(), 4, 3); // 4x3 grid
titlelayout = new QHBoxLayout(); titletqlayout = new TQHBoxLayout();
titlebar_ = new QSpacerItem(1, ::factory->titlesize-1, QSizePolicy::Expanding, titlebar_ = new TQSpacerItem(1, ::factory->titlesize-1, TQSizePolicy::Expanding,
QSizePolicy::Fixed); TQSizePolicy::Fixed);
mainlayout->setResizeMode(QLayout::FreeResize); maintqlayout->setResizeMode(TQLayout::FreeResize);
mainlayout->setRowSpacing(0, (::factory->buttontheme==5)?0:1); maintqlayout->setRowSpacing(0, (::factory->buttontheme==5)?0:1);
mainlayout->setRowSpacing(3, ::factory->borderwidth*1); maintqlayout->setRowSpacing(3, ::factory->borderwidth*1);
mainlayout->setColSpacing(2,borderSpacing()); maintqlayout->setColSpacing(2,borderSpacing());
mainlayout->setColSpacing(0,borderSpacing()); maintqlayout->setColSpacing(0,borderSpacing());
mainlayout->addLayout(titlelayout, 1, 1); maintqlayout->addLayout(titletqlayout, 1, 1);
if (isPreview()) { if (isPreview()) {
char c[512]; char c[512];
sprintf(c,"<center><b>Crystal %s Preview</b><br>Built: %s</center>",VERSION,__DATE__); sprintf(c,"<center><b>Crystal %s Preview</b><br>Built: %s</center>",VERSION,__DATE__);
mainlayout->addItem(new QSpacerItem(1, 1,QSizePolicy::Expanding,QSizePolicy::Fixed), 0, 1); maintqlayout->addItem(new TQSpacerItem(1, 1,TQSizePolicy::Expanding,TQSizePolicy::Fixed), 0, 1);
mainlayout->addItem(new QSpacerItem(1, ::factory->borderwidth,QSizePolicy::Expanding,QSizePolicy::Expanding), 3, 1); maintqlayout->addItem(new TQSpacerItem(1, ::factory->borderwidth,TQSizePolicy::Expanding,TQSizePolicy::Expanding), 3, 1);
mainlayout->addWidget(new QLabel(i18n(c),widget()), 2, 1); maintqlayout->addWidget(new TQLabel(i18n(c),widget()), 2, 1);
} else { } else {
mainlayout->addItem(new QSpacerItem(0, 0), 2, 1); maintqlayout->addItem(new TQSpacerItem(0, 0), 2, 1);
} }
mainlayout->setRowStretch(2, 10); maintqlayout->setRowStretch(2, 10);
mainlayout->setColStretch(1, 10); maintqlayout->setColStretch(1, 10);
updateMask(); updateMask();
for (int n=0; n<ButtonTypeCount; n++) button[n] = 0; for (int n=0; n<ButtonTypeCount; n++) button[n] = 0;
addButtons(titlelayout, options()->titleButtonsLeft()); addButtons(titletqlayout, options()->titleButtonsLeft());
titlelayout->addItem(titlebar_); titletqlayout->addItem(titlebar_);
{ {
CrystalButton* lastbutton=addButtons(titlelayout, options()->titleButtonsRight()); CrystalButton* lastbutton=addButtons(titletqlayout, options()->titleButtonsRight());
if (lastbutton)lastbutton->setFirstLast(false,true); if (lastbutton)lastbutton->setFirstLast(false,true);
} }
if (::factory->captiontooltip) new CCrystalTooltip(widget(),this); if (::factory->captiontooltip) new CCrystalTooltip(widget(),this);
connect( this, SIGNAL( keepAboveChanged( bool )), SLOT( keepAboveChange( bool ))); connect( this, TQT_SIGNAL( keepAboveChanged( bool )), TQT_SLOT( keepAboveChange( bool )));
connect( this, SIGNAL( keepBelowChanged( bool )), SLOT( keepBelowChange( bool ))); connect( this, TQT_SIGNAL( keepBelowChanged( bool )), TQT_SLOT( keepBelowChange( bool )));
if (::factory->transparency)connect ( ::factory->image_holder,SIGNAL(repaintNeeded()),this,SLOT(Repaint())); if (::factory->transparency)connect ( ::factory->image_holder,TQT_SIGNAL(tqrepaintNeeded()),this,TQT_SLOT(Repaint()));
if (::factory->transparency)connect ( &timer,SIGNAL(timeout()),this,SLOT(Repaint())); if (::factory->transparency)connect ( &timer,TQT_SIGNAL(timeout()),this,TQT_SLOT(Repaint()));
updateLayout(); updateLayout();
} }
@ -811,53 +811,53 @@ void CrystalClient::updateMask()
{ {
if ((::factory->roundCorners==0)|| (!options()->moveResizeMaximizedWindows() && maximizeMode() & MaximizeFull ) ) if ((::factory->roundCorners==0)|| (!options()->moveResizeMaximizedWindows() && maximizeMode() & MaximizeFull ) )
{ {
setMask(QRegion(widget()->rect())); setMask(TQRegion(widget()->rect()));
return; return;
} }
int cornersFlag = ::factory->roundCorners; int cornersFlag = ::factory->roundCorners;
int r(width()); int r(width());
int b(height()); int b(height());
QRegion mask; TQRegion tqmask;
mask=QRegion(widget()->rect()); tqmask=TQRegion(widget()->rect());
// Remove top-left corner. // Remove top-left corner.
if(cornersFlag & TOP_LEFT) { if(cornersFlag & TOP_LEFT) {
mask -= QRegion(0, 0, 5, 1); tqmask -= TQRegion(0, 0, 5, 1);
mask -= QRegion(0, 1, 3, 1); tqmask -= TQRegion(0, 1, 3, 1);
mask -= QRegion(0, 2, 2, 1); tqmask -= TQRegion(0, 2, 2, 1);
mask -= QRegion(0, 3, 1, 2); tqmask -= TQRegion(0, 3, 1, 2);
} }
// Remove top-right corner. // Remove top-right corner.
if(cornersFlag & TOP_RIGHT) { if(cornersFlag & TOP_RIGHT) {
mask -= QRegion(r - 5, 0, 5, 1); tqmask -= TQRegion(r - 5, 0, 5, 1);
mask -= QRegion(r - 3, 1, 3, 1); tqmask -= TQRegion(r - 3, 1, 3, 1);
mask -= QRegion(r - 2, 2, 2, 1); tqmask -= TQRegion(r - 2, 2, 2, 1);
mask -= QRegion(r - 1, 3, 1, 2); tqmask -= TQRegion(r - 1, 3, 1, 2);
} }
// Remove bottom-left corner. // Remove bottom-left corner.
if(cornersFlag & BOT_LEFT) { if(cornersFlag & BOT_LEFT) {
mask -= QRegion(0, b - 5, 1, 3); tqmask -= TQRegion(0, b - 5, 1, 3);
mask -= QRegion(0, b - 3, 2, 1); tqmask -= TQRegion(0, b - 3, 2, 1);
mask -= QRegion(0, b - 2, 3, 1); tqmask -= TQRegion(0, b - 2, 3, 1);
mask -= QRegion(0, b - 1, 5, 1); tqmask -= TQRegion(0, b - 1, 5, 1);
} }
// Remove bottom-right corner. // Remove bottom-right corner.
if(cornersFlag & BOT_RIGHT) { if(cornersFlag & BOT_RIGHT) {
mask -= QRegion(r - 5, b - 1, 5, 1); tqmask -= TQRegion(r - 5, b - 1, 5, 1);
mask -= QRegion(r - 3, b - 2, 3, 1); tqmask -= TQRegion(r - 3, b - 2, 3, 1);
mask -= QRegion(r - 2, b - 3, 2, 1); tqmask -= TQRegion(r - 2, b - 3, 2, 1);
mask -= QRegion(r - 1, b - 5, 1, 2); tqmask -= TQRegion(r - 1, b - 5, 1, 2);
} }
setMask(mask); setMask(tqmask);
} }
CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s) CrystalButton* CrystalClient::addButtons(TQBoxLayout *tqlayout, const TQString& s)
{ {
ButtonImage *bitmap; ButtonImage *bitmap;
QString tip; TQString tip;
CrystalButton *lastone=NULL; CrystalButton *lastone=NULL;
if (s.length() > 0) if (s.length() > 0)
@ -869,7 +869,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
case 'M': // Menu button case 'M': // Menu button
if (!button[ButtonMenu]) { if (!button[ButtonMenu]) {
button[ButtonMenu] = current = new CrystalButton(this, "menu", i18n("Menu"), ButtonMenu, ::factory->buttonImages[ButtonImageMenu]); button[ButtonMenu] = current = new CrystalButton(this, "menu", i18n("Menu"), ButtonMenu, ::factory->buttonImages[ButtonImageMenu]);
connect(button[ButtonMenu], SIGNAL(pressed()), this, SLOT(menuButtonPressed())); connect(button[ButtonMenu], TQT_SIGNAL(pressed()), this, TQT_SLOT(menuButtonPressed()));
} }
break; break;
@ -883,7 +883,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
tip = i18n("On All Desktops"); tip = i18n("On All Desktops");
} }
button[ButtonSticky] =current=new CrystalButton(this, "sticky", tip,ButtonSticky, bitmap); button[ButtonSticky] =current=new CrystalButton(this, "sticky", tip,ButtonSticky, bitmap);
connect(button[ButtonSticky], SIGNAL(clicked()),this, SLOT(toggleOnAllDesktops())); connect(button[ButtonSticky], TQT_SIGNAL(clicked()),this, TQT_SLOT(toggleOnAllDesktops()));
} }
break; break;
@ -891,7 +891,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
if (providesContextHelp()) { if (providesContextHelp()) {
button[ButtonHelp] =current= button[ButtonHelp] =current=
new CrystalButton(this, "help", i18n("Help"),ButtonHelp, ::factory->buttonImages[ButtonImageHelp]); new CrystalButton(this, "help", i18n("Help"),ButtonHelp, ::factory->buttonImages[ButtonImageHelp]);
connect(button[ButtonHelp], SIGNAL(clicked()),this, SLOT(showContextHelp())); connect(button[ButtonHelp], TQT_SIGNAL(clicked()),this, TQT_SLOT(showContextHelp()));
} }
break; break;
@ -899,7 +899,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
if ((!button[ButtonMin]) && isMinimizable()) { if ((!button[ButtonMin]) && isMinimizable()) {
button[ButtonMin] =current= button[ButtonMin] =current=
new CrystalButton(this, "iconify", i18n("Minimize"),ButtonMin, ::factory->buttonImages[ButtonImageMin]); new CrystalButton(this, "iconify", i18n("Minimize"),ButtonMin, ::factory->buttonImages[ButtonImageMin]);
connect(button[ButtonMin], SIGNAL(clicked()),this, SLOT(minButtonPressed())); connect(button[ButtonMin], TQT_SIGNAL(clicked()),this, TQT_SLOT(minButtonPressed()));
} }
break; break;
@ -907,7 +907,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
if (!button[ButtonAbove]) { if (!button[ButtonAbove]) {
button[ButtonAbove] =current= button[ButtonAbove] =current=
new CrystalButton(this, "above", i18n("Keep Above Others"),ButtonAbove, ::factory->buttonImages[keepAbove()?ButtonImageUnAbove:ButtonImageAbove]); new CrystalButton(this, "above", i18n("Keep Above Others"),ButtonAbove, ::factory->buttonImages[keepAbove()?ButtonImageUnAbove:ButtonImageAbove]);
connect(button[ButtonAbove], SIGNAL(clicked()),this, SLOT(aboveButtonPressed())); connect(button[ButtonAbove], TQT_SIGNAL(clicked()),this, TQT_SLOT(aboveButtonPressed()));
} }
break; break;
@ -915,7 +915,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
if ((!button[ButtonBelow])) { if ((!button[ButtonBelow])) {
button[ButtonBelow] =current= button[ButtonBelow] =current=
new CrystalButton(this, "below", i18n("Keep Below Others"),ButtonBelow, ::factory->buttonImages[keepBelow()?ButtonImageUnBelow:ButtonImageBelow]); new CrystalButton(this, "below", i18n("Keep Below Others"),ButtonBelow, ::factory->buttonImages[keepBelow()?ButtonImageUnBelow:ButtonImageBelow]);
connect(button[ButtonBelow], SIGNAL(clicked()),this, SLOT(belowButtonPressed())); connect(button[ButtonBelow], TQT_SIGNAL(clicked()),this, TQT_SLOT(belowButtonPressed()));
} }
break; break;
@ -923,7 +923,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
if ((!button[ButtonShade]) && isShadeable()) { if ((!button[ButtonShade]) && isShadeable()) {
button[ButtonShade] =current= button[ButtonShade] =current=
new CrystalButton(this, "shade", i18n("Shade"),ButtonShade, ::factory->buttonImages[ButtonImageShade]); new CrystalButton(this, "shade", i18n("Shade"),ButtonShade, ::factory->buttonImages[ButtonImageShade]);
connect(button[ButtonShade], SIGNAL(clicked()),this, SLOT(shadeButtonPressed())); connect(button[ButtonShade], TQT_SIGNAL(clicked()),this, TQT_SLOT(shadeButtonPressed()));
} }
break; break;
@ -940,7 +940,7 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
} }
button[ButtonMax] =current= button[ButtonMax] =current=
new CrystalButton(this, "maximize", tip,ButtonMax, bitmap); new CrystalButton(this, "maximize", tip,ButtonMax, bitmap);
connect(button[ButtonMax], SIGNAL(clicked()),this, SLOT(maxButtonPressed())); connect(button[ButtonMax], TQT_SIGNAL(clicked()),this, TQT_SLOT(maxButtonPressed()));
} }
break; break;
@ -948,20 +948,20 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
if (isCloseable()) { if (isCloseable()) {
button[ButtonClose] =current= button[ButtonClose] =current=
new CrystalButton(this, "close", i18n("Close"),ButtonClose, ::factory->buttonImages[ButtonImageClose]); new CrystalButton(this, "close", i18n("Close"),ButtonClose, ::factory->buttonImages[ButtonImageClose]);
connect(button[ButtonClose], SIGNAL(clicked()),this, SLOT(closeButtonPressed())); connect(button[ButtonClose], TQT_SIGNAL(clicked()),this, TQT_SLOT(closeButtonPressed()));
} }
break; break;
case '_': // Spacer item case '_': // Spacer item
layout->addSpacing(4); tqlayout->addSpacing(4);
current=NULL; current=NULL;
break; break;
} }
if (current) if (current)
{ {
layout->addWidget(current); tqlayout->addWidget(current);
if (layout->findWidget(current)==0)current->setFirstLast(true,false); if (tqlayout->tqfindWidget(current)==0)current->setFirstLast(true,false);
} }
lastone=current; lastone=current;
} }
@ -972,12 +972,12 @@ CrystalButton* CrystalClient::addButtons(QBoxLayout *layout, const QString& s)
void CrystalClient::activeChange() void CrystalClient::activeChange()
{ {
Repaint(); Repaint();
if (isActive()) ::factory->clients.at(::factory->clients.find(this)); if (isActive()) ::factory->clients.at(::factory->clients.tqfind(this));
} }
void CrystalClient::captionChange() void CrystalClient::captionChange()
{ {
if (::factory->drawcaption) widget()->repaint(titlebar_->geometry(), false); if (::factory->drawcaption) widget()->tqrepaint(titlebar_->tqgeometry(), false);
} }
void CrystalClient::desktopChange() void CrystalClient::desktopChange()
@ -985,8 +985,8 @@ void CrystalClient::desktopChange()
bool d = isOnAllDesktops(); bool d = isOnAllDesktops();
if (button[ButtonSticky]) { if (button[ButtonSticky]) {
button[ButtonSticky]->setBitmap(::factory->buttonImages[d ? ButtonImageSticky : ButtonImageUnSticky ]); button[ButtonSticky]->setBitmap(::factory->buttonImages[d ? ButtonImageSticky : ButtonImageUnSticky ]);
QToolTip::remove(button[ButtonSticky]); TQToolTip::remove(button[ButtonSticky]);
QToolTip::add(button[ButtonSticky], d ? i18n("Not on all desktops") : i18n("On All Desktops")); TQToolTip::add(button[ButtonSticky], d ? i18n("Not on all desktops") : i18n("On All Desktops"));
} }
} }
@ -1002,8 +1002,8 @@ void CrystalClient::maximizeChange()
bool m = (maximizeMode() == MaximizeFull); bool m = (maximizeMode() == MaximizeFull);
if (button[ButtonMax]) { if (button[ButtonMax]) {
button[ButtonMax]->setBitmap(::factory->buttonImages[ m ? ButtonImageRestore : ButtonImageMax ]); button[ButtonMax]->setBitmap(::factory->buttonImages[ m ? ButtonImageRestore : ButtonImageMax ]);
QToolTip::remove(button[ButtonMax]); TQToolTip::remove(button[ButtonMax]);
QToolTip::add(button[ButtonMax], m ? i18n("Restore") : i18n("Maximize")); TQToolTip::add(button[ButtonMax], m ? i18n("Restore") : i18n("Maximize"));
} }
if (!options()->moveResizeMaximizedWindows()) if (!options()->moveResizeMaximizedWindows())
@ -1018,17 +1018,17 @@ void CrystalClient::updateLayout()
{ {
if (FullMax) if (FullMax)
{ {
mainlayout->setColSpacing(0,0); maintqlayout->setColSpacing(0,0);
mainlayout->setColSpacing(2,0); maintqlayout->setColSpacing(2,0);
}else{ }else{
mainlayout->setColSpacing(2,borderSpacing()); maintqlayout->setColSpacing(2,borderSpacing());
mainlayout->setColSpacing(0,borderSpacing()); maintqlayout->setColSpacing(0,borderSpacing());
} }
mainlayout->setRowSpacing(0, (FullMax||::factory->buttontheme==5)?0:1); maintqlayout->setRowSpacing(0, (FullMax||::factory->buttontheme==5)?0:1);
for (int i=0;i<ButtonTypeCount;i++)if (button[i]) for (int i=0;i<ButtonTypeCount;i++)if (button[i])
button[i]->resetSize(FullMax); button[i]->resetSize(FullMax);
widget()->layout()->activate(); widget()->tqlayout()->activate();
} }
int CrystalClient::borderSpacing() int CrystalClient::borderSpacing()
@ -1067,17 +1067,17 @@ void CrystalClient::borders(int &l, int &r, int &t, int &b) const
} }
} }
void CrystalClient::resize(const QSize &size) void CrystalClient::resize(const TQSize &size)
{ {
widget()->resize(size); widget()->resize(size);
} }
QSize CrystalClient::minimumSize() const TQSize CrystalClient::tqminimumSize() const
{ {
return widget()->minimumSize(); return widget()->tqminimumSize();
} }
KDecoration::Position CrystalClient::mousePosition(const QPoint &point) const KDecoration::Position CrystalClient::mousePosition(const TQPoint &point) const
{ {
const int corner = 20; const int corner = 20;
Position pos; Position pos;
@ -1111,33 +1111,33 @@ KDecoration::Position CrystalClient::mousePosition(const QPoint &point) const
return pos; return pos;
} }
bool CrystalClient::eventFilter(QObject *obj, QEvent *e) bool CrystalClient::eventFilter(TQObject *obj, TQEvent *e)
{ {
if (obj != widget()) return false; if (TQT_BASE_OBJECT(obj) != TQT_BASE_OBJECT(widget())) return false;
switch (e->type()) { switch (e->type()) {
case QEvent::MouseButtonDblClick: case TQEvent::MouseButtonDblClick:
mouseDoubleClickEvent(static_cast<QMouseEvent *>(e)); mouseDoubleClickEvent(TQT_TQMOUSEEVENT(e));
return true; return true;
case QEvent::MouseButtonPress: case TQEvent::MouseButtonPress:
processMousePressEvent(static_cast<QMouseEvent *>(e)); processMousePressEvent(TQT_TQMOUSEEVENT(e));
return true; return true;
case QEvent::Paint: case TQEvent::Paint:
paintEvent(static_cast<QPaintEvent *>(e)); paintEvent(TQT_TQPAINTEVENT(e));
return true; return true;
case QEvent::Wheel: case TQEvent::Wheel:
mouseWheelEvent(static_cast<QWheelEvent *>(e)); mouseWheelEvent(TQT_TQWHEELEVENT(e));
return true; return true;
case QEvent::Resize: case TQEvent::Resize:
resizeEvent(static_cast<QResizeEvent *>(e)); resizeEvent(TQT_TQRESIZEEVENT(e));
return true; return true;
case QEvent::Show: case TQEvent::Show:
showEvent(static_cast<QShowEvent *>(e)); showEvent(TQT_TQSHOWEVENT(e));
return true; return true;
case QEvent::Move: case TQEvent::Move:
moveEvent(static_cast<QMoveEvent *>(e)); moveEvent(TQT_TQMOVEEVENT(e));
return true; return true;
default:return false; default:return false;
} }
@ -1147,53 +1147,53 @@ bool CrystalClient::eventFilter(QObject *obj, QEvent *e)
void CrystalClient::ClientWindows(Window* v_frame,Window* v_wrapper,Window *v_client) void CrystalClient::ClientWindows(Window* v_frame,Window* v_wrapper,Window *v_client)
{ {
Window root=0,frame=0,wrapper=0,client=0,parent=0,*children=NULL; Window root=0,frame=0,wrapper=0,client=0,tqparent=0,*tqchildren=NULL;
uint numc; uint numc;
if (v_frame) *v_frame=0; if (v_frame) *v_frame=0;
if (v_wrapper) *v_wrapper=0; if (v_wrapper) *v_wrapper=0;
if (v_client) *v_client=0; if (v_client) *v_client=0;
// Our Deco is the child of a frame, get our parent // Our Deco is the child of a frame, get our tqparent
if (XQueryTree(qt_xdisplay(),widget()->winId(),&root,&frame,&children,&numc) == 0) if (XQueryTree(qt_xdisplay(),widget()->winId(),&root,&frame,&tqchildren,&numc) == 0)
return; return;
if (children!=NULL)XFree(children); if (tqchildren!=NULL)XFree(tqchildren);
children=NULL; tqchildren=NULL;
// frame has two children, us and a wrapper, get the wrapper // frame has two tqchildren, us and a wrapper, get the wrapper
if (XQueryTree(qt_xdisplay(),frame,&root,&parent,&children,&numc)==0) if (XQueryTree(qt_xdisplay(),frame,&root,&tqparent,&tqchildren,&numc)==0)
return; return;
for (uint i=0;i<numc;i++) for (uint i=0;i<numc;i++)
{ {
if (children[i]!=widget()->winId())wrapper=children[i]; if (tqchildren[i]!=widget()->winId())wrapper=tqchildren[i];
} }
if (children!=NULL)XFree(children); if (tqchildren!=NULL)XFree(tqchildren);
children=NULL; tqchildren=NULL;
// wrapper has only one child, which is the client. We want this!! // wrapper has only one child, which is the client. We want this!!
if (XQueryTree(qt_xdisplay(),wrapper,&root,&parent,&children,&numc)==0) if (XQueryTree(qt_xdisplay(),wrapper,&root,&tqparent,&tqchildren,&numc)==0)
return; return;
if (numc==1)client=children[0]; if (numc==1)client=tqchildren[0];
if (children!=NULL)XFree(children); if (tqchildren!=NULL)XFree(tqchildren);
children=NULL; tqchildren=NULL;
if (v_client) *v_client=client; if (v_client) *v_client=client;
if (v_wrapper) *v_wrapper=wrapper; if (v_wrapper) *v_wrapper=wrapper;
if (v_frame) *v_frame=frame; if (v_frame) *v_frame=frame;
} }
void CrystalClient::mouseDoubleClickEvent(QMouseEvent *e) void CrystalClient::mouseDoubleClickEvent(TQMouseEvent *e)
{ {
if (/*(titlebar_->geometry().contains(e->pos()))&&*/(e->button()==LeftButton)) titlebarDblClickOperation(); if (/*(titlebar_->tqgeometry().tqcontains(e->pos()))&&*/(e->button()==Qt::LeftButton)) titlebarDblClickOperation();
else { else {
QMouseEvent me(QEvent::MouseButtonPress,e->pos(),e->button(),e->state()); TQMouseEvent me(TQEvent::MouseButtonPress,e->pos(),e->button(),e->state());
processMousePressEvent(&me); processMousePressEvent(&me);
} }
} }
void CrystalClient::mouseWheelEvent(QWheelEvent *e) void CrystalClient::mouseWheelEvent(TQWheelEvent *e)
{ {
if (::factory->wheelTask) if (::factory->wheelTask)
{ {
QPtrList <CrystalClient> *l=&(::factory->clients); TQPtrList <CrystalClient> *l=&(::factory->clients);
if (l->current()==NULL) for (unsigned int i=0;i<l->count();i++) if ((l->at(i))->isActive()) break; if (l->current()==NULL) for (unsigned int i=0;i<l->count();i++) if ((l->at(i))->isActive()) break;
@ -1229,34 +1229,34 @@ void CrystalClient::mouseWheelEvent(QWheelEvent *e)
} }
} }
void CrystalClient::paintEvent(QPaintEvent*) void CrystalClient::paintEvent(TQPaintEvent*)
{ {
if (!CrystalFactory::initialized()) return; if (!CrystalFactory::initialized()) return;
QColorGroup group; TQColorGroup group;
QPainter painter(widget()); TQPainter painter(widget());
// draw the titlebar // draw the titlebar
group = options()->colorGroup(KDecoration::ColorTitleBar, isActive()); group = options()->tqcolorGroup(KDecoration::ColorTitleBar, isActive());
WND_CONFIG* wndcfg=(isActive()?&::factory->active:&::factory->inactive); WND_CONFIG* wndcfg=(isActive()?&::factory->active:&::factory->inactive);
if (::factory->transparency && ::factory->trackdesktop) if (::factory->transparency && ::factory->trackdesktop)
::factory->image_holder->repaint(false); // If other desktop than the last, regrab the root image ::factory->image_holder->tqrepaint(false); // If other desktop than the last, regrab the root image
QPixmap *background=::factory->transparency?::factory->image_holder->image(isActive()):NULL; TQPixmap *background=::factory->transparency?::factory->image_holder->image(isActive()):NULL;
int drawFrame; int drawFrame;
{ {
QRect r; TQRect r;
QPoint p=widget()->mapToGlobal(QPoint(0,0)); TQPoint p=widget()->mapToGlobal(TQPoint(0,0));
int bl,br,bt,bb; int bl,br,bt,bb;
borders(bl,br,bt,bb); borders(bl,br,bt,bb);
QPixmap pufferPixmap; TQPixmap pufferPixmap;
pufferPixmap.resize(widget()->width(), bt); pufferPixmap.resize(widget()->width(), bt);
QPainter pufferPainter(&pufferPixmap); TQPainter pufferPainter(&pufferPixmap);
r=QRect(p.x(),p.y(),widget()->width(),bt); r=TQRect(p.x(),p.y(),widget()->width(),bt);
if (background && !background->isNull())pufferPainter.drawPixmap(QPoint(0,0),*background,r); if (background && !background->isNull())pufferPainter.drawPixmap(TQPoint(0,0),*background,r);
else else
{ {
pufferPainter.fillRect(widget()->rect(),group.background()); pufferPainter.fillRect(widget()->rect(),group.background());
@ -1271,8 +1271,8 @@ void CrystalClient::paintEvent(QPaintEvent*)
// draw title text // draw title text
pufferPainter.setFont(options()->font(isActive(), false)); pufferPainter.setFont(options()->font(isActive(), false));
QColor color=options()->color(KDecoration::ColorFont, isActive()); TQColor color=options()->color(KDecoration::ColorFont, isActive());
r=titlebar_->geometry(); r=titlebar_->tqgeometry();
r.moveBy(0,-1); r.moveBy(0,-1);
int logowidth=::factory->logo.width()+::factory->logoDistance; int logowidth=::factory->logo.width()+::factory->logoDistance;
if (::factory->logoEnabled!=1 && (isActive()||!::factory->logoActive)) if (::factory->logoEnabled!=1 && (isActive()||!::factory->logoActive))
@ -1280,7 +1280,7 @@ void CrystalClient::paintEvent(QPaintEvent*)
r.setWidth(r.width()-logowidth); r.setWidth(r.width()-logowidth);
if (::factory->logoEnabled==0)r.moveLeft(r.left()+logowidth); if (::factory->logoEnabled==0)r.moveLeft(r.left()+logowidth);
} }
QFontMetrics metrics(options()->font(isActive(), false)); TQFontMetrics metrics(options()->font(isActive(), false));
int textwidth=metrics.width(caption()); int textwidth=metrics.width(caption());
int textalign=CrystalFactory::titleAlign(); int textalign=CrystalFactory::titleAlign();
if (textwidth>r.width()) if (textwidth>r.width())
@ -1313,7 +1313,7 @@ void CrystalClient::paintEvent(QPaintEvent*)
} }
}else if (::factory->logoEnabled!=1 && (isActive()||!::factory->logoActive)) { }else if (::factory->logoEnabled!=1 && (isActive()||!::factory->logoActive)) {
int x=0; int x=0;
r=titlebar_->geometry(); r=titlebar_->tqgeometry();
if (::factory->logoEnabled==0) x=r.left(); if (::factory->logoEnabled==0) x=r.left();
if (::factory->logoEnabled==2) x=r.right()-::factory->logo.width(); if (::factory->logoEnabled==2) x=r.right()-::factory->logo.width();
pufferPainter.drawPixmap(x,(::factory->titlesize-::factory->logo.height())/2,::factory->logo); pufferPainter.drawPixmap(x,(::factory->titlesize-::factory->logo.height())/2,::factory->logo);
@ -1332,24 +1332,24 @@ void CrystalClient::paintEvent(QPaintEvent*)
if (background && !background->isNull()) if (background && !background->isNull())
{ // Draw the side and bottom of the window with transparency { // Draw the side and bottom of the window with transparency
// Left // Left
r=QRect(p.x()+drawFrame,p.y()+bt,bl-drawFrame,widget()->height()-bt-drawFrame); r=TQRect(p.x()+drawFrame,p.y()+bt,bl-drawFrame,widget()->height()-bt-drawFrame);
painter.drawPixmap(QPoint(drawFrame,bt),*background,r); painter.drawPixmap(TQPoint(drawFrame,bt),*background,r);
// Right // Right
r=QRect(widget()->width()-br+p.x(),p.y()+bt,br-drawFrame,widget()->height()-bt-drawFrame); r=TQRect(widget()->width()-br+p.x(),p.y()+bt,br-drawFrame,widget()->height()-bt-drawFrame);
painter.drawPixmap(QPoint(widget()->width()-br,bt),*background,r); painter.drawPixmap(TQPoint(widget()->width()-br,bt),*background,r);
// Bottom // Bottom
r=QRect(p.x()+bl,p.y()+widget()->height()-bb,widget()->width()-bl-br,bb-drawFrame); r=TQRect(p.x()+bl,p.y()+widget()->height()-bb,widget()->width()-bl-br,bb-drawFrame);
painter.drawPixmap(QPoint(bl,widget()->height()-bb),*background,r); painter.drawPixmap(TQPoint(bl,widget()->height()-bb),*background,r);
}else{ }else{
r=QRect(drawFrame,bt,bl-drawFrame,widget()->height()-bt-drawFrame); r=TQRect(drawFrame,bt,bl-drawFrame,widget()->height()-bt-drawFrame);
painter.fillRect(r,group.background()); painter.fillRect(r,group.background());
r=QRect(widget()->width()-br,bt,br-drawFrame,widget()->height()-bt-drawFrame); r=TQRect(widget()->width()-br,bt,br-drawFrame,widget()->height()-bt-drawFrame);
painter.fillRect(r,group.background()); painter.fillRect(r,group.background());
r=QRect(bl,widget()->height()-bb,widget()->width()-bl-br,bb-drawFrame); r=TQRect(bl,widget()->height()-bb,widget()->width()-bl-br,bb-drawFrame);
painter.fillRect(r,group.background()); painter.fillRect(r,group.background());
} }
} }
@ -1383,14 +1383,14 @@ void CrystalClient::paintEvent(QPaintEvent*)
// And notify image_holder that we need an update asap // And notify image_holder that we need an update asap
if (::factory)if (::factory->image_holder) if (::factory)if (::factory->image_holder)
// UnInit image_holder, on next Repaint it will be Init'ed again. // UnInit image_holder, on next Repaint it will be Init'ed again.
QTimer::singleShot(500,::factory->image_holder,SLOT(CheckSanity())); TQTimer::singleShot(500,::factory->image_holder,TQT_SLOT(CheckSanity()));
} }
if (drawFrame) if (drawFrame)
{ {
// outline the frame // outline the frame
QRect r=widget()->rect(); TQRect r=widget()->rect();
QColor c1,c2; TQColor c1,c2;
c1=c2=wndcfg->frameColor; c1=c2=wndcfg->frameColor;
if (wndcfg->outlineMode==2)c1=c1.dark(140),c2=c2.light(140); if (wndcfg->outlineMode==2)c1=c1.dark(140),c2=c2.light(140);
if (wndcfg->outlineMode==3)c1=c1.light(140),c2=c2.dark(140); if (wndcfg->outlineMode==3)c1=c1.light(140),c2=c2.dark(140);
@ -1409,7 +1409,7 @@ void CrystalClient::paintEvent(QPaintEvent*)
int r=(width()); int r=(width());
int b=(height()); int b=(height());
// Draw edge of top-left corner inside the area removed by the mask. // Draw edge of top-left corner inside the area removed by the tqmask.
if(cornersFlag & TOP_LEFT) { if(cornersFlag & TOP_LEFT) {
painter.setPen(c1); painter.setPen(c1);
painter.drawPoint(3, 1); painter.drawPoint(3, 1);
@ -1419,7 +1419,7 @@ void CrystalClient::paintEvent(QPaintEvent*)
painter.drawPoint(1, 4); painter.drawPoint(1, 4);
} }
// Draw edge of top-right corner inside the area removed by the mask. // Draw edge of top-right corner inside the area removed by the tqmask.
if(cornersFlag & TOP_RIGHT) { if(cornersFlag & TOP_RIGHT) {
painter.setPen(c1); painter.setPen(c1);
painter.drawPoint(r - 5, 1); painter.drawPoint(r - 5, 1);
@ -1429,7 +1429,7 @@ void CrystalClient::paintEvent(QPaintEvent*)
painter.drawPoint(r - 2, 4); painter.drawPoint(r - 2, 4);
} }
// Draw edge of bottom-left corner inside the area removed by the mask. // Draw edge of bottom-left corner inside the area removed by the tqmask.
if(cornersFlag & BOT_LEFT) { if(cornersFlag & BOT_LEFT) {
painter.setPen(c2); painter.setPen(c2);
painter.drawPoint(1, b - 5); painter.drawPoint(1, b - 5);
@ -1439,7 +1439,7 @@ void CrystalClient::paintEvent(QPaintEvent*)
painter.drawPoint(4, b - 2); painter.drawPoint(4, b - 2);
} }
// Draw edge of bottom-right corner inside the area removed by the mask. // Draw edge of bottom-right corner inside the area removed by the tqmask.
if(cornersFlag & BOT_RIGHT) { if(cornersFlag & BOT_RIGHT) {
painter.setPen(c2); painter.setPen(c2);
painter.drawPoint(r - 2, b - 5); painter.drawPoint(r - 2, b - 5);
@ -1452,23 +1452,23 @@ void CrystalClient::paintEvent(QPaintEvent*)
} }
} }
void CrystalClient::resizeEvent(QResizeEvent *e) void CrystalClient::resizeEvent(TQResizeEvent *e)
{ {
if (widget()->isShown()) if (widget()->isShown())
{ {
if (!::factory->transparency) ; if (!::factory->transparency) ;
else if (::factory->repaintMode==1) else if (::factory->tqrepaintMode==1)
{ {
if (!timer.isActive())timer.start(0,true); if (!timer.isActive())timer.start(0,true);
// Repaint(); // Repaint();
} }
// repaint only every xxx ms // tqrepaint only every xxx ms
else if (::factory->repaintMode==3 || !timer.isActive()) else if (::factory->tqrepaintMode==3 || !timer.isActive())
{ {
// Repaint only, when mode!=fade || amount<100 // Repaint only, when mode!=fade || amount<100
WND_CONFIG* wnd=isActive()?&::factory->active:&::factory->inactive; WND_CONFIG* wnd=isActive()?&::factory->active:&::factory->inactive;
if (wnd->mode!=0 || wnd->amount<100) if (wnd->mode!=0 || wnd->amount<100)
timer.start(::factory->repaintTime,true); timer.start(::factory->tqrepaintTime,true);
} }
} }
if (e->size()!=e->oldSize()) if (e->size()!=e->oldSize())
@ -1477,27 +1477,27 @@ void CrystalClient::resizeEvent(QResizeEvent *e)
} }
} }
void CrystalClient::moveEvent(QMoveEvent *) void CrystalClient::moveEvent(TQMoveEvent *)
{ {
if (widget()->isShown()) if (widget()->isShown())
{ {
if (!::factory->transparency) return; if (!::factory->transparency) return;
else if (::factory->repaintMode==1) else if (::factory->tqrepaintMode==1)
{ {
Repaint(); Repaint();
} }
// repaint every xxx ms, so constant moving does not take too much CPU // tqrepaint every xxx ms, so constant moving does not take too much CPU
else if (::factory->repaintMode==3 || !timer.isActive()) else if (::factory->tqrepaintMode==3 || !timer.isActive())
{ {
// Repaint only, when mode!=fade || value<100, because otherwise it is a plain color // Repaint only, when mode!=fade || value<100, because otherwise it is a plain color
WND_CONFIG* wnd=isActive()?&::factory->active:&::factory->inactive; WND_CONFIG* wnd=isActive()?&::factory->active:&::factory->inactive;
if (wnd->mode!=0 || wnd->amount<100) if (wnd->mode!=0 || wnd->amount<100)
timer.start(::factory->repaintTime,true); timer.start(::factory->tqrepaintTime,true);
} }
} }
} }
void CrystalClient::showEvent(QShowEvent *) void CrystalClient::showEvent(TQShowEvent *)
{ {
if (widget()->isShown()) if (widget()->isShown())
Repaint(); Repaint();
@ -1505,7 +1505,7 @@ void CrystalClient::showEvent(QShowEvent *)
void CrystalClient::Repaint() void CrystalClient::Repaint()
{ {
widget()->repaint(false); widget()->tqrepaint(false);
for (int n=0; n<ButtonTypeCount; n++) for (int n=0; n<ButtonTypeCount; n++)
if (button[n]) button[n]->reset(); if (button[n]) button[n]->reset();
} }
@ -1516,10 +1516,10 @@ void CrystalClient::maxButtonPressed()
{ {
switch (button[ButtonMax]->lastMousePress()) switch (button[ButtonMax]->lastMousePress())
{ {
case MidButton: case Qt::MidButton:
maximize(maximizeMode() ^ MaximizeVertical); maximize(maximizeMode() ^ MaximizeVertical);
break; break;
case RightButton: case Qt::RightButton:
maximize(maximizeMode() ^ MaximizeHorizontal); maximize(maximizeMode() ^ MaximizeHorizontal);
break; break;
default: default:
@ -1532,11 +1532,11 @@ void CrystalClient::minButtonPressed()
{ {
if (button[ButtonMin]) { if (button[ButtonMin]) {
switch (button[ButtonMin]->lastMousePress()) { switch (button[ButtonMin]->lastMousePress()) {
case MidButton:{ case Qt::MidButton:{
performWindowOperation(LowerOp); performWindowOperation(LowerOp);
break; break;
} }
case RightButton: case Qt::RightButton:
if (isShadeable()) setShade(!isShade()); if (isShadeable()) setShade(!isShade());
break; break;
default: default:
@ -1575,7 +1575,7 @@ void CrystalClient::closeButtonPressed()
{ {
if (button[ButtonClose]) if (button[ButtonClose])
switch (button[ButtonClose]->lastMousePress()) { switch (button[ButtonClose]->lastMousePress()) {
case RightButton: case Qt::RightButton:
{ {
Window frame,wrapper,client; Window frame,wrapper,client;
char param[20]; char param[20];
@ -1600,8 +1600,8 @@ void CrystalClient::shadeButtonPressed()
{ {
if (button[ButtonShade]) { if (button[ButtonShade]) {
switch (button[ButtonShade]->lastMousePress()) { switch (button[ButtonShade]->lastMousePress()) {
case MidButton: case Qt::MidButton:
case RightButton: case Qt::RightButton:
break; break;
default: default:
if (isShadeable()) setShade(!isShade()); if (isShadeable()) setShade(!isShade());
@ -1613,11 +1613,11 @@ void CrystalClient::menuButtonPressed()
{ {
if (!button[ButtonMenu])return; if (!button[ButtonMenu])return;
static QTime* t = 0; static TQTime* t = 0;
static CrystalClient* lastClient = 0; static CrystalClient* lastClient = 0;
if (t == 0) if (t == 0)
t = new QTime; t = new TQTime;
bool dbl = (lastClient == this && t->elapsed() <= QApplication::doubleClickInterval()); bool dbl = (lastClient == this && t->elapsed() <= TQApplication::doubleClickInterval());
lastClient = this; lastClient = this;
t->start(); t->start();
@ -1632,7 +1632,7 @@ void CrystalClient::menuButtonPressed()
void CrystalClient::menuPopUp() void CrystalClient::menuPopUp()
{ {
QPoint p(button[ButtonMenu]->rect().bottomLeft().x(), TQPoint p(button[ButtonMenu]->rect().bottomLeft().x(),
button[ButtonMenu]->rect().bottomLeft().y()+2); button[ButtonMenu]->rect().bottomLeft().y()+2);
KDecorationFactory* f = factory(); KDecorationFactory* f = factory();
showWindowMenu(button[ButtonMenu]->mapToGlobal(p)); showWindowMenu(button[ButtonMenu]->mapToGlobal(p));

@ -27,22 +27,22 @@
#ifndef CRYSTALCLIENT_H #ifndef CRYSTALCLIENT_H
#define CRYSTALCLIENT_H #define CRYSTALCLIENT_H
#include <qlayout.h> #include <tqlayout.h>
#include <kdecoration.h> #include <kdecoration.h>
#include <kdecorationfactory.h> #include <kdecorationfactory.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qptrlist.h> #include <tqptrlist.h>
#include <X11/Xlib.h> #include <X11/Xlib.h>
class QSpacerItem; class TQSpacerItem;
class QPoint; class TQPoint;
class CrystalClient; class CrystalClient;
class CrystalFactory; class CrystalFactory;
class CrystalButton; class CrystalButton;
class CrystalTray; class CrystalTray;
class QImageHolder; class TQImageHolder;
class ButtonImage; class ButtonImage;
extern CrystalFactory *factory; extern CrystalFactory *factory;
@ -58,9 +58,9 @@ struct WND_CONFIG
double amount; double amount;
int outlineMode,inlineMode; int outlineMode,inlineMode;
QColor frameColor,inlineColor; TQColor frameColor,inlineColor;
QPixmap overlay; TQPixmap overlay;
QImage userdefinedPicture; // Userdefined background image, instead of wallpaper TQImage userdefinedPicture; // Userdefined background image, instead of wallpaper
int blur; int blur;
}; };
@ -108,43 +108,44 @@ public:
virtual bool supports(Ability ability); virtual bool supports(Ability ability);
static bool initialized() { return initialized_; } static bool initialized() { return initialized_; }
static Qt::AlignmentFlags titleAlign() { return titlealign_; } static TQt::AlignmentFlags titleAlign() { return titlealign_; }
public: public:
QImageHolder *image_holder; TQImageHolder *image_holder;
QPixmap logo; TQPixmap logo;
int logoEnabled,logoStretch,logoActive,logoDistance; int logoEnabled,logoStretch,logoActive,logoDistance;
int titlesize; int titlesize;
bool hovereffect,tintButtons,animateHover,menuImage,wheelTask; bool hovereffect,tintButtons,animateHover,menuImage,wheelTask;
QColor buttonColor_normal,buttonColor_hovered,buttonColor_pressed; TQColor buttonColor_normal,buttonColor_hovered,buttonColor_pressed;
QColor minColor_normal,minColor_hovered,minColor_pressed; TQColor minColor_normal,minColor_hovered,minColor_pressed;
QColor maxColor_normal,maxColor_hovered,maxColor_pressed; TQColor maxColor_normal,maxColor_hovered,maxColor_pressed;
QColor closeColor_normal,closeColor_hovered,closeColor_pressed; TQColor closeColor_normal,closeColor_hovered,closeColor_pressed;
int borderwidth; int borderwidth;
bool drawcaption,textshadow,captiontooltip; bool drawcaption,textshadow,captiontooltip;
bool trackdesktop,transparency; bool trackdesktop,transparency;
int roundCorners; int roundCorners;
int repaintMode,repaintTime; int tqrepaintMode,tqrepaintTime;
WND_CONFIG active,inactive; WND_CONFIG active,inactive;
int buttontheme; int buttontheme;
ButtonImage *buttonImages[ButtonImageCount]; ButtonImage *buttonImages[ButtonImageCount];
QPtrList <CrystalClient> clients; TQPtrList <CrystalClient> clients;
private: private:
bool readConfig(); bool readConfig();
void CreateButtonImages(); void CreateButtonImages();
private: private:
static bool initialized_; static bool initialized_;
static Qt::AlignmentFlags titlealign_; static TQt::AlignmentFlags titlealign_;
}; };
class CrystalClient : public KDecoration class CrystalClient : public KDecoration
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
CrystalClient(KDecorationBridge *b,CrystalFactory *f); CrystalClient(KDecorationBridge *b,CrystalFactory *f);
virtual ~CrystalClient(); virtual ~CrystalClient();
@ -159,24 +160,24 @@ public:
virtual void shadeChange(); virtual void shadeChange();
virtual void borders(int &l, int &r, int &t, int &b) const; virtual void borders(int &l, int &r, int &t, int &b) const;
virtual void resize(const QSize &size); virtual void resize(const TQSize &size);
virtual QSize minimumSize() const; virtual TQSize tqminimumSize() const;
virtual Position mousePosition(const QPoint &point) const; virtual Position mousePosition(const TQPoint &point) const;
void ClientWindows(Window* frame,Window* wrapper,Window* client); void ClientWindows(Window* frame,Window* wrapper,Window* client);
private: private:
CrystalButton* addButtons(QBoxLayout* layout, const QString& buttons); CrystalButton* addButtons(TQBoxLayout* tqlayout, const TQString& buttons);
void updateMask(); void updateMask();
int borderSpacing(); int borderSpacing();
void updateLayout(); void updateLayout();
bool eventFilter(QObject *obj, QEvent *e); bool eventFilter(TQObject *obj, TQEvent *e);
void mouseDoubleClickEvent(QMouseEvent *e); void mouseDoubleClickEvent(TQMouseEvent *e);
void paintEvent(QPaintEvent *e); void paintEvent(TQPaintEvent *e);
void resizeEvent(QResizeEvent *); void resizeEvent(TQResizeEvent *);
void moveEvent(QMoveEvent *); void moveEvent(TQMoveEvent *);
void showEvent(QShowEvent *); void showEvent(TQShowEvent *);
void mouseWheelEvent(QWheelEvent *e); void mouseWheelEvent(TQWheelEvent *e);
private slots: private slots:
void Repaint(); void Repaint();
@ -193,12 +194,12 @@ private slots:
void menuPopUp(); void menuPopUp();
private: private:
CrystalButton *button[ButtonTypeCount]; CrystalButton *button[ButtonTypeCount];
QGridLayout *mainlayout; TQGridLayout *maintqlayout;
QHBoxLayout *titlelayout; TQHBoxLayout *titletqlayout;
QTimer timer; TQTimer timer;
public: public:
bool FullMax; bool FullMax;
QSpacerItem *titlebar_; TQSpacerItem *titlebar_;
}; };
#endif #endif

@ -20,35 +20,35 @@
#include <kapp.h> #include <kapp.h>
#include <qimage.h> #include <tqimage.h>
#include <kimageeffect.h> #include <kimageeffect.h>
#include <qapplication.h> #include <tqapplication.h>
#include <qdesktopwidget.h> #include <tqdesktopwidget.h>
#include "imageholder.h" #include "imageholder.h"
#include "crystalclient.h" #include "crystalclient.h"
QImageHolder::QImageHolder(QImage act,QImage inact) TQImageHolder::TQImageHolder(TQImage act,TQImage inact)
:img_active(NULL),img_inactive(NULL) :img_active(NULL),img_inactive(NULL)
{ {
rootpixmap=NULL; rootpixmap=NULL;
setUserdefinedPictures( act,inact); setUserdefinedPictures( act,inact);
initialized=userdefinedActive && userdefinedInactive; initialized=userdefinedActive && userdefinedInactive;
emit repaintNeeded(); emit tqrepaintNeeded();
} }
QImageHolder::~QImageHolder() TQImageHolder::~TQImageHolder()
{ {
if (rootpixmap)delete rootpixmap; if (rootpixmap)delete rootpixmap;
if (img_active && !userdefinedActive)delete img_active; if (img_active && !userdefinedActive)delete img_active;
if (img_inactive && !userdefinedInactive)delete img_inactive; if (img_inactive && !userdefinedInactive)delete img_inactive;
} }
void QImageHolder::setUserdefinedPictures( QImage act,QImage inact) void TQImageHolder::setUserdefinedPictures( TQImage act,TQImage inact)
{ {
int w=QApplication::desktop()->width(); int w=TQApplication::desktop()->width();
int h=QApplication::desktop()->height(); int h=TQApplication::desktop()->height();
if (img_active && !userdefinedActive) if (img_active && !userdefinedActive)
{ {
delete img_active; delete img_active;
@ -63,12 +63,12 @@ void QImageHolder::setUserdefinedPictures( QImage act,QImage inact)
if (!act.isNull()) if (!act.isNull())
{ {
act=act.smoothScale(w,h); act=act.smoothScale(w,h);
img_active=ApplyEffect(act,&::factory->active,factory->options()->colorGroup(KDecoration::ColorTitleBar, true)); img_active=ApplyEffect(act,&::factory->active,factory->options()->tqcolorGroup(KDecoration::ColorTitleBar, true));
}else img_active=NULL; }else img_active=NULL;
if (!inact.isNull()) if (!inact.isNull())
{ {
inact=inact.smoothScale(w,h); inact=inact.smoothScale(w,h);
img_inactive=ApplyEffect(inact,&::factory->inactive,factory->options()->colorGroup(KDecoration::ColorTitleBar, false)); img_inactive=ApplyEffect(inact,&::factory->inactive,factory->options()->tqcolorGroup(KDecoration::ColorTitleBar, false));
}else img_inactive=NULL; }else img_inactive=NULL;
userdefinedActive=(img_active!=NULL); userdefinedActive=(img_active!=NULL);
@ -77,31 +77,31 @@ void QImageHolder::setUserdefinedPictures( QImage act,QImage inact)
CheckSanity(); CheckSanity();
} }
void QImageHolder::Init() void TQImageHolder::Init()
{ {
if (initialized)return; if (initialized)return;
rootpixmap=new KMyRootPixmap(NULL/*,this*/); rootpixmap=new KMyRootPixmap(NULL/*,this*/);
rootpixmap->start(); rootpixmap->start();
rootpixmap->repaint(true); rootpixmap->tqrepaint(true);
connect( rootpixmap,SIGNAL(backgroundUpdated(const QImage*)),this, SLOT(BackgroundUpdated(const QImage*))); connect( rootpixmap,TQT_SIGNAL(backgroundUpdated(const TQImage*)),this, TQT_SLOT(BackgroundUpdated(const TQImage*)));
connect(kapp, SIGNAL(backgroundChanged(int)),SLOT(handleDesktopChanged(int))); connect(kapp, TQT_SIGNAL(backgroundChanged(int)),TQT_SLOT(handleDesktopChanged(int)));
initialized=true; initialized=true;
} }
void QImageHolder::repaint(bool force) void TQImageHolder::tqrepaint(bool force)
{ {
Init(); Init();
if (rootpixmap)rootpixmap->repaint(force); if (rootpixmap)rootpixmap->tqrepaint(force);
} }
void QImageHolder::handleDesktopChanged(int) void TQImageHolder::handleDesktopChanged(int)
{ {
repaint(true); tqrepaint(true);
} }
void QImageHolder::CheckSanity() void TQImageHolder::CheckSanity()
{ {
if (!initialized)return; if (!initialized)return;
if (userdefinedActive && userdefinedInactive)return; if (userdefinedActive && userdefinedInactive)return;
@ -114,13 +114,13 @@ void QImageHolder::CheckSanity()
initialized=false; initialized=false;
} }
QPixmap* QImageHolder::ApplyEffect(QImage &src,WND_CONFIG* cfg,QColorGroup colorgroup) TQPixmap* TQImageHolder::ApplyEffect(TQImage &src,WND_CONFIG* cfg,TQColorGroup colorgroup)
{ {
QImage dst; TQImage dst;
switch(cfg->mode) switch(cfg->mode)
{ {
case 0: if (cfg->amount>0.99)return new QPixmap(); case 0: if (cfg->amount>0.99)return new TQPixmap();
dst=KImageEffect::fade(src, cfg->amount, colorgroup.background()); dst=KImageEffect::fade(src, cfg->amount, colorgroup.background());
break; break;
case 1:dst=KImageEffect::channelIntensity(src,cfg->amount,KImageEffect::All); case 1:dst=KImageEffect::channelIntensity(src,cfg->amount,KImageEffect::All);
@ -139,10 +139,10 @@ QPixmap* QImageHolder::ApplyEffect(QImage &src,WND_CONFIG* cfg,QColorGroup color
if (cfg->blur>0)dst=KImageEffect::blur(dst,0,cfg->blur); if (cfg->blur>0)dst=KImageEffect::blur(dst,0,cfg->blur);
return new QPixmap(dst); return new TQPixmap(dst);
} }
void QImageHolder::BackgroundUpdated(const QImage *src) void TQImageHolder::BackgroundUpdated(const TQImage *src)
{ {
if (img_active && !userdefinedActive) if (img_active && !userdefinedActive)
{ {
@ -157,15 +157,15 @@ void QImageHolder::BackgroundUpdated(const QImage *src)
if (src && !src->isNull()) if (src && !src->isNull())
{ {
QImage tmp=src->copy(); TQImage tmp=src->copy();
if (!userdefinedInactive) if (!userdefinedInactive)
img_inactive=ApplyEffect(tmp,&::factory->inactive,factory->options()->colorGroup(KDecoration::ColorTitleBar, false)); img_inactive=ApplyEffect(tmp,&::factory->inactive,factory->options()->tqcolorGroup(KDecoration::ColorTitleBar, false));
tmp=src->copy(); tmp=src->copy();
if (!userdefinedActive) if (!userdefinedActive)
img_active=ApplyEffect(tmp,&::factory->active,factory->options()->colorGroup(KDecoration::ColorTitleBar, true)); img_active=ApplyEffect(tmp,&::factory->active,factory->options()->tqcolorGroup(KDecoration::ColorTitleBar, true));
} }
emit repaintNeeded(); emit tqrepaintNeeded();
} }

@ -28,34 +28,35 @@
struct WND_CONFIG; struct WND_CONFIG;
class QImageHolder:public QObject class TQImageHolder:public TQObject
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
QImageHolder(QImage act,QImage inact); TQImageHolder(TQImage act,TQImage inact);
virtual ~QImageHolder(); virtual ~TQImageHolder();
void Init(); void Init();
QPixmap *image(bool active) { Init(); return active?img_active:img_inactive; } TQPixmap *image(bool active) { Init(); return active?img_active:img_inactive; }
void repaint(bool force); void tqrepaint(bool force);
void setUserdefinedPictures(QImage act,QImage inact); void setUserdefinedPictures(TQImage act,TQImage inact);
private: private:
bool initialized; bool initialized;
KMyRootPixmap *rootpixmap; KMyRootPixmap *rootpixmap;
QPixmap *img_active,*img_inactive; TQPixmap *img_active,*img_inactive;
bool userdefinedActive,userdefinedInactive; bool userdefinedActive,userdefinedInactive;
QPixmap* ApplyEffect(QImage &src,WND_CONFIG* cfg,QColorGroup colorgroup); TQPixmap* ApplyEffect(TQImage &src,WND_CONFIG* cfg,TQColorGroup colorgroup);
public slots: public slots:
void BackgroundUpdated(const QImage *); void BackgroundUpdated(const TQImage *);
void handleDesktopChanged(int desk); void handleDesktopChanged(int desk);
void CheckSanity(); void CheckSanity();
signals: signals:
void repaintNeeded(); void tqrepaintNeeded();
}; };

@ -12,12 +12,12 @@
/* Modified by Sascha Hlusiak */ /* Modified by Sascha Hlusiak */
#include <qwidget.h> #include <tqwidget.h>
#include <qtimer.h> #include <tqtimer.h>
#include <qrect.h> #include <tqrect.h>
#include <qimage.h> #include <tqimage.h>
#ifndef Q_WS_QWS //FIXME #ifndef TQ_WS_TQWS //FIXME
#include <kapplication.h> #include <kapplication.h>
#include <kimageeffect.h> #include <kimageeffect.h>
#include <kpixmapio.h> #include <kpixmapio.h>
@ -25,21 +25,21 @@
#include <kdebug.h> #include <kdebug.h>
#include <netwm.h> #include <netwm.h>
#include <dcopclient.h> #include <dcopclient.h>
#include <qpainter.h> #include <tqpainter.h>
#include <ksharedpixmap.h> #include <ksharedpixmap.h>
#include "myrootpixmap.h" #include "myrootpixmap.h"
KMyRootPixmap::KMyRootPixmap( QWidget * widget, const char *name ) KMyRootPixmap::KMyRootPixmap( TQWidget * widget, const char *name )
: QObject(widget, name ? name : "KMyRootPixmap" ) : TQObject(widget, name ? name : "KMyRootPixmap" )
{ {
init(); init();
} }
KMyRootPixmap::KMyRootPixmap( QWidget *, QObject *parent, const char *name ) KMyRootPixmap::KMyRootPixmap( TQWidget *, TQObject *tqparent, const char *name )
: QObject( parent, name ? name : "KMyRootPixmap" ) : TQObject( tqparent, name ? name : "KMyRootPixmap" )
{ {
init(); init();
} }
@ -49,17 +49,17 @@ void KMyRootPixmap::init()
// d = new KMyRootPixmapData; // d = new KMyRootPixmapData;
// m_Fade = 0; // m_Fade = 0;
m_pPixmap = new KSharedPixmap; m_pPixmap = new KSharedPixmap;
// m_pTimer = new QTimer( this ); // m_pTimer = new TQTimer( this );
m_bInit = false; m_bInit = false;
m_bActive = false; m_bActive = false;
m_Desk=-1; m_Desk=-1;
// m_bCustomPaint = false; // m_bCustomPaint = false;
// connect(kapp, SIGNAL(backgroundChanged(int)), SLOT(slotBackgroundChanged(int))); // connect(kapp, TQT_SIGNAL(backgroundChanged(int)), TQT_SLOT(slotBackgroundChanged(int)));
connect(m_pPixmap, SIGNAL(done(bool)), SLOT(slotDone(bool))); connect(m_pPixmap, TQT_SIGNAL(done(bool)), TQT_SLOT(slotDone(bool)));
// connect(m_pTimer, SIGNAL(timeout()), SLOT(repaint())); // connect(m_pTimer, TQT_SIGNAL(timeout()), TQT_SLOT(tqrepaint()));
// d->toplevel = m_pWidget->topLevelWidget(); // d->toplevel = m_pWidget->tqtopLevelWidget();
// d->toplevel->installEventFilter(this); // d->toplevel->installEventFilter(this);
} }
@ -85,7 +85,7 @@ void KMyRootPixmap::start()
enableExports(); enableExports();
return; return;
// if (m_bInit) // if (m_bInit)
// repaint(true); // tqrepaint(true);
} }
void KMyRootPixmap::stop() void KMyRootPixmap::stop()
@ -95,14 +95,14 @@ void KMyRootPixmap::stop()
} }
void KMyRootPixmap::repaint() void KMyRootPixmap::tqrepaint()
{ {
repaint(false); tqrepaint(false);
} }
void KMyRootPixmap::repaint(bool force) void KMyRootPixmap::tqrepaint(bool force)
{ {
// printf("KMyRootPixmap::repaint(%s)\n",force?"true":"false"); // printf("KMyRootPixmap::tqrepaint(%s)\n",force?"true":"false");
if ((!force) && (m_Desk==currentDesktop()))return; if ((!force) && (m_Desk==currentDesktop()))return;
m_Desk = currentDesktop(); m_Desk = currentDesktop();
@ -122,14 +122,14 @@ bool KMyRootPixmap::isAvailable()
return m_pPixmap->isAvailable(pixmapName(m_Desk)); return m_pPixmap->isAvailable(pixmapName(m_Desk));
} }
QString KMyRootPixmap::pixmapName(int desk) TQString KMyRootPixmap::pixmapName(int desk)
{ {
QString pattern = QString("DESKTOP%1"); TQString pattern = TQString("DESKTOP%1");
int screen_number = DefaultScreen(qt_xdisplay()); int screen_number = DefaultScreen(qt_xdisplay());
if (screen_number) { if (screen_number) {
pattern = QString("SCREEN%1-DESKTOP").arg(screen_number) + "%1"; pattern = TQString("SCREEN%1-DESKTOP").tqarg(screen_number) + "%1";
} }
return pattern.arg( desk ); return pattern.tqarg( desk );
} }
@ -139,11 +139,11 @@ void KMyRootPixmap::enableExports()
DCOPClient *client = kapp->dcopClient(); DCOPClient *client = kapp->dcopClient();
if (!client->isAttached()) if (!client->isAttached())
client->attach(); client->attach();
QByteArray data; TQByteArray data;
QDataStream args( data, IO_WriteOnly ); TQDataStream args( data, IO_WriteOnly );
args << 1; args << 1;
QCString appname( "kdesktop" ); TQCString appname( "kdesktop" );
int screen_number = DefaultScreen(qt_xdisplay()); int screen_number = DefaultScreen(qt_xdisplay());
if ( screen_number ) if ( screen_number )
appname.sprintf("kdesktop-screen-%d", screen_number ); appname.sprintf("kdesktop-screen-%d", screen_number );
@ -169,29 +169,29 @@ void KMyRootPixmap::slotDone(bool success)
void KMyRootPixmap::updateBackground( KSharedPixmap *spm ) void KMyRootPixmap::updateBackground( KSharedPixmap *spm )
{ {
// printf("KMyRootPixmap::updateBackground(%p)\n",spm); // printf("KMyRootPixmap::updateBackground(%p)\n",spm);
QPixmap *px=spm; TQPixmap *px=spm;
if (px->isNull() || px->width()==0 || px->height()==0) if (px->isNull() || px->width()==0 || px->height()==0)
{ // This is NOT an image, something went wrong, update to plain { // This is NOT an image, something went wrong, update to plain
emit backgroundUpdated(NULL); emit backgroundUpdated(NULL);
return; return;
} }
KPixmapIO io; KPixmapIO io;
QSize desktopsize(QApplication::desktop()->width(),QApplication::desktop()->height()); TQSize desktopsize(TQApplication::desktop()->width(),TQApplication::desktop()->height());
if (px->rect().size()==desktopsize) if (px->rect().size()==desktopsize)
{ // Image has already the right dimension, make a quick update { // Image has already the right dimension, make a quick update
QImage img = io.convertToImage(*spm); TQImage img = io.convertToImage(*spm);
emit backgroundUpdated(&img); emit backgroundUpdated(&img);
return; return;
}else{ // we need to create a tiled pixmap and then the image to update }else{ // we need to create a tiled pixmap and then the image to update
QPixmap pix(desktopsize,spm->depth()); TQPixmap pix(desktopsize,spm->TQPixmap::depth());
QPainter pufferPainter(&pix); TQPainter pufferPainter(&pix);
pufferPainter.drawTiledPixmap(pix.rect(),*spm); pufferPainter.drawTiledPixmap(pix.rect(),*spm);
pufferPainter.end(); pufferPainter.end();
QImage img=io.convertToImage(pix); TQImage img=io.convertToImage(pix);
emit backgroundUpdated(&img); emit backgroundUpdated(&img);
} }
} }

@ -14,25 +14,26 @@
#ifndef __KRootPixmap_h_Included__ #ifndef __KRootPixmap_h_Included__
#define __KRootPixmap_h_Included__ #define __KRootPixmap_h_Included__
#include <qobject.h> #include <tqobject.h>
#include <qcolor.h> #include <tqcolor.h>
#ifndef Q_WS_QWS //FIXME #ifndef TQ_WS_TQWS //FIXME
class QRect; class TQRect;
class QWidget; class TQWidget;
class QTimer; class TQTimer;
class KSharedPixmap; class KSharedPixmap;
class KMyRootPixmapData; class KMyRootPixmapData;
class KMyRootPixmap: public QObject class KMyRootPixmap: public TQObject
{ {
Q_OBJECT Q_OBJECT
TQ_OBJECT
public: public:
KMyRootPixmap( QWidget *target=NULL, const char *name=0 ); KMyRootPixmap( TQWidget *target=NULL, const char *name=0 );
KMyRootPixmap( QWidget *target, QObject *parent, const char *name=0 ); KMyRootPixmap( TQWidget *target, TQObject *tqparent, const char *name=0 );
virtual ~KMyRootPixmap(); virtual ~KMyRootPixmap();
@ -54,23 +55,23 @@ public slots:
virtual void stop(); virtual void stop();
// void setFadeEffect(double strength, const QColor &color); // void setFadeEffect(double strength, const TQColor &color);
void repaint( bool force ); void tqrepaint( bool force );
void repaint(); void tqrepaint();
// void setCustomPainting( bool enable ) { m_bCustomPaint = enable; } // void setCustomPainting( bool enable ) { m_bCustomPaint = enable; }
void enableExports(); void enableExports();
static QString pixmapName(int desk); static TQString pixmapName(int desk);
signals: signals:
void backgroundUpdated( const QImage *pm ); void backgroundUpdated( const TQImage *pm );
protected: protected:
// virtual bool eventFilter(QObject *, QEvent *); // virtual bool eventFilter(TQObject *, TQEvent *);
virtual void updateBackground( KSharedPixmap * ); virtual void updateBackground( KSharedPixmap * );
@ -83,16 +84,16 @@ private:
int m_Desk; int m_Desk;
// double m_Fade; // double m_Fade;
// QColor m_FadeColor; // TQColor m_FadeColor;
QRect m_Rect; TQRect m_Rect;
// QWidget *m_pWidget; // TQWidget *m_pWidget;
// QTimer *m_pTimer; // TQTimer *m_pTimer;
KSharedPixmap *m_pPixmap; KSharedPixmap *m_pPixmap;
// KMyRootPixmapData *d; // KMyRootPixmapData *d;
void init(); void init();
}; };
#endif // ! Q_WS_QWS #endif // ! TQ_WS_TQWS
#endif // __KRootPixmap_h_Included__ #endif // __KRootPixmap_h_Included__

@ -23,12 +23,12 @@
/* Taken from nVIDIA KWin sources and modified by Sascha Hlusiak, 2006 */ /* Taken from nVIDIA KWin sources and modified by Sascha Hlusiak, 2006 */
#include <qimage.h> #include <tqimage.h>
#include <qtextstream.h> #include <tqtextstream.h>
#include <qregexp.h> #include <tqregexp.h>
#include <qfile.h> #include <tqfile.h>
#include <qfileinfo.h> #include <tqfileinfo.h>
#include <qdatetime.h> #include <tqdatetime.h>
#include <iostream> #include <iostream>
@ -41,11 +41,11 @@ static int primes[] = {
}; };
struct EmbedImage { struct EmbedImage {
QString string; TQString string;
int width; int width;
int height; int height;
bool alpha; bool alpha;
QString name; TQString name;
}; };
class nVIDIAEmbedder { class nVIDIAEmbedder {
@ -57,21 +57,21 @@ public:
void writeIndex(); void writeIndex();
private: private:
QFile *file; TQFile *file;
QPtrList<EmbedImage> *index; TQPtrList<EmbedImage> *index;
QTextStream stream; TQTextStream stream;
}; };
nVIDIAEmbedder::nVIDIAEmbedder() nVIDIAEmbedder::nVIDIAEmbedder()
{ {
QDateTime date( QDateTime::currentDateTime() ); TQDateTime date( TQDateTime::tqcurrentDateTime() );
QString datestring( date.toString() ); TQString datestring( date.toString() );
// file = new QFile( "tiles.h" ); // file = new TQFile( "tiles.h" );
file = new QFile(); file = new TQFile();
file->open( IO_WriteOnly | IO_Truncate ,stdout); file->open( IO_WriteOnly | IO_Truncate ,stdout);
stream.setDevice( file ); stream.setDevice( TQT_TQIODEVICE(file) );
#if (0) #if (0)
stream << "/*\n"; stream << "/*\n";
@ -80,12 +80,12 @@ nVIDIAEmbedder::nVIDIAEmbedder()
stream << "#ifndef __TILES_H\n"; stream << "#ifndef __TILES_H\n";
stream << "#define __TILES_H\n\n"; stream << "#define __TILES_H\n\n";
stream << "#include <qimage.h>\n"; stream << "#include <tqimage.h>\n";
stream << "#include <qdict.h>\n\n"; stream << "#include <tqdict.h>\n\n";
stream << "namespace nVIDIA {\n\n"; stream << "namespace nVIDIA {\n\n";
#endif #endif
index = new QPtrList<EmbedImage>; index = new TQPtrList<EmbedImage>;
index->setAutoDelete( true ); index->setAutoDelete( true );
} }
@ -104,24 +104,24 @@ nVIDIAEmbedder::~nVIDIAEmbedder()
void nVIDIAEmbedder::embed( const char *name ) void nVIDIAEmbedder::embed( const char *name )
{ {
QFileInfo fileinfo( name ); TQFileInfo fileinfo( name );
QString basename( fileinfo.baseName() ); TQString basename( fileinfo.baseName() );
QString codename( basename ); TQString codename( basename );
QImage image( name ); TQImage image( name );
codename = codename.replace( QRegExp("[^a-zA-Z0-9]"), "_" ); codename = codename.tqreplace( TQRegExp("[^a-zA-Z0-9]"), "_" );
stream << "static const QRgb " << codename << "_data[] = {" << endl << "\t"; stream << "static const TQRgb " << codename << "_data[] = {" << endl << "\t";
stream.setf( QTextStream::hex | QTextStream::right ); stream.setf( TQTextStream::hex | TQTextStream::right );
stream.fill( '0' ); stream.fill( '0' );
int pixels = image.width() * image.height(); int pixels = image.width() * image.height();
Q_UINT32 *data = reinterpret_cast<Q_UINT32*>( image.bits() ); TQ_UINT32 *data = reinterpret_cast<TQ_UINT32*>( image.bits() );
bool hasAlpha = false; bool hasAlpha = false;
for ( int i = 0, j = 0; i < pixels; i++ ) { for ( int i = 0, j = 0; i < pixels; i++ ) {
if ( qAlpha( *data ) && qAlpha( *data ) != 0xff ) if ( tqAlpha( *data ) && tqAlpha( *data ) != 0xff )
hasAlpha = true; hasAlpha = true;
stream << "0x" << qSetW(8) << *(data++); stream << "0x" << qSetW(8) << *(data++);
@ -157,7 +157,7 @@ void nVIDIAEmbedder::writeIndex()
stream << "\t\tint width;\n"; stream << "\t\tint width;\n";
stream << "\t\tint height;\n"; stream << "\t\tint height;\n";
stream << "\t\tbool alpha;\n"; stream << "\t\tbool alpha;\n";
stream << "\t\tconst QRgb *data;\n"; stream << "\t\tconst TQRgb *data;\n";
stream << "\t};\n\n"; stream << "\t};\n\n";
uint i = 0; uint i = 0;
@ -183,14 +183,14 @@ void nVIDIAEmbedder::writeIndex()
stream << "\tclass nVIDIAImageDb {\n"; stream << "\tclass nVIDIAImageDb {\n";
stream << "\tprivate:\n"; stream << "\tprivate:\n";
stream << "\t\tstatic nVIDIAImageDb *m_inst;\n"; stream << "\t\tstatic nVIDIAImageDb *m_inst;\n";
stream << "\t\tQDict<QImage> *db;\n\n"; stream << "\t\tTQDict<TQImage> *db;\n\n";
stream << "\t\tnVIDIAImageDb() {\n"; stream << "\t\tnVIDIAImageDb() {\n";
stream << "\t\t\tdb = new QDict<QImage>( " << prime << " );\n"; stream << "\t\t\tdb = new TQDict<TQImage>( " << prime << " );\n";
stream << "\t\t\tdb->setAutoDelete( true );\n\n"; stream << "\t\t\tdb->setAutoDelete( true );\n\n";
stream << "\t\t\tfor ( int i = 0; i < " << index->count() << "; i++ ) {\n"; stream << "\t\t\tfor ( int i = 0; i < " << index->count() << "; i++ ) {\n";
stream << "\t\t\t\tQImage *img = new QImage( (uchar*)image_db[i].data,\n"; stream << "\t\t\t\tTQImage *img = new TQImage( (uchar*)image_db[i].data,\n";
stream << "\t\t\t\t\t\timage_db[i].width, image_db[i].height,\n"; stream << "\t\t\t\t\t\timage_db[i].width, image_db[i].height,\n";
stream << "\t\t\t\t\t\t32, NULL, 0, QImage::LittleEndian );\n\n"; stream << "\t\t\t\t\t\t32, NULL, 0, TQImage::LittleEndian );\n\n";
stream << "\t\t\t\tif ( image_db[i].alpha )\n"; stream << "\t\t\t\tif ( image_db[i].alpha )\n";
stream << "\t\t\t\t\timg->setAlphaBuffer( true );\n\n"; stream << "\t\t\t\t\timg->setAlphaBuffer( true );\n\n";
stream << "\t\t\t\tdb->insert( image_db[i].name, img );\n"; stream << "\t\t\t\tdb->insert( image_db[i].name, img );\n";
@ -208,8 +208,8 @@ void nVIDIAEmbedder::writeIndex()
stream << "\t\t\tif ( m_inst ) delete m_inst;\n"; stream << "\t\t\tif ( m_inst ) delete m_inst;\n";
stream << "\t\t\tm_inst = NULL;\n"; stream << "\t\t\tm_inst = NULL;\n";
stream << "\t\t}\n\n"; stream << "\t\t}\n\n";
stream << "\t\tQImage *image( const QString &name ) const {\n"; stream << "\t\tTQImage *image( const TQString &name ) const {\n";
stream << "\t\t\treturn db->find( name );\n"; stream << "\t\t\treturn db->tqfind( name );\n";
stream << "\t\t}\n\n"; stream << "\t\t}\n\n";
stream << "\t}; // class nVIDIAImageDb\n\n"; stream << "\t}; // class nVIDIAImageDb\n\n";
stream << "\tnVIDIAImageDb *nVIDIAImageDb::m_inst = NULL;\n\n"; stream << "\tnVIDIAImageDb *nVIDIAImageDb::m_inst = NULL;\n\n";

Loading…
Cancel
Save