Browse Source

Initial TQt conversion

Signed-off-by: Slávek Banko <slavek.banko@axis.cz>
pull/1/head
Slávek Banko 6 years ago
parent
commit
2ee99ab520
  1. 2
      README
  2. 44
      bab/bab.h
  3. 10
      bab/bab_iface.h
  4. 188
      bab/main.cpp
  5. 2
      bab/styleconfdialog.cpp
  6. 2
      bab/styleconfdialog.h
  7. 42
      config/about.ui
  8. 132
      config/colordialog.cpp
  9. 68
      config/colordialog.h
  10. 24
      config/colorpicker.cpp
  11. 18
      config/colorpicker.h
  12. 352
      config/configdialog.ui
  13. 24
      config/help.ui
  14. 396
      config/kstyle_baghira_config.cpp
  15. 88
      config/kstyle_baghira_config.h
  16. 570
      deco/baghiraclient.cc
  17. 136
      deco/baghiraclient.h
  18. 42
      deco/config/aquariusbutton.cc
  19. 30
      deco/config/aquariusbutton.h
  20. 210
      deco/config/baghiraconfig.cc
  21. 210
      deco/config/baghiraconfig.cc.new
  22. 44
      deco/config/baghiraconfig.h
  23. 48
      deco/config/baghiraconfig.h.new
  24. 54
      deco/config/colorpicker.cc
  25. 38
      deco/config/colorpicker.h
  26. 338
      deco/config/configdialog.ui
  27. 52
      deco/config/configdialog.ui.new
  28. 60
      deco/config/customdecosettings.ui
  29. 102
      kickermenu-3.3/menuapplet.cpp
  30. 26
      kickermenu-3.3/menuapplet.h
  31. 130
      kickermenu/menuapplet.cpp
  32. 28
      kickermenu/menuapplet.h
  33. 46
      sessionapplet/dmctl.cpp
  34. 18
      sessionapplet/dmctl.h
  35. 38
      sessionapplet/usermanager.cpp
  36. 30
      sessionapplet/usermanager.h
  37. 16
      sidebar/baghirasidebar.cpp
  38. 12
      sidebar/baghirasidebar.h
  39. 6
      sidebar/baghirasidebariface.h
  40. 220
      sidebar/dndlistbox.cpp
  41. 88
      sidebar/dndlistbox.h
  42. 14
      sidebar/linkconfig.ui
  43. 84
      sidebar/linkview.cpp
  44. 12
      sidebar/linkview.h
  45. 30
      sidebar/listboxlink.cpp
  46. 44
      sidebar/listboxlink.h
  47. 56
      starter/baghiralinkdrag.cpp
  48. 16
      starter/baghiralinkdrag.h
  49. 44
      starter/config.ui
  50. 6
      starter/help.ui
  51. 16
      starter/linkconfig.ui
  52. 720
      starter/menu.cpp
  53. 226
      starter/menu.h
  54. 36
      starter/mykey.h
  55. 130
      starter/starter.cpp
  56. 32
      starter/starter.h
  57. 92
      starter/starterconfig.ui
  58. 16
      starter/starterhelp.ui
  59. 930
      style/baghira.cpp
  60. 300
      style/baghira.h
  61. 580
      style/eventfilter.cpp
  62. 100
      style/optionHandler.cpp
  63. 510
      style/polish.cpp
  64. 360
      style/utils.cpp

2
README

@ -22,7 +22,7 @@ will fix the horizontal slider problem, rotating pixmaps in general
0.8
----
after a long time, this is a snapshot of the current cvs version and probably the last baghira for Qt3 ever.
after a long time, this is a snapshot of the current cvs version and probably the last baghira for TQt3 ever.
there won't be Baghira for Qt4, don't ask.
- several bugfixes, minor changes, whatever.

44
bab/bab.h

