From c663b6440964f6ac48027143ac9e63298991f9d0 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 31 Jul 2010 19:33:34 +0000 Subject: Trinity Qt initial conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1157639 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- kcontrol/colors/colorscm.cpp | 236 ++++++++++++++++----------------- kcontrol/colors/colorscm.h | 38 +++--- kcontrol/colors/widgetcanvas.cpp | 274 +++++++++++++++++++-------------------- kcontrol/colors/widgetcanvas.h | 84 ++++++------ 4 files changed, 316 insertions(+), 316 deletions(-) (limited to 'kcontrol/colors') diff --git a/kcontrol/colors/colorscm.cpp b/kcontrol/colors/colorscm.cpp index 39e5574c2..d735d1248 100644 --- a/kcontrol/colors/colorscm.cpp +++ b/kcontrol/colors/colorscm.cpp @@ -12,15 +12,15 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -46,25 +46,25 @@ /**** DLL Interface ****/ -typedef KGenericFactory KolorFactory; +typedef KGenericFactory KolorFactory; K_EXPORT_COMPONENT_FACTORY( kcm_colors, KolorFactory("kcmcolors") ) class KColorSchemeEntry { public: - KColorSchemeEntry(const QString &_path, const QString &_name, bool _local) + KColorSchemeEntry(const TQString &_path, const TQString &_name, bool _local) : path(_path), name(_name), local(_local) { } - QString path; - QString name; + TQString path; + TQString name; bool local; }; -class KColorSchemeList : public QPtrList { +class KColorSchemeList : public TQPtrList { public: KColorSchemeList() { setAutoDelete(true); } - int compareItems(QPtrCollection::Item item1, QPtrCollection::Item item2) + int compareItems(TQPtrCollection::Item item1, TQPtrCollection::Item item2) { KColorSchemeEntry *i1 = (KColorSchemeEntry*)item1; KColorSchemeEntry *i2 = (KColorSchemeEntry*)item2; @@ -77,22 +77,22 @@ public: #define SIZE 8 // make a 24 * 8 pixmap with the main colors in a scheme -QPixmap mkColorPreview(const WidgetCanvas *cs) +TQPixmap mkColorPreview(const WidgetCanvas *cs) { - QPixmap group(SIZE*3,SIZE); - QPixmap block(SIZE,SIZE); - group.fill(QColor(0,0,0)); + TQPixmap group(SIZE*3,SIZE); + TQPixmap block(SIZE,SIZE); + group.fill(TQColor(0,0,0)); block.fill(cs->back); bitBlt(&group,0*SIZE,0,&block,0,0,SIZE,SIZE); block.fill(cs->window); bitBlt(&group,1*SIZE,0,&block,0,0,SIZE,SIZE); block.fill(cs->aTitle); bitBlt(&group,2*SIZE,0,&block,0,0,SIZE,SIZE); - QPainter p(&group); + TQPainter p(&group); p.drawRect(0,0,3*SIZE,SIZE); return group; } /**** KColorScheme ****/ -KColorScheme::KColorScheme(QWidget *parent, const char *name, const QStringList &) +KColorScheme::KColorScheme(TQWidget *parent, const char *name, const TQStringList &) : KCModule(KolorFactory::instance(), parent, name) { nSysSchemes = 2; @@ -120,7 +120,7 @@ KColorScheme::KColorScheme(QWidget *parent, const char *name, const QStringList // LAYOUT - QGridLayout *topLayout = new QGridLayout( this, 3, 2, 0, + TQGridLayout *topLayout = new TQGridLayout( this, 3, 2, 0, KDialog::spacingHint() ); topLayout->setRowStretch(0,0); topLayout->setRowStretch(1,0); @@ -130,28 +130,28 @@ KColorScheme::KColorScheme(QWidget *parent, const char *name, const QStringList cs->setFixedHeight(160); cs->setMinimumWidth(440); - QWhatsThis::add( cs, i18n("This is a preview of the color settings which" + TQWhatsThis::add( cs, i18n("This is a preview of the color settings which" " will be applied if you click \"Apply\" or \"OK\". You can click on" " different parts of this preview image. The widget name in the" " \"Widget color\" box will change to reflect the part of the preview" " image you clicked.") ); - connect( cs, SIGNAL( widgetSelected( int ) ), - SLOT( slotWidgetColor( int ) ) ); - connect( cs, SIGNAL( colorDropped( int, const QColor&)), - SLOT( slotColorForWidget( int, const QColor&))); + connect( cs, TQT_SIGNAL( widgetSelected( int ) ), + TQT_SLOT( slotWidgetColor( int ) ) ); + connect( cs, TQT_SIGNAL( colorDropped( int, const TQColor&)), + TQT_SLOT( slotColorForWidget( int, const TQColor&))); topLayout->addMultiCellWidget( cs, 0, 0, 0, 1 ); - QGroupBox *group = new QVGroupBox( i18n("Color Scheme"), this ); + TQGroupBox *group = new TQVGroupBox( i18n("Color Scheme"), this ); topLayout->addWidget( group, 1, 0 ); sList = new KListBox( group ); mSchemeList = new KColorSchemeList(); readSchemeNames(); sList->setCurrentItem( 0 ); - connect(sList, SIGNAL(highlighted(int)), SLOT(slotPreviewScheme(int))); + connect(sList, TQT_SIGNAL(highlighted(int)), TQT_SLOT(slotPreviewScheme(int))); - QWhatsThis::add( sList, i18n("This is a list of predefined color schemes," + TQWhatsThis::add( sList, i18n("This is a list of predefined color schemes," " including any that you may have created. You can preview an existing" " color scheme by selecting it from the list. The current scheme will" " be replaced by the selected color scheme.

" @@ -159,41 +159,41 @@ KColorScheme::KColorScheme(QWidget *parent, const char *name, const QStringList " to the current scheme, those changes will be lost if you select" " another color scheme.") ); - addBt = new QPushButton(i18n("&Save Scheme..."), group); - connect(addBt, SIGNAL(clicked()), SLOT(slotAdd())); + addBt = new TQPushButton(i18n("&Save Scheme..."), group); + connect(addBt, TQT_SIGNAL(clicked()), TQT_SLOT(slotAdd())); - QWhatsThis::add( addBt, i18n("Press this button if you want to save" + TQWhatsThis::add( addBt, i18n("Press this button if you want to save" " the current color settings as a color scheme. You will be" " prompted for a name.") ); - removeBt = new QPushButton(i18n("R&emove Scheme"), group); + removeBt = new TQPushButton(i18n("R&emove Scheme"), group); removeBt->setEnabled(FALSE); - connect(removeBt, SIGNAL(clicked()), SLOT(slotRemove())); + connect(removeBt, TQT_SIGNAL(clicked()), TQT_SLOT(slotRemove())); - QWhatsThis::add( removeBt, i18n("Press this button to remove the selected" + TQWhatsThis::add( removeBt, i18n("Press this button to remove the selected" " color scheme. Note that this button is disabled if you do not have" " permission to delete the color scheme.") ); - importBt = new QPushButton(i18n("I&mport Scheme..."), group); - connect(importBt, SIGNAL(clicked()),SLOT(slotImport())); + importBt = new TQPushButton(i18n("I&mport Scheme..."), group); + connect(importBt, TQT_SIGNAL(clicked()),TQT_SLOT(slotImport())); - QWhatsThis::add( importBt, i18n("Press this button to import a new color" + TQWhatsThis::add( importBt, i18n("Press this button to import a new color" " scheme. Note that the color scheme will only be available for the" " current user." )); - QBoxLayout *stackLayout = new QVBoxLayout; + TQBoxLayout *stackLayout = new QVBoxLayout; topLayout->addLayout(stackLayout, 1, 1); - group = new QGroupBox(i18n("&Widget Color"), this); + group = new TQGroupBox(i18n("&Widget Color"), this); stackLayout->addWidget(group); - QBoxLayout *groupLayout = new QVBoxLayout(group, 10); + TQBoxLayout *groupLayout = new TQVBoxLayout(group, 10); groupLayout->addSpacing(10); - wcCombo = new QComboBox(false, group); + wcCombo = new TQComboBox(false, group); for(int i=0; i < CSM_LAST;i++) { - wcCombo->insertItem(QString::null); + wcCombo->insertItem(TQString::null); } setColorName(i18n("Inactive Title Bar") , CSM_Inactive_title_bar); @@ -221,60 +221,60 @@ KColorScheme::KColorScheme(QWidget *parent, const char *name, const QStringList setColorName(i18n("Alternate Background in Lists"), CSM_Alternate_background); wcCombo->adjustSize(); - connect(wcCombo, SIGNAL(activated(int)), SLOT(slotWidgetColor(int))); + connect(wcCombo, TQT_SIGNAL(activated(int)), TQT_SLOT(slotWidgetColor(int))); groupLayout->addWidget(wcCombo); - QWhatsThis::add( wcCombo, i18n("Click here to select an element of" + TQWhatsThis::add( wcCombo, i18n("Click here to select an element of" " the KDE desktop whose color you want to change. You may either" " choose the \"widget\" here, or click on the corresponding part" " of the preview image above.") ); colorButton = new KColorButton( group ); - connect( colorButton, SIGNAL( changed(const QColor &)), - SLOT(slotSelectColor(const QColor &))); + connect( colorButton, TQT_SIGNAL( changed(const TQColor &)), + TQT_SLOT(slotSelectColor(const TQColor &))); groupLayout->addWidget( colorButton ); - QWhatsThis::add( colorButton, i18n("Click here to bring up a dialog" + TQWhatsThis::add( colorButton, i18n("Click here to bring up a dialog" " box where you can choose a color for the \"widget\" selected" " in the above list.") ); - cbShadeList = new QCheckBox(i18n("Shade sorted column in lists"), this); + cbShadeList = new TQCheckBox(i18n("Shade sorted column in lists"), this); stackLayout->addWidget(cbShadeList); - connect(cbShadeList, SIGNAL(toggled(bool)), this, SLOT(slotShadeSortColumnChanged(bool))); + connect(cbShadeList, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(slotShadeSortColumnChanged(bool))); - QWhatsThis::add(cbShadeList, + TQWhatsThis::add(cbShadeList, i18n("Check this box to show the sorted column in a list with a shaded background")); - group = new QGroupBox( i18n("Con&trast"), this ); + group = new TQGroupBox( i18n("Con&trast"), this ); stackLayout->addWidget(group); - QVBoxLayout *groupLayout2 = new QVBoxLayout(group, 10); + TQVBoxLayout *groupLayout2 = new TQVBoxLayout(group, 10); groupLayout2->addSpacing(10); groupLayout = new QHBoxLayout; groupLayout2->addLayout(groupLayout); - sb = new QSlider( QSlider::Horizontal,group,"Slider" ); + sb = new TQSlider( TQSlider::Horizontal,group,"Slider" ); sb->setRange( 0, 10 ); - sb->setFocusPolicy( QWidget::StrongFocus ); - connect(sb, SIGNAL(valueChanged(int)), SLOT(sliderValueChanged(int))); + sb->setFocusPolicy( TQWidget::StrongFocus ); + connect(sb, TQT_SIGNAL(valueChanged(int)), TQT_SLOT(sliderValueChanged(int))); - QWhatsThis::add(sb, i18n("Use this slider to change the contrast level" + TQWhatsThis::add(sb, i18n("Use this slider to change the contrast level" " of the current color scheme. Contrast does not affect all of the" " colors, only the edges of 3D objects.")); - QLabel *label = new QLabel(sb, i18n("Low Contrast", "Low"), group); + TQLabel *label = new TQLabel(sb, i18n("Low Contrast", "Low"), group); groupLayout->addWidget(label); groupLayout->addWidget(sb, 10); - label = new QLabel(group); + label = new TQLabel(group); label->setText(i18n("High Contrast", "High")); groupLayout->addWidget( label ); - cbExportColors = new QCheckBox(i18n("Apply colors to &non-KDE applications"), this); + cbExportColors = new TQCheckBox(i18n("Apply colors to &non-KDE applications"), this); topLayout->addMultiCellWidget( cbExportColors, 2, 2, 0, 1 ); - connect(cbExportColors, SIGNAL(toggled(bool)), this, SLOT(changed())); + connect(cbExportColors, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(changed())); - QWhatsThis::add(cbExportColors, i18n("Check this box to apply the" + TQWhatsThis::add(cbExportColors, i18n("Check this box to apply the" " current color scheme to non-KDE applications.")); load(); @@ -296,7 +296,7 @@ KColorScheme::~KColorScheme() delete mSchemeList; } -void KColorScheme::setColorName( const QString &name, int id ) +void KColorScheme::setColorName( const TQString &name, int id ) { wcCombo->changeItem(name, id); cs->addToolTip( id, name ); @@ -372,7 +372,7 @@ void KColorScheme::save() // KDE-1.x support KSimpleConfig *config = - new KSimpleConfig( QDir::homeDirPath() + "/.kderc" ); + new KSimpleConfig( TQDir::homeDirPath() + "/.kderc" ); config->setGroup( "General" ); config->writeEntry("background", cs->back ); config->writeEntry("selectBackground", cs->select ); @@ -388,7 +388,7 @@ void KColorScheme::save() bool exportColors = cbExportColors->isChecked(); cfg2.writeEntry("exportKDEColors", exportColors); cfg2.sync(); - QApplication::syncX(); + TQApplication::syncX(); // Notify all qt-only apps of the KDE palette changes uint flags = KRdbExportQtColors; @@ -411,7 +411,7 @@ void KColorScheme::save() int current = findSchemeByName(sCurrentScheme); sList->setCurrentItem(0); readScheme(0); - QPixmap preview = mkColorPreview(cs); + TQPixmap preview = mkColorPreview(cs); sList->changeItem(preview, sList->text(0), 0); sList->setCurrentItem(current); readScheme(current); @@ -432,7 +432,7 @@ void KColorScheme::sliderValueChanged( int val ) cs->contrast = val; cs->drawSampleWidgets(); - sCurrentScheme = QString::null; + sCurrentScheme = TQString::null; emit changed(true); } @@ -485,7 +485,7 @@ void KColorScheme::slotRemove() KColorSchemeEntry *entry = mSchemeList->at(ind-nSysSchemes); if (!entry) return; - if (unlink(QFile::encodeName(entry->path).data())) { + if (unlink(TQFile::encodeName(entry->path).data())) { KMessageBox::error( 0, i18n("This color scheme could not be removed.\n" "Perhaps you do not have permission to alter the file" @@ -508,11 +508,11 @@ void KColorScheme::slotRemove() */ void KColorScheme::slotAdd() { - QString sName; + TQString sName; if (sList->currentItem() >= nSysSchemes) sName = sList->currentText(); - QString sFile; + TQString sFile; bool valid = false; bool ok; @@ -550,8 +550,8 @@ void KColorScheme::slotAdd() valid = true; } - disconnect(sList, SIGNAL(highlighted(int)), this, - SLOT(slotPreviewScheme(int))); + disconnect(sList, TQT_SIGNAL(highlighted(int)), this, + TQT_SLOT(slotPreviewScheme(int))); if (exists != -1) { @@ -571,18 +571,18 @@ void KColorScheme::slotAdd() } slotSave(); - QPixmap preview = mkColorPreview(cs); + TQPixmap preview = mkColorPreview(cs); int current = sList->currentItem(); sList->changeItem(preview, sList->text(current), current); - connect(sList, SIGNAL(highlighted(int)), SLOT(slotPreviewScheme(int))); + connect(sList, TQT_SIGNAL(highlighted(int)), TQT_SLOT(slotPreviewScheme(int))); slotPreviewScheme(current); } void KColorScheme::slotImport() { - QString location = locateLocal( "data", "kdisplay/color-schemes/" ); + TQString location = locateLocal( "data", "kdisplay/color-schemes/" ); - KURL file ( KFileDialog::getOpenFileName(QString::null, "*.kcsrc", this) ); + KURL file ( KFileDialog::getOpenFileName(TQString::null, "*.kcsrc", this) ); if ( file.isEmpty() ) return; @@ -594,23 +594,23 @@ void KColorScheme::slotImport() } else { - QString sFile = location + file.fileName( false ); + TQString sFile = location + file.fileName( false ); KSimpleConfig *config = new KSimpleConfig(sFile); config->setGroup( "Color Scheme"); - QString sName = config->readEntry("Name", i18n("Untitled Theme")); + TQString sName = config->readEntry("Name", i18n("Untitled Theme")); delete config; insertEntry(sFile, sName); - QPixmap preview = mkColorPreview(cs); + TQPixmap preview = mkColorPreview(cs); int current = sList->currentItem(); sList->changeItem(preview, sList->text(current), current); - connect(sList, SIGNAL(highlighted(int)), SLOT(slotPreviewScheme(int))); + connect(sList, TQT_SIGNAL(highlighted(int)), TQT_SLOT(slotPreviewScheme(int))); slotPreviewScheme(current); } } -QColor &KColorScheme::color(int index) +TQColor &KColorScheme::color(int index) { switch(index) { case CSM_Inactive_title_bar: @@ -666,7 +666,7 @@ QColor &KColorScheme::color(int index) } -void KColorScheme::slotSelectColor(const QColor &col) +void KColorScheme::slotSelectColor(const TQColor &col) { int selection; selection = wcCombo->currentItem(); @@ -687,7 +687,7 @@ void KColorScheme::slotSelectColor(const QColor &col) cs->drawSampleWidgets(); - sCurrentScheme = QString::null; + sCurrentScheme = TQString::null; emit changed(true); } @@ -703,7 +703,7 @@ void KColorScheme::slotWidgetColor(int indx) // Do not emit KCModule::changed() colorButton->blockSignals( true ); - QColor col = color(indx); + TQColor col = color(indx); colorButton->setColor( col ); colorPushColor = col; @@ -711,7 +711,7 @@ void KColorScheme::slotWidgetColor(int indx) } -void KColorScheme::slotColorForWidget(int indx, const QColor& col) +void KColorScheme::slotColorForWidget(int indx, const TQColor& col) { if (wcCombo->currentItem() != indx) wcCombo->setCurrentItem( indx ); @@ -722,7 +722,7 @@ void KColorScheme::slotColorForWidget(int indx, const QColor& col) void KColorScheme::slotShadeSortColumnChanged(bool b) { cs->shadeSortColumn = b; - sCurrentScheme = QString::null; + sCurrentScheme = TQString::null; emit changed(true); } @@ -736,25 +736,25 @@ void KColorScheme::readScheme( int index ) { KConfigBase* config; - QColor widget(239, 239, 239); - QColor kde34Blue(103,141,178); - QColor inactiveBackground(157,170,186); - QColor activeBackground(65,142,220); - QColor inactiveForeground(221,221,221); - QColor activeBlend(107,145,184); - QColor inactiveBlend(157,170,186); - QColor activeTitleBtnBg(220,220,220); - QColor inactiveTitleBtnBg(220,220,220); - QColor alternateBackground(237,244,249); - - QColor button; - if (QPixmap::defaultDepth() > 8) + TQColor widget(239, 239, 239); + TQColor kde34Blue(103,141,178); + TQColor inactiveBackground(157,170,186); + TQColor activeBackground(65,142,220); + TQColor inactiveForeground(221,221,221); + TQColor activeBlend(107,145,184); + TQColor inactiveBlend(157,170,186); + TQColor activeTitleBtnBg(220,220,220); + TQColor inactiveTitleBtnBg(220,220,220); + TQColor alternateBackground(237,244,249); + + TQColor button; + if (TQPixmap::defaultDepth() > 8) button.setRgb(221, 223, 228 ); else button.setRgb(220, 220, 220); - QColor link(0, 0, 238); - QColor visitedLink(82, 24,139); + TQColor link(0, 0, 238); + TQColor visitedLink(82, 24,139); // note: keep default color scheme in sync with default Current Scheme if (index == 1) { @@ -818,7 +818,7 @@ void KColorScheme::readScheme( int index ) cs->buttonTxt = config->readColorEntry( "buttonForeground", &black ); cs->link = config->readColorEntry( "linkColor", &link ); cs->visitedLink = config->readColorEntry( "visitedLinkColor", &visitedLink ); - QColor alternate = KGlobalSettings::calculateAlternateBackgroundColor(cs->window); + TQColor alternate = KGlobalSettings::calculateAlternateBackgroundColor(cs->window); cs->alternateBackground = config->readColorEntry( "alternateBackground", &alternate ); if (index == 0) @@ -860,14 +860,14 @@ void KColorScheme::readSchemeNames() nSysSchemes = 2; // Global + local schemes - QStringList list = KGlobal::dirs()->findAllResources("data", + TQStringList list = KGlobal::dirs()->findAllResources("data", "kdisplay/color-schemes/*.kcsrc", false, true); // And add them - for (QStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { + for (TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it) { KSimpleConfig *config = new KSimpleConfig(*it); config->setGroup("Color Scheme"); - QString str = config->readEntry("Name"); + TQString str = config->readEntry("Name"); if (str.isEmpty()) { str = config->readEntry("name"); if (str.isEmpty()) @@ -888,7 +888,7 @@ void KColorScheme::readSchemeNames() { sList->setCurrentItem(i); readScheme(i); - QPixmap preview = mkColorPreview(cs); + TQPixmap preview = mkColorPreview(cs); sList->changeItem(preview, sList->text(i), i); } @@ -897,14 +897,14 @@ void KColorScheme::readSchemeNames() /* * Find scheme based on filename */ -int KColorScheme::findSchemeByName(const QString &scheme) +int KColorScheme::findSchemeByName(const TQString &scheme) { if (scheme.isEmpty()) return 0; if (scheme == "") return 1; - QString search = scheme; + TQString search = scheme; int i = search.findRev('/'); if (i >= 0) search = search.mid(i+1); @@ -952,23 +952,23 @@ void KColorScheme::slotPreviewScheme(int indx) /* this function should dissappear: colorscm should work directly on a Qt palette, since this will give us much more cusomization with qt-2.0. */ -QPalette KColorScheme::createPalette() +TQPalette KColorScheme::createPalette() { - QColorGroup disabledgrp(cs->windowTxt, cs->back, cs->back.light(150), + TQColorGroup disabledgrp(cs->windowTxt, cs->back, cs->back.light(150), cs->back.dark(), cs->back.dark(120), cs->back.dark(120), cs->window); - QColorGroup colgrp(cs->windowTxt, cs->back, cs->back.light(150), + TQColorGroup colgrp(cs->windowTxt, cs->back, cs->back.light(150), cs->back.dark(), cs->back.dark(120), cs->txt, cs->window); - colgrp.setColor(QColorGroup::Highlight, cs->select); - colgrp.setColor(QColorGroup::HighlightedText, cs->selectTxt); - colgrp.setColor(QColorGroup::Button, cs->button); - colgrp.setColor(QColorGroup::ButtonText, cs->buttonTxt); - return QPalette( colgrp, disabledgrp, colgrp); + colgrp.setColor(TQColorGroup::Highlight, cs->select); + colgrp.setColor(TQColorGroup::HighlightedText, cs->selectTxt); + colgrp.setColor(TQColorGroup::Button, cs->button); + colgrp.setColor(TQColorGroup::ButtonText, cs->buttonTxt); + return TQPalette( colgrp, disabledgrp, colgrp); } -void KColorScheme::insertEntry(const QString &sFile, const QString &sName) +void KColorScheme::insertEntry(const TQString &sFile, const TQString &sName) { KColorSchemeEntry *newEntry = new KColorSchemeEntry(sFile, sName, true); mSchemeList->inSort(newEntry); diff --git a/kcontrol/colors/colorscm.h b/kcontrol/colors/colorscm.h index 23b47c6a0..1494b072d 100644 --- a/kcontrol/colors/colorscm.h +++ b/kcontrol/colors/colorscm.h @@ -8,10 +8,10 @@ #ifndef __COLORSCM_H__ #define __COLORSCM_H__ -#include -#include -#include -#include +#include +#include +#include +#include #include #include @@ -39,7 +39,7 @@ class KColorScheme: public KCModule Q_OBJECT public: - KColorScheme(QWidget *parent, const char *name, const QStringList &); + KColorScheme(TQWidget *parent, const char *name, const TQStringList &); ~KColorScheme(); virtual void load(); @@ -53,38 +53,38 @@ private slots: void slotAdd(); void slotRemove(); void slotImport(); - void slotSelectColor(const QColor &col); + void slotSelectColor(const TQColor &col); void slotWidgetColor(int); - void slotColorForWidget(int, const QColor &); + void slotColorForWidget(int, const TQColor &); void slotPreviewScheme(int); void slotShadeSortColumnChanged(bool); private: - void setColorName( const QString &name, int id ); + void setColorName( const TQString &name, int id ); void readScheme(int index=0); void readSchemeNames(); - void insertEntry(const QString &sFile, const QString &sName); - int findSchemeByName(const QString &scheme); - QPalette createPalette(); + void insertEntry(const TQString &sFile, const TQString &sName); + int findSchemeByName(const TQString &scheme); + TQPalette createPalette(); - QColor &color(int index); + TQColor &color(int index); int nSysSchemes; bool useRM; - QColor colorPushColor; - QSlider *sb; - QComboBox *wcCombo; - QPushButton *addBt, *removeBt, *importBt; + TQColor colorPushColor; + TQSlider *sb; + TQComboBox *wcCombo; + TQPushButton *addBt, *removeBt, *importBt; KListBox *sList; KColorSchemeList *mSchemeList; - QString sCurrentScheme; + TQString sCurrentScheme; KColorButton *colorButton; WidgetCanvas *cs; - QCheckBox *cbExportColors; - QCheckBox *cbShadeList; + TQCheckBox *cbExportColors; + TQCheckBox *cbShadeList; }; #endif diff --git a/kcontrol/colors/widgetcanvas.cpp b/kcontrol/colors/widgetcanvas.cpp index 42adcc3bb..67e68b3a3 100644 --- a/kcontrol/colors/widgetcanvas.cpp +++ b/kcontrol/colors/widgetcanvas.cpp @@ -5,13 +5,13 @@ // Copyright (c) Mark Donohoe 1998 // -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -24,25 +24,25 @@ #include "widgetcanvas.moc" #include "stdclient_bitmaps.h" -static QPixmap* close_pix = 0; -static QPixmap* maximize_pix = 0; -static QPixmap* minimize_pix = 0; -static QPixmap* normalize_pix = 0; -static QPixmap* pinup_pix = 0; -static QPixmap* pindown_pix = 0; -static QPixmap* menu_pix = 0; - -static QPixmap* dis_close_pix = 0; -static QPixmap* dis_maximize_pix = 0; -static QPixmap* dis_minimize_pix = 0; -static QPixmap* dis_normalize_pix = 0; -static QPixmap* dis_pinup_pix = 0; -static QPixmap* dis_pindown_pix = 0; -static QPixmap* dis_menu_pix = 0; - - -WidgetCanvas::WidgetCanvas( QWidget *parent, const char *name ) - : QWidget( parent, name ), shadeSortColumn( true ) +static TQPixmap* close_pix = 0; +static TQPixmap* maximize_pix = 0; +static TQPixmap* minimize_pix = 0; +static TQPixmap* normalize_pix = 0; +static TQPixmap* pinup_pix = 0; +static TQPixmap* pindown_pix = 0; +static TQPixmap* menu_pix = 0; + +static TQPixmap* dis_close_pix = 0; +static TQPixmap* dis_maximize_pix = 0; +static TQPixmap* dis_minimize_pix = 0; +static TQPixmap* dis_normalize_pix = 0; +static TQPixmap* dis_pinup_pix = 0; +static TQPixmap* dis_pindown_pix = 0; +static TQPixmap* dis_menu_pix = 0; + + +WidgetCanvas::WidgetCanvas( TQWidget *parent, const char *name ) + : TQWidget( parent, name ), shadeSortColumn( true ) { setMouseTracking( true ); setBackgroundMode( NoBackground ); @@ -51,17 +51,17 @@ WidgetCanvas::WidgetCanvas( QWidget *parent, const char *name ) currentHotspot = -1; } -void WidgetCanvas::addToolTip( int area, const QString &tip ) +void WidgetCanvas::addToolTip( int area, const TQString &tip ) { tips.insert(area, tip); } -void WidgetCanvas::paintEvent(QPaintEvent *) +void WidgetCanvas::paintEvent(TQPaintEvent *) { bitBlt( this, 0, 0, &smplw ); } -void WidgetCanvas::mousePressEvent( QMouseEvent *me ) +void WidgetCanvas::mousePressEvent( TQMouseEvent *me ) { for ( int i = 0; i < MAX_HOTSPOTS; i++ ) if ( hotspots[i].rect.contains( me->pos() ) ) { @@ -70,25 +70,25 @@ void WidgetCanvas::mousePressEvent( QMouseEvent *me ) } } -void WidgetCanvas::mouseMoveEvent( QMouseEvent *me ) +void WidgetCanvas::mouseMoveEvent( TQMouseEvent *me ) { for ( int i = 0; i < MAX_HOTSPOTS; i++ ) if ( hotspots[i].rect.contains( me->pos() ) ) { if ( i != currentHotspot ) { - QString tip = tips[hotspots[i].number]; - QToolTip::remove( this ); - QToolTip::add( this, tip ); + TQString tip = tips[hotspots[i].number]; + TQToolTip::remove( this ); + TQToolTip::add( this, tip ); currentHotspot = i; } return; } - QToolTip::remove( this ); + TQToolTip::remove( this ); } -void WidgetCanvas::dropEvent( QDropEvent *e) +void WidgetCanvas::dropEvent( TQDropEvent *e) { - QColor c; + TQColor c; if (KColorDrag::decode( e, c)) { for ( int i = 0; i < MAX_HOTSPOTS; i++ ) if ( hotspots[i].rect.contains( e->pos() ) ) { @@ -99,17 +99,17 @@ void WidgetCanvas::dropEvent( QDropEvent *e) } -void WidgetCanvas::dragEnterEvent( QDragEnterEvent *e) +void WidgetCanvas::dragEnterEvent( TQDragEnterEvent *e) { e->accept( KColorDrag::canDecode( e)); } -void WidgetCanvas::paletteChange(const QPalette &) +void WidgetCanvas::paletteChange(const TQPalette &) { drawSampleWidgets(); } -void WidgetCanvas::resizeEvent(QResizeEvent *) +void WidgetCanvas::resizeEvent(TQResizeEvent *) { drawSampleWidgets(); } @@ -118,13 +118,13 @@ void WidgetCanvas::resizeEvent(QResizeEvent *) * This is necessary because otherwise the scrollbar in drawSampleWidgets() * doesn't show the first time. */ -void WidgetCanvas::showEvent(QShowEvent *) +void WidgetCanvas::showEvent(TQShowEvent *) { drawSampleWidgets(); } -void WidgetCanvas::resetTitlebarPixmaps(const QColor &actMed, - const QColor &disMed) +void WidgetCanvas::resetTitlebarPixmaps(const TQColor &actMed, + const TQColor &disMed) { if(close_pix) delete close_pix; if(maximize_pix) delete maximize_pix; @@ -142,133 +142,133 @@ void WidgetCanvas::resetTitlebarPixmaps(const QColor &actMed, if(dis_pindown_pix) delete dis_pindown_pix; if(dis_menu_pix) delete dis_menu_pix; - QPainter pact, pdis; - QBitmap bitmap; - QColor actHigh = actMed.light(150); - QColor actLow = actMed.dark(120); - QColor disHigh = disMed.light(150); - QColor disLow = disMed.dark(120); + TQPainter pact, pdis; + TQBitmap bitmap; + TQColor actHigh = actMed.light(150); + TQColor actLow = actMed.dark(120); + TQColor disHigh = disMed.light(150); + TQColor disLow = disMed.dark(120); - close_pix = new QPixmap(16, 16); - dis_close_pix = new QPixmap(16, 16); + close_pix = new TQPixmap(16, 16); + dis_close_pix = new TQPixmap(16, 16); pact.begin(close_pix); pdis.begin(dis_close_pix); - bitmap = QBitmap(16, 16, close_white_bits, true); + bitmap = TQBitmap(16, 16, close_white_bits, true); bitmap.setMask(bitmap); pact.setPen(actHigh); pdis.setPen(disHigh); pact.drawPixmap(0, 0, bitmap); pdis.drawPixmap(0, 0, bitmap); - bitmap = QBitmap(16, 16, close_dgray_bits, true); + bitmap = TQBitmap(16, 16, close_dgray_bits, true); pact.setPen(actLow); pdis.setPen(disLow); pact.drawPixmap(0, 0, bitmap); pdis.drawPixmap(0, 0, bitmap); pact.end(); pdis.end(); - bitmap = QBitmap(16, 16, close_mask_bits, true); + bitmap = TQBitmap(16, 16, close_mask_bits, true); close_pix->setMask(bitmap); dis_close_pix->setMask(bitmap); - minimize_pix = new QPixmap(16, 16); - dis_minimize_pix = new QPixmap(16, 16); + minimize_pix = new TQPixmap(16, 16); + dis_minimize_pix = new TQPixmap(16, 16); pact.begin(minimize_pix); pdis.begin(dis_minimize_pix); - bitmap = QBitmap(16, 16, iconify_white_bits, true); + bitmap = TQBitmap(16, 16, iconify_white_bits, true); bitmap.setMask(bitmap); pact.setPen(actHigh); pdis.setPen(disHigh); pact.drawPixmap(0, 0, bitmap); pdis.drawPixmap(0, 0, bitmap); - bitmap = QBitmap(16, 16, iconify_dgray_bits, true); + bitmap = TQBitmap(16, 16, iconify_dgray_bits, true); pact.setPen(actLow); pdis.setPen(disLow); pact.drawPixmap(0, 0, bitmap); pdis.drawPixmap(0, 0, bitmap); pact.end(); pdis.end(); - bitmap = QBitmap(16, 16, iconify_mask_bits, true); + bitmap = TQBitmap(16, 16, iconify_mask_bits, true); minimize_pix->setMask(bitmap); dis_minimize_pix->setMask(bitmap); - maximize_pix = new QPixmap(16, 16); - dis_maximize_pix = new QPixmap(16, 16); + maximize_pix = new TQPixmap(16, 16); + dis_maximize_pix = new TQPixmap(16, 16); pact.begin(maximize_pix); pdis.begin(dis_maximize_pix); - bitmap = QBitmap(16, 16, maximize_white_bits, true); + bitmap = TQBitmap(16, 16, maximize_white_bits, true); bitmap.setMask(bitmap); pact.setPen(actHigh); pdis.setPen(disHigh); pact.drawPixmap(0, 0, bitmap); pdis.drawPixmap(0, 0, bitmap); - bitmap = QBitmap(16, 16, maximize_dgray_bits, true); + bitmap = TQBitmap(16, 16, maximize_dgray_bits, true); pact.setPen(actLow); pdis.setPen(disLow); pact.drawPixmap(0, 0, bitmap); pdis.drawPixmap(0, 0, bitmap); pact.end(); pdis.end(); - bitmap = QBitmap(16, 16, maximize_mask_bits, true); + bitmap = TQBitmap(16, 16, maximize_mask_bits, true); maximize_pix->setMask(bitmap); dis_maximize_pix->setMask(bitmap); - normalize_pix = new QPixmap(16, 16); - dis_normalize_pix = new QPixmap(16, 16); + normalize_pix = new TQPixmap(16, 16); + dis_normalize_pix = new TQPixmap(16, 16); pact.begin(normalize_pix); pdis.begin(dis_normalize_pix); - bitmap = QBitmap(16, 16, maximizedown_white_bits, true); + bitmap = TQBitmap(16, 16, maximizedown_white_bits, true); bitmap.setMask(bitmap); pact.setPen(actHigh); pdis.setPen(disHigh); pact.drawPixmap(0, 0, bitmap); pdis.drawPixmap(0, 0, bitmap); - bitmap = QBitmap(16, 16, maximizedown_dgray_bits, true); + bitmap = TQBitmap(16, 16, maximizedown_dgray_bits, true); pact.setPen(actLow); pdis.setPen(disLow); pact.drawPixmap(0, 0, bitmap); pdis.drawPixmap(0, 0, bitmap); pact.end(); pdis.end(); - bitmap = QBitmap(16, 16, maximizedown_mask_bits, true); + bitmap = TQBitmap(16, 16, maximizedown_mask_bits, true); normalize_pix->setMask(bitmap); dis_normalize_pix->setMask(bitmap); - menu_pix = new QPixmap(16, 16); - dis_menu_pix = new QPixmap(16, 16); + menu_pix = new TQPixmap(16, 16); + dis_menu_pix = new TQPixmap(16, 16); pact.begin(menu_pix); pdis.begin(dis_menu_pix); - bitmap = QBitmap(16, 16, menu_white_bits, true); + bitmap = TQBitmap(16, 16, menu_white_bits, true); bitmap.setMask(bitmap); pact.setPen(actHigh); pdis.setPen(disHigh); pact.drawPixmap(0, 0, bitmap); pdis.drawPixmap(0, 0, bitmap); - bitmap = QBitmap(16, 16, menu_dgray_bits, true); + bitmap = TQBitmap(16, 16, menu_dgray_bits, true); pact.setPen(actLow); pdis.setPen(disLow); pact.drawPixmap(0, 0, bitmap); pdis.drawPixmap(0, 0, bitmap); pact.end(); pdis.end(); - bitmap = QBitmap(16, 16, menu_mask_bits, true); + bitmap = TQBitmap(16, 16, menu_mask_bits, true); menu_pix->setMask(bitmap); dis_menu_pix->setMask(bitmap); - pinup_pix = new QPixmap(16, 16); - dis_pinup_pix = new QPixmap(16, 16); + pinup_pix = new TQPixmap(16, 16); + dis_pinup_pix = new TQPixmap(16, 16); pact.begin(pinup_pix); pdis.begin(dis_pinup_pix); - bitmap = QBitmap(16, 16, pinup_white_bits, true); + bitmap = TQBitmap(16, 16, pinup_white_bits, true); bitmap.setMask(bitmap); pact.setPen(actHigh); pdis.setPen(disHigh); pact.drawPixmap(0, 0, bitmap); pdis.drawPixmap(0, 0, bitmap); - bitmap = QBitmap(16, 16, pinup_gray_bits, true); + bitmap = TQBitmap(16, 16, pinup_gray_bits, true); pact.setPen(actMed); pdis.setPen(disMed); pact.drawPixmap(0, 0, bitmap); pdis.drawPixmap(0, 0, bitmap); - bitmap = QBitmap(16, 16, pinup_dgray_bits, true); + bitmap = TQBitmap(16, 16, pinup_dgray_bits, true); bitmap.setMask(bitmap); pact.setPen(actLow); pdis.setPen(disLow); pact.drawPixmap(0, 0, bitmap); pdis.drawPixmap(0, 0, bitmap); pact.end(); pdis.end(); - bitmap = QBitmap(16, 16, pinup_mask_bits, true); + bitmap = TQBitmap(16, 16, pinup_mask_bits, true); pinup_pix->setMask(bitmap); dis_pinup_pix->setMask(bitmap); - pindown_pix = new QPixmap(16, 16); - dis_pindown_pix = new QPixmap(16, 16); + pindown_pix = new TQPixmap(16, 16); + dis_pindown_pix = new TQPixmap(16, 16); pact.begin(pindown_pix); pdis.begin(dis_pindown_pix); - bitmap = QBitmap(16, 16, pindown_white_bits, true); + bitmap = TQBitmap(16, 16, pindown_white_bits, true); bitmap.setMask(bitmap); pact.setPen(actHigh); pdis.setPen(disHigh); pact.drawPixmap(0, 0, bitmap); pdis.drawPixmap(0, 0, bitmap); - bitmap = QBitmap(16, 16, pindown_gray_bits, true); + bitmap = TQBitmap(16, 16, pindown_gray_bits, true); pact.setPen(actMed); pdis.setPen(disMed); pact.drawPixmap(0, 0, bitmap); pdis.drawPixmap(0, 0, bitmap); - bitmap = QBitmap(16, 16, pindown_dgray_bits, true); + bitmap = TQBitmap(16, 16, pindown_dgray_bits, true); bitmap.setMask(bitmap); pact.setPen(actLow); pdis.setPen(disLow); pact.drawPixmap(0, 0, bitmap); pdis.drawPixmap(0, 0, bitmap); pact.end(); pdis.end(); - bitmap = QBitmap(16, 16, pindown_mask_bits, true); + bitmap = TQBitmap(16, 16, pindown_mask_bits, true); pindown_pix->setMask(bitmap); dis_pindown_pix->setMask(bitmap); } @@ -282,15 +282,15 @@ void WidgetCanvas::drawSampleWidgets() // Keep in sync with kglobalsettings. - QFont windowFontGuess(KGlobalSettings::generalFont().family(), 12, QFont::SansSerif, true); + TQFont windowFontGuess(KGlobalSettings::generalFont().family(), 12, TQFont::SansSerif, true); windowFontGuess.setPixelSize(12); c->setGroup("WM"); - QFont windowFont = c->readFontEntry("activeFont", &windowFontGuess); + TQFont windowFont = c->readFontEntry("activeFont", &windowFontGuess); c->setGroup("General"); - QFont defaultMenuFont = KGlobalSettings::menuFont(); - QFont menuFont = c->readFontEntry("menuFont", &defaultMenuFont); + TQFont defaultMenuFont = KGlobalSettings::menuFont(); + TQFont menuFont = c->readFontEntry("menuFont", &defaultMenuFont); delete c; c = 0; @@ -301,7 +301,7 @@ void WidgetCanvas::drawSampleWidgets() highlightVal=100+(2*contrast+4)*16/10; lowlightVal=100+(2*contrast+4)*10; - QColorGroup cg( txt, back, + TQColorGroup cg( txt, back, back.light(highlightVal), back.dark(lowlightVal), back.dark(120), @@ -309,26 +309,26 @@ void WidgetCanvas::drawSampleWidgets() // We will need this brush. - QBrush brush(SolidPattern); + TQBrush brush(SolidPattern); brush.setColor( back ); // Create a scrollbar and redirect drawing into a temp. pixmap to save a // lot of fiddly drawing later. - QScrollBar *vertScrollBar = new QScrollBar( QScrollBar::Vertical, this ); - // TODO: vertScrollBar->setStyle( new QMotifStyle() ); + TQScrollBar *vertScrollBar = new TQScrollBar( TQScrollBar::Vertical, this ); + // TODO: vertScrollBar->setStyle( new TQMotifStyle() ); vertScrollBar->setGeometry( 400, 400, SCROLLBAR_SIZE, height()); vertScrollBar->setRange( 0, 0 ); - vertScrollBar->setPalette( QPalette(cg,cg,cg)); + vertScrollBar->setPalette( TQPalette(cg,cg,cg)); vertScrollBar->show(); - QPixmap pm( vertScrollBar->width(), vertScrollBar->height() ); + TQPixmap pm( vertScrollBar->width(), vertScrollBar->height() ); pm.fill( back ); #ifndef __osf__ - QPainter::redirect( vertScrollBar, &pm ); + TQPainter::redirect( vertScrollBar, &pm ); #endif vertScrollBar->repaint(); - QPainter::redirect( vertScrollBar, 0 ); + TQPainter::redirect( vertScrollBar, 0 ); vertScrollBar->hide(); // Reset the titlebar pixmaps @@ -342,7 +342,7 @@ void WidgetCanvas::drawSampleWidgets() // Actually start painting in - QPainter paint( &smplw ); + TQPainter paint( &smplw ); // Inactive window @@ -377,19 +377,19 @@ void WidgetCanvas::drawSampleWidgets() int spot = 0; hotspots[ spot++ ] = - HotSpot( QRect( 65, 25-14, textLen, 14 ), CSM_Inactive_title_text ); + HotSpot( TQRect( 65, 25-14, textLen, 14 ), CSM_Inactive_title_text ); hotspots[ spot++ ] = - HotSpot( QRect( 60, 10, (width()-160)/2, 20 ), CSM_Inactive_title_bar ); + HotSpot( TQRect( 60, 10, (width()-160)/2, 20 ), CSM_Inactive_title_bar ); hotspots[ spot++ ] = - HotSpot( QRect( 60+(width()-160)/2, 10, + HotSpot( TQRect( 60+(width()-160)/2, 10, (width()-160)/2, 20 ), CSM_Inactive_title_blend ); hotspots[spot++] = - HotSpot(QRect(20, 12, 40, 20), CSM_Inactive_title_button); + HotSpot(TQRect(20, 12, 40, 20), CSM_Inactive_title_button); hotspots[spot++] = - HotSpot(QRect(tmp, 12, 60, 20), CSM_Inactive_title_button); + HotSpot(TQRect(tmp, 12, 60, 20), CSM_Inactive_title_button); // Active window @@ -420,44 +420,44 @@ void WidgetCanvas::drawSampleWidgets() paint.drawPixmap(tmp+42, 35, *close_pix); hotspots[ spot++ ] = - HotSpot( QRect( 75, 50-14, textLen, 14 ), CSM_Active_title_text); + HotSpot( TQRect( 75, 50-14, textLen, 14 ), CSM_Active_title_text); hotspots[ spot ++] = - HotSpot( QRect( 65, 35, (width()-152)/2, 20 ), CSM_Active_title_bar ); + HotSpot( TQRect( 65, 35, (width()-152)/2, 20 ), CSM_Active_title_bar ); hotspots[ spot ++] = - HotSpot( QRect( 65+(width()-152)/2, 35, + HotSpot( TQRect( 65+(width()-152)/2, 35, (width()-152)/2, 20 ), CSM_Active_title_blend ); hotspots[spot++] = - HotSpot(QRect(25, 35, 40, 20), CSM_Active_title_button); + HotSpot(TQRect(25, 35, 40, 20), CSM_Active_title_button); hotspots[spot++] = - HotSpot(QRect(tmp, 35, 60, 20), CSM_Active_title_button); + HotSpot(TQRect(tmp, 35, 60, 20), CSM_Active_title_button); // Menu bar //qDrawShadePanel ( &paint, 25, 55, width()-52, 28, cg, FALSE, 2, &brush); - kapp->style().drawPrimitive(QStyle::PE_PanelMenuBar, &paint, - QRect(QPoint(25, 55), QSize(width()-52, 28)), cg); + kapp->style().drawPrimitive(TQStyle::PE_PanelMenuBar, &paint, + TQRect(TQPoint(25, 55), TQSize(width()-52, 28)), cg); paint.setFont( menuFont ); paint.setPen(txt ); - QString file = i18n("File"); + TQString file = i18n("File"); textLen = paint.fontMetrics().width( file ); //qDrawShadePanel ( &paint, 30, 59, textLen + 10, 21, cg, FALSE, 2, &brush); - kapp->style().drawPrimitive(QStyle::PE_Panel, &paint, - QRect(30, 59, textLen + 10, 21), cg); + kapp->style().drawPrimitive(TQStyle::PE_Panel, &paint, + TQRect(30, 59, textLen + 10, 21), cg); paint.drawText( 35, 74, file ); hotspots[ spot++ ] = - HotSpot( QRect( 35, 62, textLen, 14 ), CSM_Text ); + HotSpot( TQRect( 35, 62, textLen, 14 ), CSM_Text ); hotspots[ spot++ ] = - HotSpot( QRect( 27, 57, 33, 21 ), CSM_Background ); + HotSpot( TQRect( 27, 57, 33, 21 ), CSM_Background ); paint.setFont( menuFont ); paint.setPen( txt ); paint.drawText( 35 + textLen + 20, 74, i18n("Edit") ); textLen = paint.fontMetrics().width( i18n("Edit") ); - hotspots[ spot++ ] = HotSpot( QRect( 35 + textLen + 20, 62, textLen, 14 ), CSM_Text ); + hotspots[ spot++ ] = HotSpot( TQRect( 35 + textLen + 20, 62, textLen, 14 ), CSM_Text ); // Button Rects need to go before window @@ -468,7 +468,7 @@ void WidgetCanvas::drawSampleWidgets() height(), cg, TRUE, 2, &brush); // Standard text - QFont fnt = KGlobalSettings::generalFont(); + TQFont fnt = KGlobalSettings::generalFont(); paint.setFont( fnt ); paint.setPen( windowTxt ); paint.drawText( 140, 127-20, i18n( "Standard text") ); @@ -476,7 +476,7 @@ void WidgetCanvas::drawSampleWidgets() int column2 = 120 + textLen + 40 + 16; hotspots[ spot++ ] = - HotSpot( QRect( 140, 113-20, textLen, 14 ), CSM_Standard_text ); + HotSpot( TQRect( 140, 113-20, textLen, 14 ), CSM_Standard_text ); // Selected text textLen = paint.fontMetrics().width( i18n("Selected text") ); @@ -491,9 +491,9 @@ void WidgetCanvas::drawSampleWidgets() paint.drawText( 140, 135, i18n( "Selected text") ); hotspots[ spot++ ] = - HotSpot( QRect( 140, 121, textLen, 14 ), CSM_Select_text ); + HotSpot( TQRect( 140, 121, textLen, 14 ), CSM_Select_text ); hotspots[ spot++ ] = - HotSpot( QRect( 120, 115, textLen+40, 32), CSM_Select_background ); // select bg + HotSpot( TQRect( 120, 115, textLen+40, 32), CSM_Select_background ); // select bg // Link paint.setPen( link ); @@ -502,7 +502,7 @@ void WidgetCanvas::drawSampleWidgets() paint.drawLine( column2+18, 109, column2+18+textLen, 109); hotspots[ spot++ ] = - HotSpot( QRect( column2+18, 113-20, textLen, 17 ), CSM_Link ); + HotSpot( TQRect( column2+18, 113-20, textLen, 17 ), CSM_Link ); int column3 = column2 + 25 + textLen; // Followed Link @@ -512,24 +512,24 @@ void WidgetCanvas::drawSampleWidgets() paint.drawLine( column3, 109, column3+textLen, 109); hotspots[ spot++ ] = - HotSpot( QRect( column3, 113-20, textLen, 17 ), CSM_Followed_Link ); + HotSpot( TQRect( column3, 113-20, textLen, 17 ), CSM_Followed_Link ); // Button int xpos = column2; int ypos = 115 + 2; textLen = paint.fontMetrics().width(i18n("Push Button")); hotspots[ spot++ ] = - HotSpot( QRect(xpos+16, ypos+((28-paint.fontMetrics().height())/2), + HotSpot( TQRect(xpos+16, ypos+((28-paint.fontMetrics().height())/2), textLen, paint.fontMetrics().height()), CSM_Button_text ); hotspots[ spot++ ] = - HotSpot( QRect(xpos, ypos, textLen+32, 28), CSM_Button_background ); + HotSpot( TQRect(xpos, ypos, textLen+32, 28), CSM_Button_background ); //brush.setColor( button ); - QColorGroup cg2(cg); - cg2.setColor(QColorGroup::Button, button); - cg2.setColor(QColorGroup::Background, window); + TQColorGroup cg2(cg); + cg2.setColor(TQColorGroup::Button, button); + cg2.setColor(TQColorGroup::Background, window); //qDrawWinButton(&paint, xpos, ypos, textLen+32, 28, cg, false, &brush); - kapp->style().drawPrimitive(QStyle::PE_ButtonCommand, &paint, - QRect(xpos, ypos, textLen+32, 28), cg2, QStyle::Style_Enabled | QStyle::Style_Raised); + kapp->style().drawPrimitive(TQStyle::PE_ButtonCommand, &paint, + TQRect(xpos, ypos, textLen+32, 28), cg2, TQStyle::Style_Enabled | TQStyle::Style_Raised); paint.setPen(buttonTxt); paint.drawText(xpos, ypos, textLen+32, 28, AlignCenter, i18n("Push Button")); @@ -547,20 +547,20 @@ void WidgetCanvas::drawSampleWidgets() textLenNew = paint.fontMetrics().width( i18n("New") ); hotspots[ spot++ ] = - HotSpot( QRect( 56, 83, textLenNew, 14 ), CSM_Text ); + HotSpot( TQRect( 56, 83, textLenNew, 14 ), CSM_Text ); paint.setFont( menuFont ); textLenOpen = paint.fontMetrics().width( i18n("Menu item", "Open") ); hotspots[ spot++ ] = - HotSpot( QRect( 56, 105, textLenOpen, 14 ), CSM_Text ); + HotSpot( TQRect( 56, 105, textLenOpen, 14 ), CSM_Text ); paint.setFont( menuFont ); textLenSave = paint.fontMetrics().width( i18n("Menu item", "Save") ); - QPopupMenu *popup = new QPopupMenu( this ); + TQPopupMenu *popup = new TQPopupMenu( this ); popup->setFont( menuFont ); - popup->setPalette( QPalette(cg,cg,cg)); + popup->setPalette( TQPalette(cg,cg,cg)); popup->insertItem(i18n("New")); popup->insertItem(i18n("Menu item", "Open")); int id = popup->insertItem(i18n("Menu item", "Save")); @@ -571,15 +571,15 @@ void WidgetCanvas::drawSampleWidgets() //popup->sizeHint(); // Breaks with Qt 3.3 popup->resize(popup->sizeHint()); - pm = QPixmap::grabWidget( popup ); + pm = TQPixmap::grabWidget( popup ); delete popup; bitBlt(&smplw, 30, 80, &pm, 0, 0, pm.width(), pm.height()); hotspots[ spot++ ] = - HotSpot( QRect( 28, 78, 88, 77 ), CSM_Background ); + HotSpot( TQRect( 28, 78, 88, 77 ), CSM_Background ); hotspots[ spot++ ] = - HotSpot( QRect(25, 80+5-4, width()-7-45-2-16, height()), CSM_Standard_background ); + HotSpot( TQRect(25, 80+5-4, width()-7-45-2-16, height()), CSM_Standard_background ); // Valance @@ -590,7 +590,7 @@ void WidgetCanvas::drawSampleWidgets() // Stop the painting hotspots[ spot++ ] = - HotSpot( QRect( 0, 0, width(), height() ), CSM_Background ); // ? + HotSpot( TQRect( 0, 0, width(), height() ), CSM_Background ); // ? repaint( FALSE ); } diff --git a/kcontrol/colors/widgetcanvas.h b/kcontrol/colors/widgetcanvas.h index e2f9bd057..4e78d599e 100644 --- a/kcontrol/colors/widgetcanvas.h +++ b/kcontrol/colors/widgetcanvas.h @@ -8,7 +8,7 @@ #ifndef __WIDGETCANVAS_H__ #define __WIDGETCANVAS_H__ -#include +#include #include #define MAX_HOTSPOTS 28 @@ -51,10 +51,10 @@ class HotSpot { public: HotSpot() {} - HotSpot( const QRect &r, int num ) + HotSpot( const TQRect &r, int num ) : rect(r), number(num) {} - QRect rect; + TQRect rect; int number; }; @@ -63,57 +63,57 @@ class WidgetCanvas : public QWidget Q_OBJECT public: - WidgetCanvas( QWidget *parent=0, const char *name=0 ); + WidgetCanvas( TQWidget *parent=0, const char *name=0 ); void drawSampleWidgets(); - void resetTitlebarPixmaps(const QColor &active, - const QColor &inactive); - void addToolTip( int area, const QString & ); - QPixmap smplw; + void resetTitlebarPixmaps(const TQColor &active, + const TQColor &inactive); + void addToolTip( int area, const TQString & ); + TQPixmap smplw; - QColor iaTitle; - QColor iaTxt; - QColor iaBlend; - QColor iaFrame; - QColor iaHandle; - QColor aTitle; - QColor aTxt; - QColor aBlend; - QColor aFrame; - QColor aHandle; - QColor back; - QColor txt; - QColor select; - QColor selectTxt; - QColor window; - QColor windowTxt; - QColor button; - QColor buttonTxt; - QColor aTitleBtn; - QColor iTitleBtn; - QColor link; - QColor visitedLink; - QColor alternateBackground; + TQColor iaTitle; + TQColor iaTxt; + TQColor iaBlend; + TQColor iaFrame; + TQColor iaHandle; + TQColor aTitle; + TQColor aTxt; + TQColor aBlend; + TQColor aFrame; + TQColor aHandle; + TQColor back; + TQColor txt; + TQColor select; + TQColor selectTxt; + TQColor window; + TQColor windowTxt; + TQColor button; + TQColor buttonTxt; + TQColor aTitleBtn; + TQColor iTitleBtn; + TQColor link; + TQColor visitedLink; + TQColor alternateBackground; int contrast; bool shadeSortColumn; signals: void widgetSelected( int ); - void colorDropped( int, const QColor&); + void colorDropped( int, const TQColor&); protected: - void redrawPopup(const QColorGroup &cg); + void redrawPopup(const TQColorGroup &cg); - virtual void paintEvent( QPaintEvent * ); - virtual void mousePressEvent( QMouseEvent * ); - virtual void mouseMoveEvent( QMouseEvent * ); - virtual void resizeEvent( QResizeEvent * ); - virtual void showEvent( QShowEvent * ); - virtual void dropEvent( QDropEvent *); - virtual void dragEnterEvent( QDragEnterEvent *); - void paletteChange( const QPalette & ); + virtual void paintEvent( TQPaintEvent * ); + virtual void mousePressEvent( TQMouseEvent * ); + virtual void mouseMoveEvent( TQMouseEvent * ); + virtual void resizeEvent( TQResizeEvent * ); + virtual void showEvent( TQShowEvent * ); + virtual void dropEvent( TQDropEvent *); + virtual void dragEnterEvent( TQDragEnterEvent *); + void paletteChange( const TQPalette & ); - QMap tips; + TQMap tips; HotSpot hotspots[MAX_HOTSPOTS]; int currentHotspot; }; -- cgit v1.2.3