@ -26,9 +26,9 @@
#endif
//#include <dcopclient.h>
#include "bab_iface.h"
#include <qwidget.h>
#include <qpixmap.h>
#include <qsettings.h>
#include <tqwidget.h>
#include <tqpixmap.h>
#include <tqsettings.h>
#include <kmainwindow.h>
#include <ksystemtray.h>
@ -44,32 +44,32 @@ public:
~BabSwitcher();
void toggle();
void setStyle(QString);
QString style();
void setDeco(QString);
QString deco();
void start(QString name, QString settings);
void setStyle(TQString);
TQString style();
void setDeco(TQString);
TQString deco();
void start(TQString name, TQString settings);
void emitStyleChanged();
static QPoint *globalPos;
static TQPoint *globalPos;
protected:
void mousePressEvent(QMouseEvent *e);
void paintEvent(QPaintEvent *ev);
void mousePressEvent(TQMouseEvent *e);
void paintEvent(TQPaintEvent *ev);
private:
int state_;
int decoState_;
QPixmap JaguarIcon;
QPixmap PantherIcon;
QPixmap iTunesIcon;
QPixmap TigerIcon;
QPixmap MilkIcon;
TQPixmap JaguarIcon;
TQPixmap PantherIcon;
TQPixmap iTunesIcon;
TQPixmap TigerIcon;
TQPixmap MilkIcon;
};
class QComboBox;
class QCheckBox;
class TQComboBox;
class TQCheckBox;
/**
* @short Application Main Window
* @author Thomas Lübking <baghira-style@gmx.net>
@ -82,12 +82,12 @@ public:
enum TabState {Tab = 0, Clever, Chooser};
bab();
void showEvent(QShowEvent *e);
QCheckBox *cornerCheck;
void showEvent(TQShowEvent *e);
TQCheckBox *cornerCheck;
virtual ~bab();
private:
BabSwitcher* bSwitcher;
QComboBox *DefStyle;
TQComboBox *DefStyle;
private slots:
void saveSettings();
@ -95,7 +95,7 @@ private slots:
};
class Corner : public QWidget
class Corner : public TQWidget
{
Q_OBJECT
public:

10
bab/bab_iface.h

@ -29,11 +29,11 @@ class babInterface : virtual public DCOPObject
k_dcop:
virtual void toggle() = 0;
virtual QString style() = 0;
virtual void setStyle(QString state) = 0;
virtual QString deco() = 0;
virtual void setDeco(QString state) = 0;
virtual void start(QString name, QString settings) = 0;
virtual TQString style() = 0;
virtual void setStyle(TQString state) = 0;
virtual TQString deco() = 0;
virtual void setDeco(TQString state) = 0;
virtual void start(TQString name, TQString settings) = 0;
virtual void emitStyleChanged() = 0;
};

188
bab/main.cpp

@ -19,17 +19,17 @@
***************************************************************************/
#include "bab.h"
#include <qpushbutton.h>
#include <qcheckbox.h>
#include <qcombobox.h>
#include <qdir.h>
#include <qlayout.h>
#include <qsettings.h>
#include <qtabwidget.h>
#include <qtooltip.h>
#include <qtimer.h>
#include <qvbox.h>
#include <qpainter.h>
#include <tqpushbutton.h>
#include <tqcheckbox.h>
#include <tqcombobox.h>
#include <tqdir.h>
#include <tqlayout.h>
#include <tqsettings.h>
#include <tqtabwidget.h>
#include <tqtooltip.h>
#include <tqtimer.h>
#include <tqvbox.h>
#include <tqpainter.h>
#include <dcopclient.h>
#include <kapplication.h>
// #include <kconfig.h>
@ -94,20 +94,20 @@ int main(int argc, char **argv)
}
bab::bab() : KMainWindow(0,"bab",Qt::WStyle_StaysOnTop | Qt::WX11BypassWM ){
bab::bab() : KMainWindow(0,"bab",TQt::WStyle_StaysOnTop | TQt::WX11BypassWM ){
bSwitcher = new BabSwitcher(this,"switcher");
QToolTip::add(bSwitcher, i18n("leftclick toggles state<br>rightclick toggles setupmenu"));
TQToolTip::add(bSwitcher, i18n("leftclick toggles state<br>rightclick toggles setupmenu"));
bSwitcher->show();
QDir d( QDir::homeDirPath() + "/.baghira");
TQDir d( TQDir::homeDirPath() + "/.baghira");
if (!d.exists())
d.mkdir(QDir::homeDirPath() + "/.baghira");
d = QDir( QDir::homeDirPath() + "/.baghira/.bab");
d.mkdir(TQDir::homeDirPath() + "/.baghira");
d = TQDir( TQDir::homeDirPath() + "/.baghira/.bab");
if (!d.exists())
d.mkdir(QDir::homeDirPath() + "/.baghira/.bab");
d.mkdir(TQDir::homeDirPath() + "/.baghira/.bab");
FILE *file = NULL;
QString tmpString = QDir::homeDirPath() + "/.baghira/Jaguar";
if (!QFile::exists(tmpString))
TQString tmpString = TQDir::homeDirPath() + "/.baghira/Jaguar";
if (!TQFile::exists(tmpString))
{
if( (file = fopen(tmpString.latin1(), "w")) != NULL )
{
@ -115,8 +115,8 @@ bab::bab() : KMainWindow(0,"bab",Qt::WStyle_StaysOnTop | Qt::WX11BypassWM ){
fclose(file);
}
}
tmpString = QDir::homeDirPath() + "/.baghira/Panther";
if (!QFile::exists(tmpString))
tmpString = TQDir::homeDirPath() + "/.baghira/Panther";
if (!TQFile::exists(tmpString))
{
if( (file = fopen(tmpString.latin1(), "w")) != NULL )
{
@ -124,8 +124,8 @@ bab::bab() : KMainWindow(0,"bab",Qt::WStyle_StaysOnTop | Qt::WX11BypassWM ){
fclose(file);
}
}
tmpString = QDir::homeDirPath() + "/.baghira/Brushed";
if (!QFile::exists(tmpString))
tmpString = TQDir::homeDirPath() + "/.baghira/Brushed";
if (!TQFile::exists(tmpString))
{
if( (file = fopen(tmpString.latin1(), "w")) != NULL )
{
@ -133,8 +133,8 @@ bab::bab() : KMainWindow(0,"bab",Qt::WStyle_StaysOnTop | Qt::WX11BypassWM ){
fclose(file);
}
}
tmpString = QDir::homeDirPath() + "/.baghira/Tiger";
if (!QFile::exists(tmpString))
tmpString = TQDir::homeDirPath() + "/.baghira/Tiger";
if (!TQFile::exists(tmpString))
{
if( (file = fopen(tmpString.latin1(), "w")) != NULL )
{
@ -142,8 +142,8 @@ bab::bab() : KMainWindow(0,"bab",Qt::WStyle_StaysOnTop | Qt::WX11BypassWM ){
fclose(file);
}
}
tmpString = QDir::homeDirPath() + "/.baghira/Milk";
if (!QFile::exists(tmpString))
tmpString = TQDir::homeDirPath() + "/.baghira/Milk";
if (!TQFile::exists(tmpString))
{
if( (file = fopen(tmpString.latin1(), "w")) != NULL )
{
@ -152,27 +152,27 @@ bab::bab() : KMainWindow(0,"bab",Qt::WStyle_StaysOnTop | Qt::WX11BypassWM ){
}
}
QVBox *vb = new QVBox(this);
TQVBox *vb = new TQVBox(this);
vb->setLineWidth(2);
vb->setMargin(2);
// vb->setFrameStyle(QFrame::Panel | QFrame::Plain );
// vb->setFrameStyle(TQFrame::Panel | TQFrame::Plain );
QLabel *DefStyleLabel = new QLabel("Default Style is", vb);
DefStyle = new QComboBox(vb);
TQLabel *DefStyleLabel = new TQLabel("Default Style is", vb);
DefStyle = new TQComboBox(vb);
DefStyle->insertItem ( "Jaguar" );
DefStyle->insertItem ( "Panther" );
DefStyle->insertItem ( "Brushed" );
DefStyle->insertItem ( "Tiger" );
DefStyle->insertItem ( "Milk" );
cornerCheck = new QCheckBox("Round upper screen corners", vb);
QSettings config;
cornerCheck = new TQCheckBox("Round upper screen corners", vb);
TQSettings config;
config.beginGroup("/baghira/BAB");
DefStyle->setCurrentItem(config.readNumEntry("defaultState", BabSwitcher::Panther ));
cornerCheck->setChecked( config.readBoolEntry("roundCorners", true ) );
config.endGroup();
QPushButton *configBaghira = new QPushButton("Configure Baghira", vb);
QPushButton *Quit = new QPushButton("Quit BAB", vb);
QPushButton *Close = new QPushButton("Close Menu", vb);
TQPushButton *configBaghira = new TQPushButton("Configure Baghira", vb);
TQPushButton *Quit = new TQPushButton("Quit BAB", vb);
TQPushButton *Close = new TQPushButton("Close Menu", vb);
vb->adjustSize();
bSwitcher->setStyle(DefStyle->currentText());
bSwitcher->setDeco(DefStyle->currentText());
@ -204,10 +204,10 @@ void bab::configureBaghira()
// any errors that arise
KLibLoader* loader = KLibLoader::self();
KLibrary* library = loader->library( QFile::encodeName("kstyle_baghira_config") );
KLibrary* library = loader->library( TQFile::encodeName("kstyle_baghira_config") );
if (!library)
{
qWarning("There was an error loading the configuration dialog for this style.");
tqWarning("There was an error loading the configuration dialog for this style.");
return;
}
@ -215,7 +215,7 @@ void bab::configureBaghira()
if (!allocPtr)
{
qWarning("There was an error loading the configuration dialog for this style.");
tqWarning("There was an error loading the configuration dialog for this style.");
return;
}
@ -223,42 +223,42 @@ void bab::configureBaghira()
StyleConfigDialog* dial = new StyleConfigDialog(this, "Baghira Configuration");
dial->enableButtonSeparator(true);
typedef QWidget*(* factoryRoutine)( QWidget* parent );
typedef TQWidget*(* factoryRoutine)( TQWidget* parent );
//Get the factory, and make the widget.
factoryRoutine factory = (factoryRoutine)(allocPtr);
QWidget* styleConfig = factory( dial );
TQWidget* styleConfig = factory( dial );
QTabWidget* tw = (QTabWidget*)styleConfig->child("tabWidget");
TQTabWidget* tw = (TQTabWidget*)styleConfig->child("tabWidget");
QWidget* decoConfig = 0;
QObject *decoObject = 0;
TQWidget* decoConfig = 0;
TQObject *decoObject = 0;
if (tw)
{
KLibrary* library2 = loader->library( QFile::encodeName("kwin_baghira_config") );
KLibrary* library2 = loader->library( TQFile::encodeName("kwin_baghira_config") );
if (!library2)
{
qWarning("There was an error loading the configuration dialog for the deco.");
tqWarning("There was an error loading the configuration dialog for the deco.");
return;
}
void* allocPtr2 = library2->symbol("allocate_config");
if (!allocPtr2)
{
qWarning("There was an error loading the configuration dialog for this style.");
tqWarning("There was an error loading the configuration dialog for this style.");
return;
}
typedef QObject*(* factoryRoutine2)( KConfig* conf, QWidget* parent );
typedef TQObject*(* factoryRoutine2)( KConfig* conf, TQWidget* parent );
factoryRoutine2 factory2 = (factoryRoutine2)(allocPtr2);
decoObject = factory2( 0, tw );
decoConfig = (QWidget*)tw->child("ConfigDialog");
decoConfig = (TQWidget*)tw->child("ConfigDialog");
tw->addTab(decoConfig, "Decoration");
}
//Insert it in...
dial->setMainWidget( styleConfig );
QWidget *desktop = QApplication::desktop();
QPoint nPos((desktop->width() - dial->width())/2, (desktop->height() - dial->height() - 100)/2);
TQWidget *desktop = TQApplication::desktop();
TQPoint nPos((desktop->width() - dial->width())/2, (desktop->height() - dial->height() - 100)/2);
dial->move(nPos);
//..and connect it to the wrapper
connect(styleConfig, SIGNAL(changed(bool)), dial, SLOT(setStyleDirty(bool)));
@ -268,7 +268,7 @@ void bab::configureBaghira()
connect(dial, SIGNAL(defaults()), decoObject, SLOT(defaults()));
connect(dial, SIGNAL(save(KConfig*)), decoObject, SLOT(save(KConfig*)));
if (dial->exec() == QDialog::Accepted)
if (dial->exec() == TQDialog::Accepted)
{
//For now, ask all KDE apps to recreate their styles to apply the setitngs
if (dial->isStyleDirty())
@ -277,21 +277,21 @@ void bab::configureBaghira()
KIPC::sendMessageAll(KIPC::ToolbarStyleChanged);
}
if (dial->isDecoDirty())
kapp->dcopClient()->send("kwin", "KWinInterface", "reconfigure()", QByteArray());
kapp->dcopClient()->send("kwin", "KWinInterface", "reconfigure()", TQByteArray());
}
tw->removeChild( decoObject );
dial->insertChild( decoObject );
decoConfig->reparent(dial, QPoint(0,0));
decoConfig->reparent(dial, TQPoint(0,0));
delete dial;
}
/* overwrite the show event for repositioning the window on top
of the icon, adapted from kkeyled */
void bab::showEvent(QShowEvent *e){
void bab::showEvent(TQShowEvent *e){
if ( bSwitcher->globalPos->x() >= 0) {
QWidget *desktop = QApplication::desktop();
TQWidget *desktop = TQApplication::desktop();
int w = desktop->width();
QPoint nPos;
TQPoint nPos;
if (bSwitcher->globalPos->y() - height() >= 0 )
{ // it's not on top
nPos.setY(bSwitcher->globalPos->y() -height());
@ -315,13 +315,13 @@ void bab::showEvent(QShowEvent *e){
// If it was set by the normal sessionmanagement it needs
// to set the Flags again
setWFlags(Qt::WStyle_StaysOnTop | Qt::WX11BypassWM);
QWidget::showEvent(e); // execute the normal showevent
setWFlags(TQt::WStyle_StaysOnTop | TQt::WX11BypassWM);
TQWidget::showEvent(e); // execute the normal showevent
raise();
}
void bab::saveSettings(){
QSettings *config = new QSettings();
TQSettings *config = new TQSettings();
// KConfig *config = new KConfig("baghirarc");
config->beginGroup("/baghira/BAB");
config->writeEntry("defaultState", DefStyle->currentItem());
@ -330,7 +330,7 @@ void bab::saveSettings(){
delete config;
}
QPoint *BabSwitcher::globalPos = new QPoint(0,0);
TQPoint *BabSwitcher::globalPos = new TQPoint(0,0);
BabSwitcher::BabSwitcher(bab *parent, const char *name)
: KSystemTray(parent,name), DCOPObject("babInterface") {
@ -353,7 +353,7 @@ void BabSwitcher::toggle()
else
state_ = Jaguar;
decoState_ = state_;
QString nameString;
TQString nameString;
switch (state_)
{
case Jaguar:
@ -371,17 +371,17 @@ void BabSwitcher::toggle()
case Milk:
nameString = "Milk";
}
QString tmpString = QDir::homeDirPath() + "/.baghira/" + nameString;
QString tmpString2 = QDir::homeDirPath() + "/.baghira/.bab/.style";
TQString tmpString = TQDir::homeDirPath() + "/.baghira/" + nameString;
TQString tmpString2 = TQDir::homeDirPath() + "/.baghira/.bab/.style";
remove(tmpString2.latin1());
symlink (tmpString.latin1(), tmpString2.latin1());
tmpString2 = QDir::homeDirPath() + "/.baghira/.bab/.deco";
tmpString2 = TQDir::homeDirPath() + "/.baghira/.bab/.deco";
remove(tmpString2.latin1());
symlink (tmpString.latin1(), tmpString2.latin1());
repaint();
}
void BabSwitcher::setStyle(QString style)
void BabSwitcher::setStyle(TQString style)
{
if (style == "Jaguar")
state_ = Jaguar;
@ -397,14 +397,14 @@ void BabSwitcher::setStyle(QString style)
style = "Panther";
state_ = Panther;
}
QString tmpString = QDir::homeDirPath() + "/.baghira/" + style;
QString tmpString2 = QDir::homeDirPath() + "/.baghira/.bab/.style";
TQString tmpString = TQDir::homeDirPath() + "/.baghira/" + style;
TQString tmpString2 = TQDir::homeDirPath() + "/.baghira/.bab/.style";
remove(tmpString2.latin1());
symlink (tmpString.latin1(), tmpString2.latin1());
repaint();
}
void BabSwitcher::setDeco(QString deco)
void BabSwitcher::setDeco(TQString deco)
{
if (deco == "Jaguar")
decoState_ = Jaguar;
@ -420,13 +420,13 @@ void BabSwitcher::setDeco(QString deco)
deco = "Panther";
decoState_ = Panther;
}
QString tmpString = QDir::homeDirPath() + "/.baghira/" + deco;
QString tmpString2 = QDir::homeDirPath() + "/.baghira/.bab/.deco";
TQString tmpString = TQDir::homeDirPath() + "/.baghira/" + deco;
TQString tmpString2 = TQDir::homeDirPath() + "/.baghira/.bab/.deco";
remove(tmpString2.latin1());
symlink (tmpString.latin1(), tmpString2.latin1());
}
QString BabSwitcher::style()
TQString BabSwitcher::style()
{
switch (state_)
{
@ -443,7 +443,7 @@ QString BabSwitcher::style()
}
}
QString BabSwitcher::deco()
TQString BabSwitcher::deco()
{
switch (decoState_)
{
@ -460,10 +460,10 @@ QString BabSwitcher::deco()
}
}
void BabSwitcher::start(QString name, QString settings)
void BabSwitcher::start(TQString name, TQString settings)
{
KProcess proc;
QString section; int i = 0; bool done = false;
TQString section; int i = 0; bool done = false;
if (name.contains(' '))
{
while (!done)
@ -471,8 +471,8 @@ void BabSwitcher::start(QString name, QString settings)
section = name.section(' ',i,i);
if (i == 0)
{
QString tmpString = QDir::homeDirPath() + "/.baghira/" + settings;
QString tmpString2 = QDir::homeDirPath() + "/.baghira/.bab/" + section;
TQString tmpString = TQDir::homeDirPath() + "/.baghira/" + settings;
TQString tmpString2 = TQDir::homeDirPath() + "/.baghira/.bab/" + section;
remove(tmpString2.latin1());
symlink (tmpString.latin1(), tmpString2.latin1());
}
@ -485,8 +485,8 @@ void BabSwitcher::start(QString name, QString settings)
}
else
{
QString tmpString = QDir::homeDirPath() + "/.baghira/" + settings;
QString tmpString2 = QDir::homeDirPath() + "/.baghira/.bab/" + name;
TQString tmpString = TQDir::homeDirPath() + "/.baghira/" + settings;
TQString tmpString2 = TQDir::homeDirPath() + "/.baghira/.bab/" + name;
remove(tmpString2.latin1());
symlink (tmpString.latin1(), tmpString2.latin1());
proc << name;
@ -501,9 +501,9 @@ void BabSwitcher::emitStyleChanged()
KIPC::sendMessageAll(KIPC::ToolbarStyleChanged);
}
void BabSwitcher::mousePressEvent(QMouseEvent *e){
void BabSwitcher::mousePressEvent(TQMouseEvent *e){
QWidget *daddy = parentWidget();
TQWidget *daddy = parentWidget();
globalPos->setX(e->globalX() - e->x());
globalPos->setY(e->globalY() - e->y());
@ -526,38 +526,38 @@ void BabSwitcher::mousePressEvent(QMouseEvent *e){
}
}
void BabSwitcher::paintEvent(QPaintEvent *ev){
void BabSwitcher::paintEvent(TQPaintEvent *ev){
KSystemTray::paintEvent(ev);
QPainter icyApainter(this);
TQPainter icyApainter(this);
switch (state_)
{
case Jaguar:
JaguarIcon.isNull() ? icyApainter.fillRect(rect(), Qt::blue) : icyApainter.drawPixmap(0, 0, JaguarIcon);
JaguarIcon.isNull() ? icyApainter.fillRect(rect(), TQt::blue) : icyApainter.drawPixmap(0, 0, JaguarIcon);
break;
case Panther:
PantherIcon.isNull() ? icyApainter.fillRect(rect(), Qt::black) : icyApainter.drawPixmap(0, 0, PantherIcon);
PantherIcon.isNull() ? icyApainter.fillRect(rect(), TQt::black) : icyApainter.drawPixmap(0, 0, PantherIcon);
break;
case iTunes:
iTunesIcon.isNull() ? icyApainter.fillRect(rect(), Qt::gray) : icyApainter.drawPixmap(0, 0, iTunesIcon);
iTunesIcon.isNull() ? icyApainter.fillRect(rect(), TQt::gray) : icyApainter.drawPixmap(0, 0, iTunesIcon);
break;
case Tiger:
TigerIcon.isNull() ? icyApainter.fillRect(rect(), Qt::yellow) : icyApainter.drawPixmap(0, 0, TigerIcon);
TigerIcon.isNull() ? icyApainter.fillRect(rect(), TQt::yellow) : icyApainter.drawPixmap(0, 0, TigerIcon);
break;
case Milk:
MilkIcon.isNull() ? icyApainter.fillRect(rect(), Qt::white) : icyApainter.drawPixmap(0, 0, MilkIcon);
MilkIcon.isNull() ? icyApainter.fillRect(rect(), TQt::white) : icyApainter.drawPixmap(0, 0, MilkIcon);
default:
break;
}
icyApainter.end();
}
Corner::Corner(Side side) : QWidget(0, (side == left)?"left_corner":"right_corner", Qt::WType_TopLevel | Qt::WStyle_NoBorder | Qt::WStyle_StaysOnTop | Qt::WX11BypassWM )
Corner::Corner(Side side) : TQWidget(0, (side == left)?"left_corner":"right_corner", TQt::WType_TopLevel | TQt::WStyle_NoBorder | TQt::WStyle_StaysOnTop | TQt::WX11BypassWM )
{
if (side == left) {
setFixedSize(5,4);
move(0,0);
show();
setPaletteBackgroundColor(Qt::black);
setPaletteBackgroundColor(TQt::black);
XRectangle* xrects = new XRectangle[4];
xrects[ 0 ].x = 0;
xrects[ 0 ].y = 0;
@ -575,15 +575,15 @@ Corner::Corner(Side side) : QWidget(0, (side == left)?"left_corner":"right_corne
xrects[ 3 ].y = 3;
xrects[ 3 ].width = 1;
xrects[ 3 ].height = 2;
XShapeCombineRectangles( qt_xdisplay(), winId(), ShapeBounding, 0, 0,
XShapeCombineRectangles( tqt_xdisplay(), winId(), ShapeBounding, 0, 0,
xrects, 4, ShapeSet, 0 );
delete[] xrects;
}
else {
setFixedSize(5,4);
move(QApplication::desktop()->width()-5,0);
move(TQApplication::desktop()->width()-5,0);
show();
setPaletteBackgroundColor(Qt::black);
setPaletteBackgroundColor(TQt::black);
XRectangle* xrects = new XRectangle[4];
xrects[ 0 ].x = 0;
xrects[ 0 ].y = 0;
@ -601,7 +601,7 @@ Corner::Corner(Side side) : QWidget(0, (side == left)?"left_corner":"right_corne
xrects[ 3 ].y = 3;
xrects[ 3 ].width = 1;
xrects[ 3 ].height = 2;
XShapeCombineRectangles( qt_xdisplay(), winId(), ShapeBounding, 0, 0,
XShapeCombineRectangles( tqt_xdisplay(), winId(), ShapeBounding, 0, 0,
xrects, 4, ShapeSet, 0 );
delete[] xrects;
}

2
bab/styleconfdialog.cpp

@ -21,7 +21,7 @@
#include "styleconfdialog.h"
#include <klocale.h>
StyleConfigDialog::StyleConfigDialog(QWidget* parent, QString styleName):
StyleConfigDialog::StyleConfigDialog(TQWidget* parent, TQString styleName):
KDialogBase(parent, "StyleConfigDialog",
true, /*modal*/
styleName,

2
bab/styleconfdialog.h

@ -28,7 +28,7 @@ class StyleConfigDialog: public KDialogBase
{
Q_OBJECT
public:
StyleConfigDialog(QWidget* parent, QString styleName);
StyleConfigDialog(TQWidget* parent, TQString styleName);
bool isStyleDirty() const;
bool isDecoDirty() const;

42
config/about.ui

@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>About</class>
<widget class="QDialog">
<widget class="TQDialog">
<property name="name">
<cstring>About</cstring>
</property>
@ -48,7 +48,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLayoutWidget" row="0" column="0" rowspan="1" colspan="3">
<widget class="TQLayoutWidget" row="0" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>layout4</cstring>
</property>
@ -75,7 +75,7 @@
</spacer>
</hbox>
</widget>
<widget class="QLayoutWidget" row="12" column="0" rowspan="1" colspan="3">
<widget class="TQLayoutWidget" row="12" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>layout11</cstring>
</property>
@ -83,7 +83,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>crLabel</cstring>
</property>
@ -120,7 +120,7 @@
</size>
</property>
</spacer>
<widget class="QLayoutWidget" row="10" column="0" rowspan="1" colspan="3">
<widget class="TQLayoutWidget" row="10" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>layout6</cstring>
</property>
@ -145,7 +145,7 @@
</size>
</property>
</spacer>
<widget class="QPushButton">
<widget class="TQPushButton">
<property name="name">
<cstring>buttonInfo</cstring>
</property>
@ -178,7 +178,7 @@
</spacer>
</hbox>
</widget>
<widget class="QLabel" row="1" column="1">
<widget class="TQLabel" row="1" column="1">
<property name="name">
<cstring>textLabel2_2</cstring>
</property>
@ -240,7 +240,7 @@
</size>
</property>
</spacer>
<widget class="QLayoutWidget" row="8" column="0" rowspan="1" colspan="3">
<widget class="TQLayoutWidget" row="8" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>layout11</cstring>
</property>
@ -248,7 +248,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel" row="4" column="3">
<widget class="TQLabel" row="4" column="3">
<property name="name">
<cstring>cpuLabel</cstring>
</property>
@ -259,7 +259,7 @@
<set>AlignVCenter|AlignLeft</set>
</property>
</widget>
<widget class="QLabel" row="0" column="3">
<widget class="TQLabel" row="0" column="3">
<property name="name">
<cstring>kdeLabel</cstring>
</property>
@ -338,7 +338,7 @@
</size>
</property>
</spacer>
<widget class="QLabel" row="2" column="1">
<widget class="TQLabel" row="2" column="1">
<property name="name">
<cstring>textLabel5</cstring>
</property>
@ -354,7 +354,7 @@
<set>AlignVCenter|AlignRight</set>
</property>
</widget>
<widget class="QLabel" row="2" column="3">
<widget class="TQLabel" row="2" column="3">
<property name="name">
<cstring>systemLabel</cstring>
</property>
@ -416,7 +416,7 @@
</size>
</property>
</spacer>
<widget class="QLabel" row="4" column="1">
<widget class="TQLabel" row="4" column="1">
<property name="name">
<cstring>textLabel1_2</cstring>
</property>
@ -500,7 +500,7 @@
</size>
</property>
</spacer>
<widget class="QLabel" row="0" column="1">
<widget class="TQLabel" row="0" column="1">
<property name="name">
<cstring>textLabel3</cstring>
</property>
@ -535,7 +535,7 @@
</size>
</property>
</spacer>
<widget class="QLayoutWidget" row="6" column="0" rowspan="1" colspan="3">
<widget class="TQLayoutWidget" row="6" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>layout5</cstring>
</property>
@ -560,7 +560,7 @@
</size>
</property>
</spacer>
<widget class="QPushButton">
<widget class="TQPushButton">
<property name="name">
<cstring>buttonDownload</cstring>
</property>
@ -601,7 +601,7 @@
</spacer>
</hbox>
</widget>
<widget class="QLayoutWidget" row="4" column="0" rowspan="1" colspan="3">
<widget class="TQLayoutWidget" row="4" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>layout8</cstring>
</property>
@ -609,7 +609,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>textLabel2</cstring>
</property>
@ -620,7 +620,7 @@
<set>AlignVCenter|AlignRight</set>
</property>
</widget>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>versionLabel</cstring>
</property>
@ -633,7 +633,7 @@
</widget>
</hbox>
</widget>
<widget class="QLayoutWidget" row="3" column="0" rowspan="1" colspan="3">
<widget class="TQLayoutWidget" row="3" column="0" rowspan="1" colspan="3">
<property name="name">
<cstring>layout10</cstring>
</property>
@ -641,7 +641,7 @@
<property name="name">
<cstring>unnamed</cstring>
</property>
<widget class="QLabel">
<widget class="TQLabel">
<property name="name">
<cstring>textLabel1</cstring>
</property>

132
config/colordialog.cpp

@ -1,12 +1,12 @@
#include "colordialog.h"
#include <qlabel.h>
#include <qdir.h>
#include <qcombobox.h>
#include <qlayout.h>
#include <qpainter.h>
#include <qpixmap.h>
#include <qpushbutton.h>
#include <qstyle.h>
#include <tqlabel.h>
#include <tqdir.h>
#include <tqcombobox.h>
#include <tqlayout.h>
#include <tqpainter.h>
#include <tqpixmap.h>
#include <tqpushbutton.h>
#include <tqstyle.h>
#include <kglobal.h>
#include <kglobalsettings.h>
#include <kcolordialog.h>
@ -36,33 +36,33 @@ if ( R < 0 ) R = 0; else if ( R > 255 ) R = 255; \
if ( G < 0 ) G = 0; else if ( G > 255 ) G = 255; \
if ( B < 0 ) B = 0; else if ( B > 255 ) B = 255;
ColorDialog::ColorDialog(QWidget* parent, const char* name) : QDialog( parent, name)
ColorDialog::ColorDialog(TQWidget* parent, const char* name) : TQDialog( parent, name)
{
QVBoxLayout *vertical = new QVBoxLayout(this);
QHBoxLayout *top = new QHBoxLayout(vertical);
TQVBoxLayout *vertical = new TQVBoxLayout(this);
TQHBoxLayout *top = new TQHBoxLayout(vertical);
demo = new DemoWindow(this);
top->addWidget(demo);
QVBoxLayout *topRight = new QVBoxLayout(top);
QLabel *info = new QLabel("<qt>Select custom colors or grab directly from screen.<br>Click image left to switch between items.</qt>",this);
TQVBoxLayout *topRight = new TQVBoxLayout(top);
TQLabel *info = new TQLabel("<qt>Select custom colors or grab directly from screen.<br>Click image left to switch between items.</qt>",this);
topRight->addWidget(info);
QIconSet icon = KGlobal::iconLoader()->loadIconSet("colorpicker", KIcon::Small);
buttonCP = new QPushButton(icon, QString::null, this);
TQIconSet icon = KGlobal::iconLoader()->loadIconSet("colorpicker", KIcon::Small);
buttonCP = new TQPushButton(icon, TQString::null, this);
topRight->addWidget(buttonCP);
QLabel *lb = new QLabel("From other app:",this);
TQLabel *lb = new TQLabel("From other app:",this);
topRight->addWidget(lb);
other = new QComboBox(this);
other = new TQComboBox(this);
topRight->addWidget(other);
topRight->addStretch();
buttonOk = new QPushButton("&Ok", this);
buttonOk = new TQPushButton("&Ok", this);
topRight->addWidget(buttonOk);
buttonCancel = new QPushButton("&Cancel", this);
buttonCancel = new TQPushButton("&Cancel", this);
topRight->addWidget(buttonCancel);
const char *title[NUMCOLORS] = {"Background", "Button", "Base", "Text", "Highlight", "Highlighted Text", "Button Text", "Alternate Background"};
for (int i = 0; i < NUMCOLORS; i++)
{
picker[i] = new ColorPicker(this, title[i]);
vertical->addWidget(picker[i]);
connect (picker[i], SIGNAL(colorChanged(QColor)), demo, SLOT(smartRepaint()));
connect (picker[i], SIGNAL(colorChanged(TQColor)), demo, SLOT(smartRepaint()));
picker[i]->hide();
}
for (int i = 0; i < NUMCOLORS; i++)
@ -83,7 +83,7 @@ ColorDialog::ColorDialog(QWidget* parent, const char* name) : QDialog( parent, n
connect (buttonOk, SIGNAL(clicked()), this, SLOT(close()));
connect (buttonCP, SIGNAL(clicked()), this, SLOT(grabColor()));
connect (buttonCancel, SIGNAL(clicked()), this, SLOT(close()));
connect (other, SIGNAL(activated (const QString &)), this, SLOT(getFromOther(const QString &)));
connect (other, SIGNAL(activated (const TQString &)), this, SLOT(getFromOther(const TQString &)));
}
ColorDialog::~ColorDialog()
@ -93,21 +93,21 @@ ColorDialog::~ColorDialog()
void ColorDialog::show()
{
other->clear();
QDir d( QDir::homeDirPath() + "/.baghira", 0L, QDir::Name | QDir::IgnoreCase, QDir::Files | QDir::Readable | QDir::Writable );
TQDir d( TQDir::homeDirPath() + "/.baghira", 0L, TQDir::Name | TQDir::IgnoreCase, TQDir::Files | TQDir::Readable | TQDir::Writable );
if (d.exists())
{
for ( uint i = 0; i < d.count(); i++ )
other->insertItem(d[i]);
}
QDialog::show();
TQDialog::show();
demo->show();
// demo->repaint(false);
}
void ColorDialog::getFromOther( const QString & string )
void ColorDialog::getFromOther( const TQString & string )
{
FILE *file = NULL;
QString tmpString = QDir::homeDirPath() + "/.baghira/" + string;
TQString tmpString = TQDir::homeDirPath() + "/.baghira/" + string;
if( (file = fopen(tmpString.latin1(), "r")) != NULL )
{
uint k;
@ -119,7 +119,7 @@ void ColorDialog::getFromOther( const QString & string )
for (int i = 0; i < NUMCOLORS; i++)
{
picker[i]->blockSignals(true);
if (colors[i] != -1) picker[i]->setColor(QColor(colors[i]));
if (colors[i] != -1) picker[i]->setColor(TQColor(colors[i]));
picker[i]->blockSignals(false);
}
demo->repaint(false);
@ -133,7 +133,7 @@ void ColorDialog::grabColor()
grabKeyboard();
}
void ColorDialog::mouseReleaseEvent(QMouseEvent* me)
void ColorDialog::mouseReleaseEvent(TQMouseEvent* me)
{
if (gettingColorFromScreen)
{
@ -150,38 +150,38 @@ void ColorDialog::mouseReleaseEvent(QMouseEvent* me)
}
}
else
QDialog::mouseReleaseEvent(me);
TQDialog::mouseReleaseEvent(me);
}
//extern QImage uic_findiImage(const QString& name);
//extern TQImage uic_findiImage(const TQString& name);
//extern void qInitImages_baghira();
//extern void qCleanupImages_baghira();
DemoWindow::DemoWindow( ColorDialog* parent, const char* name) : QWidget(parent, name)
DemoWindow::DemoWindow( ColorDialog* parent, const char* name) : TQWidget(parent, name)
{
setBackgroundMode ( Qt::NoBackground );
setBackgroundMode ( TQt::NoBackground );
colorDialog_ = parent;
setFixedSize(320,120);
pm = new QPixmap(320,120);
pp = new QPainter();
p = new QPainter();
(const_cast<QFont*>(&p->font()))->setPixelSize(16);
baseRect = QRect(20, 10, 200, 100);
buttonRect = QRect(230, 90, 37, 21);
buttonTextRect = QRect(236, 91, 20, 18);
highlightRect = QRect(21, 42, 198, 22);
textRect = QRect(25, 21, 100, 18);
highTextRect = QRect(25, 42, 120, 22);
alternateRect = QRect(21, 86, 198, 22);
pm = new TQPixmap(320,120);
pp = new TQPainter();
p = new TQPainter();
(const_cast<TQFont*>(&p->font()))->setPixelSize(16);
baseRect = TQRect(20, 10, 200, 100);
buttonRect = TQRect(230, 90, 37, 21);
buttonTextRect = TQRect(236, 91, 20, 18);
highlightRect = TQRect(21, 42, 198, 22);
textRect = TQRect(25, 21, 100, 18);
highTextRect = TQRect(25, 42, 120, 22);
alternateRect = TQRect(21, 86, 198, 22);
baseImage = uic_findImage("button-base");
dest = QImage( baseImage.width(), baseImage.height(), 32 );
dest = TQImage( baseImage.width(), baseImage.height(), 32 );
dest.setAlphaBuffer( true );
}
DemoWindow::~DemoWindow(){}
void DemoWindow::mousePressEvent ( QMouseEvent * me )
void DemoWindow::mousePressEvent ( TQMouseEvent * me )
{
for (int i = 0; i < NUMCOLORS; i++)
colorDialog_->picker[i]->hide();
@ -204,23 +204,23 @@ void DemoWindow::mousePressEvent ( QMouseEvent * me )
colorDialog_->picker[Back]->show();
}
void DemoWindow::paintEvent ( QPaintEvent * )
void DemoWindow::paintEvent ( TQPaintEvent * )
{
pp->begin(pm);
pp->fillRect(0,0,pm->width(),pm->height(), colorDialog_->picker[Back]->color());
style().drawPrimitive( QStyle::PE_PanelLineEdit, pp, rect(), colorGroup() );
style().drawPrimitive( TQStyle::PE_PanelLineEdit, pp, rect(), colorGroup() );
pp->fillRect(baseRect, colorDialog_->picker[Base]->color());
pp->fillRect(highlightRect, colorDialog_->picker[High]->color());
pp->fillRect(alternateRect, colorDialog_->picker[Alternate]->color());
pp->setPen ( colorDialog_->picker[Text]->color() );
pp->drawText ( textRect, Qt::AlignAuto | Qt::AlignVCenter, "Common Text");
pp->drawText ( alternateRect, Qt::AlignAuto | Qt::AlignVCenter, "Alt. Background");
pp->drawText ( textRect, TQt::AlignAuto | TQt::AlignVCenter, "Common Text");
pp->drawText ( alternateRect, TQt::AlignAuto | TQt::AlignVCenter, "Alt. Background");
pp->setPen ( colorDialog_->picker[HighText]->color() );
pp->drawText ( highTextRect, Qt::AlignAuto | Qt::AlignVCenter, "Highlighted Text");
pp->drawText ( highTextRect, TQt::AlignAuto | TQt::AlignVCenter, "Highlighted Text");
pp->drawPixmap(buttonRect, tintButton(baseImage, colorDialog_->picker[Button]->color()));
pp->setPen ( colorDialog_->picker[ButText]->color() );
pp->drawText ( buttonTextRect, Qt::AlignCenter, "B");
style().drawPrimitive( QStyle::PE_PanelLineEdit, pp, baseRect, colorGroup());
pp->drawText ( buttonTextRect, TQt::AlignCenter, "B");
style().drawPrimitive( TQStyle::PE_PanelLineEdit, pp, baseRect, colorGroup());
pp->end();
p->begin(this);
p->drawPixmap(0,0, *pm);
@ -231,49 +231,49 @@ void DemoWindow::smartRepaint()
{
if (colorDialog_->picker[Back]->isShown())
{
QWidget::repaint(false);
TQWidget::repaint(false);
return;
}
if (colorDialog_->picker[Button]->isShown())
{
QWidget::repaint(buttonRect, false);
TQWidget::repaint(buttonRect, false);
return;
}
if (colorDialog_->picker[Base]->isShown())
{
QWidget::repaint(false);
TQWidget::repaint(false);
return;
}
if (colorDialog_->picker[Text]->isShown())
{
QWidget::repaint(textRect, false);
TQWidget::repaint(textRect, false);
return;
}
if (colorDialog_->picker[High]->isShown())
{
QWidget::repaint(highlightRect, false);
TQWidget::repaint(highlightRect, false);
return;
}
if (colorDialog_->picker[HighText]->isShown())
{
QWidget::repaint(highTextRect, false);
TQWidget::repaint(highTextRect, false);
return;
}
if (colorDialog_->picker[Alternate]->isShown())
{
QWidget::repaint(alternateRect, false);
TQWidget::repaint(alternateRect, false);
return;
}
if (colorDialog_->picker[ButText]->isShown())
{
QWidget::repaint(buttonTextRect, false);
TQWidget::repaint(buttonTextRect, false);
return;
}
}
QImage & DemoWindow::tintButton(QImage &src, QColor & c)
TQImage & DemoWindow::tintButton(TQImage &src, TQColor & c)
{
// dest = QImage( src.width(), src.height(), 32, 0, _ENDIAN_ );
// dest = TQImage( src.width(), src.height(), 32, 0, _ENDIAN_ );
unsigned int *data = ( unsigned int * ) src.bits();
unsigned int *destData = ( unsigned int* ) dest.bits();
int total = src.width() * src.height();
@ -287,14 +287,14 @@ QImage & DemoWindow::tintButton(QImage &src, QColor & c)
int sq = CLAMP((int)((45.0/128.0)*s+55),0,100);
// float srcPercent, destPercent;
for ( int current = 0 ; current < total ; ++current ) {
alpha = qAlpha( data[ current ] );
blue = qBlue( data[ current ] );
red = qRed( data[ current ] );
green = qGreen( data[ current ] );
alpha = tqAlpha( data[ current ] );
blue = tqBlue( data[ current ] );
red = tqRed( data[ current ] );
green = tqGreen( data[ current ] );
SATURATION_COLOR2(sq, red, green, blue);
// force back to valid colorspace !
COLOR_SPACE(destR, destG, destB);
destData[ current ] = qRgba( destR, destG, destB, alpha );
destData[ current ] = tqRgba( destR, destG, destB, alpha );
}
return ( dest );
}

68
config/colordialog.h

@ -1,21 +1,21 @@
#ifndef COLORDIALOG_H
#define COLORDIALOG_H
#include <qdialog.h>
#include <qrect.h>
#include <qimage.h>
#include <tqdialog.h>
#include <tqrect.h>
#include <tqimage.h>
class QPushButton;
class QComboBox;
class QGroupBox;
class QPainter;
class TQPushButton;
class TQComboBox;
class TQGroupBox;
class TQPainter;
class ColorDialog;
class QImage;
class QPixmap;
class TQImage;
class TQPixmap;
enum Colors { Back = 0, Button, Base, Text, High, HighText, ButText, Alternate, NUMCOLORS };
class DemoWindow : public QWidget
class DemoWindow : public TQWidget
{
Q_OBJECT
@ -27,26 +27,26 @@ private slots:
void smartRepaint();
protected:
void mousePressEvent ( QMouseEvent * e );
void paintEvent ( QPaintEvent * );
void mousePressEvent ( TQMouseEvent * e );
void paintEvent ( TQPaintEvent * );
private:
QPainter *p;
QPainter *pp;
QPixmap *pm;
TQPainter *p;
TQPainter *pp;
TQPixmap *pm;
ColorDialog* colorDialog_;
QRect baseRect;
QRect buttonRect;
QRect buttonTextRect;
QRect highlightRect;
QRect textRect;
QRect highTextRect;
QRect alternateRect;
QImage baseImage;
QImage dest;
TQRect baseRect;
TQRect buttonRect;
TQRect buttonTextRect;
TQRect highlightRect;
TQRect textRect;
TQRect highTextRect;
TQRect alternateRect;
TQImage baseImage;
TQImage dest;
private:
QImage & tintButton(QImage &src, QColor & c);
TQImage & tintButton(TQImage &src, TQColor & c);
signals:
void selected(Colors c);
@ -55,35 +55,35 @@ signals:
class ColorPicker;
class ColorDialog : public QDialog
class ColorDialog : public TQDialog
{
friend class DemoWindow;
friend class AppSetter;
Q_OBJECT
public:
ColorDialog( QWidget* parent = 0, const char* name = 0);
ColorDialog( TQWidget* parent = 0, const char* name = 0);
~ColorDialog();
QPushButton *buttonOk;
QPushButton *buttonCancel;
TQPushButton *buttonOk;
TQPushButton *buttonCancel;
void show();
protected:
ColorPicker *picker[NUMCOLORS];
void mouseReleaseEvent(QMouseEvent* me);
void mouseReleaseEvent(TQMouseEvent* me);
DemoWindow *demo;
private:
QPushButton *buttonCP;
TQPushButton *buttonCP;
bool gettingColorFromScreen;
QComboBox *other;
TQComboBox *other;
private slots:
void grabColor();
void getFromOther( const QString & string );
void getFromOther( const TQString & string );
signals:
void colorChanged(QColor color);
void colorChanged(TQColor color);
};

24
config/colorpicker.cpp

@ -1,16 +1,16 @@
#include "colorpicker.h"
#include <qcolor.h>
#include <qlayout.h>
#include <tqcolor.h>
#include <tqlayout.h>
#include <knuminput.h>
ColorPicker::ColorPicker(QWidget* parent, const char* name) : QGroupBox( parent, name)
ColorPicker::ColorPicker(TQWidget* parent, const char* name) : TQGroupBox( parent, name)
{
setTitle(name);
setColumnLayout(0, Qt::Vertical );
setColumnLayout(0, TQt::Vertical );
layout()->setSpacing( 6 );
layout()->setMargin( 11 );
QVBoxLayout *vLayout = new QVBoxLayout(layout());
TQVBoxLayout *vLayout = new TQVBoxLayout(layout());
red = new KIntNumInput(this, "red");
red->setRange(0, 255, 1, true);
@ -35,10 +35,10 @@ ColorPicker::~ColorPicker()
void ColorPicker::emitChange()
{
emit colorChanged(QColor(red->value(), green->value(), blue->value()));
emit colorChanged(TQColor(red->value(), green->value(), blue->value()));
}
void ColorPicker::setColor(const QColor & color)
void ColorPicker::setColor(const TQColor & color)
{
red->setValue( color.red() );
green->setValue( color.green() );
@ -49,24 +49,24 @@ void ColorPicker::setColor(const QColor & color)
void ColorPicker::setRed(int r)
{
red->setValue( r );
emit colorChanged(QColor(r, green->value(), blue->value()));
emit colorChanged(TQColor(r, green->value(), blue->value()));
}
void ColorPicker::setGreen(int g)
{
green->setValue( g );
emit colorChanged(QColor(red->value(), g, blue->value()));
emit colorChanged(TQColor(red->value(), g, blue->value()));
}
void ColorPicker::setBlue(int b)
{
blue->setValue( b );
emit colorChanged(QColor(red->value(), green->value(), b));
emit colorChanged(TQColor(red->value(), green->value(), b));
}
QColor & ColorPicker::color()
TQColor & ColorPicker::color()
{
color__ = QColor(red->value(), green->value(), blue->value());
color__ = TQColor(red->value(), green->value(), blue->value());
return color__;
}

18
config/colorpicker.h

@ -1,22 +1,22 @@
#ifndef COLORPICKER_H
#define COLORPICKER_H
#include <qgroupbox.h>
#include <tqgroupbox.h>