TQt4 port the Lipstik style

This enables compilation under both Qt3 and Qt4


git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kde-style-lipstik@1234205 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
v3.5.13-sru
tpearson 12 years ago
parent b5b99fa4d2
commit 1d95710a43
  1. 424
      style/config/lipstikconf.cpp
  2. 113
      style/config/lipstikconf.h
  3. 1222
      style/lipstik.cpp
  4. 235
      style/lipstik.h
  5. 14
      style/misc.cpp
  6. 2
      style/misc.h

@ -28,126 +28,126 @@ DEALINGS IN THE SOFTWARE.
*/
#include <qcheckbox.h>
#include <qlayout.h>
#include <qhbox.h>
#include <qsettings.h>
#include <qcolor.h>
#include <qlabel.h>
#include <qcombobox.h>
#include <tqcheckbox.h>
#include <tqlayout.h>
#include <tqhbox.h>
#include <tqsettings.h>
#include <tqcolor.h>
#include <tqlabel.h>
#include <tqcombobox.h>
#include <kglobal.h>
#include <klocale.h>
#include <kcolorbutton.h>
#include <qtabwidget.h>
#include <qvgroupbox.h>
#include <qspinbox.h>
#include <qgrid.h>
#include <tqtabwidget.h>
#include <tqvgroupbox.h>
#include <tqspinbox.h>
#include <tqgrid.h>
#include "lipstikconf.h"
extern "C"
{
QWidget* allocate_kstyle_config(QWidget* parent)
TQWidget* allocate_kstyle_config(TQWidget* tqparent)
{
KGlobal::locale()->insertCatalogue("kstyle_lipstik_config");
return new LipstikStyleConfig(parent);
return new LipstikStyleConfig(tqparent);
}
}
LipstikStyleConfig::LipstikStyleConfig(QWidget* parent): QWidget(parent)
LipstikStyleConfig::LipstikStyleConfig(TQWidget* tqparent): TQWidget(tqparent)
{
QVBoxLayout* layout = new QVBoxLayout(this, 0, 0);
QGridLayout* tabLayout = new QGridLayout(this, 2, 1, 10);
TQVBoxLayout* tqlayout = new TQVBoxLayout(this, 0, 0);
TQGridLayout* tabLayout = new TQGridLayout(this, 2, 1, 10);
KGlobal::locale()->insertCatalogue("kstyle_lipstik_config");
///Init tabs
QTabWidget *tabWidget = new QTabWidget(this);
layout->addWidget(tabWidget);
TQTabWidget *tabWidget = new TQTabWidget(this);
tqlayout->addWidget(tabWidget);
///Init tab1
QWidget *page1 = new QWidget(tabWidget);
layout = new QVBoxLayout(page1);
TQWidget *page1 = new TQWidget(tabWidget);
tqlayout = new TQVBoxLayout(page1);
tabWidget->insertTab(page1, i18n("Configuration"));
layout->addLayout(tabLayout);
tqlayout->addLayout(tabLayout);
///General group
QVGroupBox *generalGrp = new QVGroupBox(i18n("General"), page1);
TQVGroupBox *generalGrp = new TQVGroupBox(i18n("General"), page1);
reverseGradients = new QCheckBox(i18n("Plastik gradients"), generalGrp );
drawTriangularExpander = new QCheckBox(i18n("Triangular tree expander"), generalGrp);
drawStatusBarFrame = new QCheckBox(i18n("Draw status bar frame"), generalGrp);
animateProgressBar = new QCheckBox(i18n("Animate progress bars"), generalGrp);
flatHeaders = new QCheckBox(i18n("Flatten column headers"), generalGrp);
tickCheckMark = new QCheckBox(i18n("Use a tick for checkmarks"), generalGrp);
reverseGradients = new TQCheckBox(i18n("Plastik gradients"), generalGrp );
drawTriangularExpander = new TQCheckBox(i18n("Triangular tree expander"), generalGrp);
drawStatusBarFrame = new TQCheckBox(i18n("Draw status bar frame"), generalGrp);
animateProgressBar = new TQCheckBox(i18n("Animate progress bars"), generalGrp);
flatHeaders = new TQCheckBox(i18n("Flatten column headers"), generalGrp);
tickCheckMark = new TQCheckBox(i18n("Use a tick for checkmarks"), generalGrp);
tabLayout->addWidget(generalGrp,0,0,0);
///Toolbar group
QVGroupBox *toolbarGrp = new QVGroupBox(i18n("Toolbars"), page1);
QLabel* toolBarSpacingLabel;
TQVGroupBox *toolbarGrp = new TQVGroupBox(i18n("Toolbars"), page1);
TQLabel* toolBarSpacingLabel;
drawToolBarSeparator = new QCheckBox(i18n("Draw separators"), toolbarGrp);
drawToolBarItemSeparator = new QCheckBox(i18n("Draw item separators"), toolbarGrp);
drawToolBarHandle = new QCheckBox(i18n("Draw handles"), toolbarGrp);
drawToolBarGradient = new QCheckBox(i18n("Draw gradients"), toolbarGrp);
invertBarGrad = new QCheckBox(i18n("Invert gradients"), toolbarGrp);
drawToolBarSeparator = new TQCheckBox(i18n("Draw separators"), toolbarGrp);
drawToolBarItemSeparator = new TQCheckBox(i18n("Draw item separators"), toolbarGrp);
drawToolBarHandle = new TQCheckBox(i18n("Draw handles"), toolbarGrp);
drawToolBarGradient = new TQCheckBox(i18n("Draw gradients"), toolbarGrp);
invertBarGrad = new TQCheckBox(i18n("Invert gradients"), toolbarGrp);
toolBarSpacingLabel = new QLabel(toolbarGrp);
toolBarSpacingLabel = new TQLabel(toolbarGrp);
toolBarSpacingLabel->setText(i18n("Items spacing :"));
toolBarSpacing = new QSpinBox ( 0, 6, 1, toolbarGrp );
toolBarSpacing = new TQSpinBox ( 0, 6, 1, toolbarGrp );
tabLayout->addWidget(toolbarGrp,0,1,0);
///Menus group
QVGroupBox *menusGrp = new QVGroupBox(i18n("Menus"), page1);
QLabel* menuSpacingLabel;
TQVGroupBox *menusGrp = new TQVGroupBox(i18n("Menus"), page1);
TQLabel* menuSpacingLabel;
alterMenuGradients = new QCheckBox(i18n("Button-like menu gradients"), menusGrp);
sharperMenuGradient = new QCheckBox(i18n("Sharper menu gradients"), menusGrp);
alterMenuGradients = new TQCheckBox(i18n("Button-like menu gradients"), menusGrp);
sharperMenuGradient = new TQCheckBox(i18n("Sharper menu gradients"), menusGrp);
menuLeftSideBar = new QCheckBox(i18n("Menu Stripe"), menusGrp);
flatStripe = new QCheckBox(i18n("Flatten Stripe"), menusGrp);
customMenuStripeColor = new QCheckBox(i18n("Custom Stripe color :"), menusGrp);
QHBox *menuColorBox = new QHBox(menusGrp);
menuColorBox->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) );
menuLeftSideBar = new TQCheckBox(i18n("Menu Stripe"), menusGrp);
flatStripe = new TQCheckBox(i18n("Flatten Stripe"), menusGrp);
customMenuStripeColor = new TQCheckBox(i18n("Custom Stripe color :"), menusGrp);
TQHBox *menuColorBox = new TQHBox(menusGrp);
menuColorBox->tqlayout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) );
menuStripeColor = new KColorButton(menuColorBox);
menuSpacingLabel = new QLabel(menusGrp);
menuSpacingLabel = new TQLabel(menusGrp);
menuSpacingLabel->setText(i18n("Menu spacing :"));
menuSpacing = new QSpinBox ( 0, 8, 1, menusGrp );
menuSpacing = new TQSpinBox ( 0, 8, 1, menusGrp );
tabLayout->addWidget(menusGrp,1,0,0);
///Scrollbar group
QVGroupBox *scrollGrp = new QVGroupBox(i18n("Scrollbars and Sliders"), page1);
QLabel* scrollBarStyleLabel;
QLabel* scrollBarWidthLabel;
QLabel* sliderStyleLabel;
TQVGroupBox *scrollGrp = new TQVGroupBox(i18n("Scrollbars and Sliders"), page1);
TQLabel* scrollBarStyleLabel;
TQLabel* scrollBarWidthLabel;
TQLabel* sliderStyleLabel;
paintGroove = new QCheckBox(i18n("Draw Scrollbar grooves"), scrollGrp);
paintGroove = new TQCheckBox(i18n("Draw Scrollbar grooves"), scrollGrp);
scrollBarStyleLabel = new QLabel(scrollGrp);
scrollBarStyleLabel = new TQLabel(scrollGrp);
scrollBarStyleLabel->setText(i18n("Scrollbar style : "));
scrollBarStyle = new QComboBox(i18n("Scrollbar style"), scrollGrp);
scrollBarStyle = new TQComboBox(i18n("Scrollbar style"), scrollGrp);
scrollBarStyle->setEditable(false);
scrollBarStyle->insertItem("Windows style");
scrollBarStyle->insertItem("Platinum style");
scrollBarStyle->insertItem("KDE style");
scrollBarStyle->insertItem("Next style");
scrollBarWidthLabel = new QLabel(scrollGrp);
scrollBarWidthLabel = new TQLabel(scrollGrp);
scrollBarWidthLabel->setText(i18n("Scrollbar width : "));
scrollBarWidth = new QComboBox(i18n("Scrollbar width"), scrollGrp);
scrollBarWidth = new TQComboBox(i18n("Scrollbar width"), scrollGrp);
scrollBarWidth->setEditable(false);
scrollBarWidth->insertItem("Small");
scrollBarWidth->insertItem("Normal");
scrollBarWidth->insertItem("Large");
sliderStyleLabel = new QLabel(scrollGrp);
sliderStyleLabel = new TQLabel(scrollGrp);
sliderStyleLabel->setText(i18n("Slider handle size : "));
sliderStyle = new QComboBox(i18n("Slider handle size"), scrollGrp);
sliderStyle = new TQComboBox(i18n("Slider handle size"), scrollGrp);
sliderStyle->setEditable(false);
sliderStyle->insertItem("Small");
sliderStyle->insertItem("Medium");
@ -156,143 +156,143 @@ LipstikStyleConfig::LipstikStyleConfig(QWidget* parent): QWidget(parent)
tabLayout->addWidget(scrollGrp,1,1,0);
///Highlighting group
QVGroupBox *lightGrp = new QVGroupBox(i18n("Highlighting"), page1);
TQVGroupBox *lightGrp = new TQVGroupBox(i18n("Highlighting"), page1);
drawFocusRect = new QCheckBox(i18n("Colored focus rectangle"), lightGrp);
comboboxColored = new QCheckBox(i18n("Colored comboboxes handles"), lightGrp);
coloredMenuBar = new QCheckBox(i18n("Colored menu bar items"), lightGrp);
drawTabHighlight = new QCheckBox(i18n("Highlight active tab"), lightGrp);
inputFocusHighlight = new QCheckBox(i18n("Highlight focused input fields"), lightGrp);
drawFocusRect = new TQCheckBox(i18n("Colored focus rectangle"), lightGrp);
comboboxColored = new TQCheckBox(i18n("Colored comboboxes handles"), lightGrp);
coloredMenuBar = new TQCheckBox(i18n("Colored menu bar items"), lightGrp);
drawTabHighlight = new TQCheckBox(i18n("Highlight active tab"), lightGrp);
inputFocusHighlight = new TQCheckBox(i18n("Highlight focused input fields"), lightGrp);
tabLayout->addWidget(lightGrp,0,2,0);
///Other colors group
QVGroupBox *otherGrp = new QVGroupBox(i18n("Custom colors"), page1);
TQVGroupBox *otherGrp = new TQVGroupBox(i18n("Custom colors"), page1);
customFocusHighlightColor = new QCheckBox(i18n("Input fields highlight :"), otherGrp);
QHBox *hbox1 = new QHBox(otherGrp);
hbox1->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) );
customFocusHighlightColor = new TQCheckBox(i18n("Input fields highlight :"), otherGrp);
TQHBox *hbox1 = new TQHBox(otherGrp);
hbox1->tqlayout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) );
focusHighlightColor = new KColorButton(hbox1);
customOverHighlightColor = new QCheckBox(i18n("Mouse hover highlight :"), otherGrp);
QHBox *hbox2 = new QHBox(otherGrp);
hbox2->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) );
customOverHighlightColor = new TQCheckBox(i18n("Mouse hover highlight :"), otherGrp);
TQHBox *hbox2 = new TQHBox(otherGrp);
hbox2->tqlayout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) );
overHighlightColor = new KColorButton(hbox2);
customCheckMarkColor = new QCheckBox(i18n("Checkmark/Radiobuttons :"), otherGrp);
QHBox *hbox3 = new QHBox(otherGrp);
hbox3->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) );
customCheckMarkColor = new TQCheckBox(i18n("Checkmark/Radiobuttons :"), otherGrp);
TQHBox *hbox3 = new TQHBox(otherGrp);
hbox3->tqlayout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) );
checkMarkColor = new KColorButton(hbox3);
customTabHighlightColor = new QCheckBox(i18n("Active tab highlight :"), otherGrp);
QHBox *hbox4 = new QHBox(otherGrp);
hbox4->layout()->addItem(new QSpacerItem(20, 0, QSizePolicy::Fixed, QSizePolicy::Minimum) );
customTabHighlightColor = new TQCheckBox(i18n("Active tab highlight :"), otherGrp);
TQHBox *hbox4 = new TQHBox(otherGrp);
hbox4->tqlayout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) );
tabHighlightColor = new KColorButton(hbox4);
tabLayout->addWidget(otherGrp,1,2,0);
///Init tab2
QWidget *page2 = new QWidget(tabWidget);
QLabel* lipstikLabel;
QLabel* authorLabel;
QLabel* authorAddressLabel;
QLabel* authorWebLabel;
QLabel* plastikLabel;
QLabel* alsoLabel;
QLabel* cuLabel;
QLabel* dnLabel;
QLabel* pqLabel;
QLabel* cxLabel;
QLabel* kpLabel;
QLabel* blLabel;
QLabel* ksLabel;
QLabel* peLabel;
QLabel* bastianLabel;
QLabel* pcbsdLabel;
QLabel* othersLabel;
layout = new QVBoxLayout(page2, 10, -1);
TQWidget *page2 = new TQWidget(tabWidget);
TQLabel* lipstikLabel;
TQLabel* authorLabel;
TQLabel* authorAddressLabel;
TQLabel* authorWebLabel;
TQLabel* plastikLabel;
TQLabel* alsoLabel;
TQLabel* cuLabel;
TQLabel* dnLabel;
TQLabel* pqLabel;
TQLabel* cxLabel;
TQLabel* kpLabel;
TQLabel* blLabel;
TQLabel* ksLabel;
TQLabel* peLabel;
TQLabel* bastianLabel;
TQLabel* pcbsdLabel;
TQLabel* othersLabel;
tqlayout = new TQVBoxLayout(page2, 10, -1);
tabWidget->insertTab(page2, i18n("About"));
lipstikLabel = new QLabel(page2);
lipstikLabel = new TQLabel(page2);
lipstikLabel->setText(i18n("Lipstik 2.2.3"));
lipstikLabel->setFrameStyle( QFrame::StyledPanel | QFrame::Raised );
lipstikLabel->setFrameStyle( TQFrame::StyledPanel | TQFrame::Raised );
authorLabel = new QLabel(page2);
authorLabel = new TQLabel(page2);
authorLabel->setText(i18n(" Copyright 2004-2005-2006-2007 (C) Patrice Tremblay (Poplix)"));
authorAddressLabel = new QLabel(page2);
authorAddressLabel = new TQLabel(page2);
authorAddressLabel->setText(i18n(" poplixos@gmail.com"));
authorWebLabel = new QLabel(page2);
authorWebLabel = new TQLabel(page2);
authorWebLabel->setText(i18n(" http://poplix.homelinux.com/lipstik"));
plastikLabel = new QLabel(page2);
plastikLabel = new TQLabel(page2);
plastikLabel->setText(i18n("Based on plastik [thanks to Sandro Giessl]"));
alsoLabel = new QLabel(page2);
alsoLabel = new TQLabel(page2);
alsoLabel->setText(i18n("Also based on :"));
cuLabel = new QLabel(page2);
cuLabel->setText(i18n(" QtCurve [thanks to Craig Drummond],"));
cuLabel = new TQLabel(page2);
cuLabel->setText(i18n(" TQtCurve [thanks to Craig Drummond],"));
dnLabel = new QLabel(page2);
dnLabel = new TQLabel(page2);
dnLabel->setText(i18n(" DotNET [thanks to Chris Lee],"));
pqLabel = new QLabel(page2);
pqLabel = new TQLabel(page2);
pqLabel->setText(i18n(" PlastikQ [thanks to Martin Beck],"));
cxLabel = new QLabel(page2);
cxLabel = new TQLabel(page2);
cxLabel->setText(i18n(" Comix [thanks to Jens Luetkens],"));
kpLabel = new QLabel(page2);
kpLabel = new TQLabel(page2);
kpLabel->setText(i18n(" Krisp [thanks to Keith Meehl],"));
blLabel = new QLabel(page2);
blLabel = new TQLabel(page2);
blLabel->setText(i18n(" Ballistik [thanks to Florian Merz],"));
ksLabel = new QLabel(page2);
ksLabel = new TQLabel(page2);
ksLabel->setText(i18n(" Kerastik [thanks to Victor Perez Q],"));
peLabel = new QLabel(page2);
peLabel = new TQLabel(page2);
peLabel->setText(i18n(" Polyester [thanks to Marco Martin]."));
bastianLabel = new QLabel(page2);
bastianLabel = new TQLabel(page2);
bastianLabel->setText(i18n("Thanks to Bastian Venthur, the Debian maintainer of kde-style-lipstik."));
pcbsdLabel = new QLabel(page2);
pcbsdLabel = new TQLabel(page2);
pcbsdLabel->setText(i18n("Thanks to Charles A. Landemaine, of PC-BSD, for the feature suggestion."));
othersLabel = new QLabel(page2);
othersLabel = new TQLabel(page2);
othersLabel->setText(i18n("Special thanks to Dominique and all the kde-look.org users."));
layout->add(lipstikLabel);
layout->add(authorLabel);
layout->add(authorAddressLabel);
layout->add(authorWebLabel);
layout->addSpacing(10);
layout->add(plastikLabel);
layout->addSpacing(10);
layout->add(alsoLabel);
layout->add(cuLabel);
layout->add(dnLabel);
layout->add(pqLabel);
layout->add(cxLabel);
layout->add(kpLabel);
layout->add(blLabel);
layout->add(ksLabel);
layout->add(peLabel);
layout->addSpacing(10);
layout->add(bastianLabel);
layout->add(pcbsdLabel);
layout->add(othersLabel);
tqlayout->add(lipstikLabel);
tqlayout->add(authorLabel);
tqlayout->add(authorAddressLabel);
tqlayout->add(authorWebLabel);
tqlayout->addSpacing(10);
tqlayout->add(plastikLabel);
tqlayout->addSpacing(10);
tqlayout->add(alsoLabel);
tqlayout->add(cuLabel);
tqlayout->add(dnLabel);
tqlayout->add(pqLabel);
tqlayout->add(cxLabel);
tqlayout->add(kpLabel);
tqlayout->add(blLabel);
tqlayout->add(ksLabel);
tqlayout->add(peLabel);
tqlayout->addSpacing(10);
tqlayout->add(bastianLabel);
tqlayout->add(pcbsdLabel);
tqlayout->add(othersLabel);
///Populate!
QSettings s;
TQSettings s;
origReverseGradients = s.readBoolEntry("/lipstikstyle/Settings/reverseGradients", false);
reverseGradients->setChecked(origReverseGradients);
@ -375,69 +375,69 @@ LipstikStyleConfig::LipstikStyleConfig(QWidget* parent): QWidget(parent)
origCustomOverHighlightColor = s.readBoolEntry("/lipstikstyle/Settings/customOverHighlightColor", false);
customOverHighlightColor->setChecked(origCustomOverHighlightColor);
origOverHighlightColor = s.readEntry("/lipstikstyle/Settings/overHighlightColor", "/Qt/KWinPalette/activeBackground");
origOverHighlightColor = s.readEntry("/lipstikstyle/Settings/overHighlightColor", "/TQt/KWinPalette/activeBackground");
overHighlightColor->setColor(origOverHighlightColor);
origCustomMenuStripeColor = s.readBoolEntry("/lipstikstyle/Settings/customMenuStripeColor", false);
customMenuStripeColor->setChecked(origCustomMenuStripeColor);
origMenuStripeColor = s.readEntry("/lipstikstyle/Settings/menuStripeColor", "/Qt/KWinPalette/activeBackground");
origMenuStripeColor = s.readEntry("/lipstikstyle/Settings/menuStripeColor", "/TQt/KWinPalette/activeBackground");
menuStripeColor->setColor(origMenuStripeColor);
origCustomFocusHighlightColor = s.readBoolEntry("/lipstikstyle/Settings/customFocusHighlightColor", false);
customFocusHighlightColor->setChecked(origCustomFocusHighlightColor);
origFocusHighlightColor = s.readEntry("/lipstikstyle/Settings/focusHighlightColor", "/Qt/KWinPalette/activeBackground");
origFocusHighlightColor = s.readEntry("/lipstikstyle/Settings/focusHighlightColor", "/TQt/KWinPalette/activeBackground");
focusHighlightColor->setColor(origFocusHighlightColor);
origCustomCheckMarkColor = s.readBoolEntry("/lipstikstyle/Settings/customCheckMarkColor", false);
customCheckMarkColor->setChecked(origCustomCheckMarkColor);
origCheckMarkColor = s.readEntry("/lipstikstyle/Settings/checkMarkColor", "/Qt/KWinPalette/activeBackground");
origCheckMarkColor = s.readEntry("/lipstikstyle/Settings/checkMarkColor", "/TQt/KWinPalette/activeBackground");
checkMarkColor->setColor(origCheckMarkColor);
origCustomTabHighlightColor = s.readBoolEntry("/lipstikstyle/Settings/customTabHighlightColor", false);
customTabHighlightColor->setChecked(origCustomTabHighlightColor);
origTabHighlightColor = s.readEntry("/lipstikstyle/Settings/tabHighlightColor", "/Qt/KWinPalette/activeBackground");
origTabHighlightColor = s.readEntry("/lipstikstyle/Settings/tabHighlightColor", "/TQt/KWinPalette/activeBackground");
tabHighlightColor->setColor(origTabHighlightColor);
connect(reverseGradients, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(paintGroove, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(sharperMenuGradient, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(alterMenuGradients, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(menuLeftSideBar, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(flatStripe, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(drawStatusBarFrame, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(drawToolBarHandle, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(comboboxColored, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(coloredMenuBar, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(drawTabHighlight, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(menuSpacing, SIGNAL( valueChanged(int) ), SLOT( updateChanged() ) );
connect(toolBarSpacing, SIGNAL( valueChanged(int) ), SLOT( updateChanged() ) );
connect(scrollBarStyle, SIGNAL( activated(int) ), SLOT( updateChanged() ) );
connect(scrollBarWidth, SIGNAL( activated(int) ), SLOT( updateChanged() ) );
connect(sliderStyle, SIGNAL( activated(int) ), SLOT( updateChanged() ) );
connect(animateProgressBar, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(drawToolBarSeparator, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(drawToolBarGradient, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(invertBarGrad, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(drawToolBarItemSeparator, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(drawFocusRect, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(flatHeaders, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(tickCheckMark, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(drawTriangularExpander, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(inputFocusHighlight, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(customOverHighlightColor, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(overHighlightColor, SIGNAL( pressed() ), SLOT( updateChanged() ) );
connect(customMenuStripeColor, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(menuStripeColor, SIGNAL( pressed() ), SLOT( updateChanged() ) );
connect(customFocusHighlightColor, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(focusHighlightColor, SIGNAL( pressed() ), SLOT( updateChanged() ) );
connect(customCheckMarkColor, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(checkMarkColor, SIGNAL( pressed() ), SLOT( updateChanged() ) );
connect(customTabHighlightColor, SIGNAL( toggled(bool) ), SLOT( updateChanged() ) );
connect(tabHighlightColor, SIGNAL( pressed() ), SLOT( updateChanged() ) );
connect(reverseGradients, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(paintGroove, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(sharperMenuGradient, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(alterMenuGradients, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(menuLeftSideBar, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(flatStripe, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(drawStatusBarFrame, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(drawToolBarHandle, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(comboboxColored, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(coloredMenuBar, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(drawTabHighlight, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(menuSpacing, TQT_SIGNAL( valueChanged(int) ), TQT_SLOT( updateChanged() ) );
connect(toolBarSpacing, TQT_SIGNAL( valueChanged(int) ), TQT_SLOT( updateChanged() ) );
connect(scrollBarStyle, TQT_SIGNAL( activated(int) ), TQT_SLOT( updateChanged() ) );
connect(scrollBarWidth, TQT_SIGNAL( activated(int) ), TQT_SLOT( updateChanged() ) );
connect(sliderStyle, TQT_SIGNAL( activated(int) ), TQT_SLOT( updateChanged() ) );
connect(animateProgressBar, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(drawToolBarSeparator, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(drawToolBarGradient, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(invertBarGrad, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(drawToolBarItemSeparator, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(drawFocusRect, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(flatHeaders, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(tickCheckMark, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(drawTriangularExpander, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(inputFocusHighlight, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(customOverHighlightColor, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(overHighlightColor, TQT_SIGNAL( pressed() ), TQT_SLOT( updateChanged() ) );
connect(customMenuStripeColor, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(menuStripeColor, TQT_SIGNAL( pressed() ), TQT_SLOT( updateChanged() ) );
connect(customFocusHighlightColor, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(focusHighlightColor, TQT_SIGNAL( pressed() ), TQT_SLOT( updateChanged() ) );
connect(customCheckMarkColor, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(checkMarkColor, TQT_SIGNAL( pressed() ), TQT_SLOT( updateChanged() ) );
connect(customTabHighlightColor, TQT_SIGNAL( toggled(bool) ), TQT_SLOT( updateChanged() ) );
connect(tabHighlightColor, TQT_SIGNAL( pressed() ), TQT_SLOT( updateChanged() ) );
//Menu Stripe
if ( menuLeftSideBar->isChecked() ) {
@ -496,7 +496,7 @@ LipstikStyleConfig::~LipstikStyleConfig()
void LipstikStyleConfig::save()
{
QSettings s;
TQSettings s;
s.writeEntry("/lipstikstyle/Settings/reverseGradients", reverseGradients->isChecked());
s.writeEntry("/lipstikstyle/Settings/paintGroove", paintGroove->isChecked());
s.writeEntry("/lipstikstyle/Settings/sharperMenuGradient", sharperMenuGradient->isChecked());
@ -524,15 +524,15 @@ void LipstikStyleConfig::save()
s.writeEntry("/lipstikstyle/Settings/drawTriangularExpander", drawTriangularExpander->isChecked());
s.writeEntry("/lipstikstyle/Settings/inputFocusHighlight", inputFocusHighlight->isChecked());
s.writeEntry("/lipstikstyle/Settings/customOverHighlightColor", customOverHighlightColor->isChecked());
s.writeEntry("/lipstikstyle/Settings/overHighlightColor", QColor(overHighlightColor->color()).name());
s.writeEntry("/lipstikstyle/Settings/overHighlightColor", TQColor(overHighlightColor->color()).name());
s.writeEntry("/lipstikstyle/Settings/customMenuStripeColor", customMenuStripeColor->isChecked());
s.writeEntry("/lipstikstyle/Settings/menuStripeColor", QColor(menuStripeColor->color()).name());
s.writeEntry("/lipstikstyle/Settings/menuStripeColor", TQColor(menuStripeColor->color()).name());
s.writeEntry("/lipstikstyle/Settings/customFocusHighlightColor", customFocusHighlightColor->isChecked());
s.writeEntry("/lipstikstyle/Settings/focusHighlightColor", QColor(focusHighlightColor->color()).name());
s.writeEntry("/lipstikstyle/Settings/focusHighlightColor", TQColor(focusHighlightColor->color()).name());
s.writeEntry("/lipstikstyle/Settings/customCheckMarkColor", customCheckMarkColor->isChecked());
s.writeEntry("/lipstikstyle/Settings/checkMarkColor", QColor(checkMarkColor->color()).name());
s.writeEntry("/lipstikstyle/Settings/checkMarkColor", TQColor(checkMarkColor->color()).name());
s.writeEntry("/lipstikstyle/Settings/customTabHighlightColor", customTabHighlightColor->isChecked());
s.writeEntry("/lipstikstyle/Settings/tabHighlightColor", QColor(tabHighlightColor->color()).name());
s.writeEntry("/lipstikstyle/Settings/tabHighlightColor", TQColor(tabHighlightColor->color()).name());
}
void LipstikStyleConfig::defaults()
@ -564,15 +564,15 @@ void LipstikStyleConfig::defaults()
drawTriangularExpander->setChecked(false);
inputFocusHighlight->setChecked(true);
customOverHighlightColor->setChecked(false);
overHighlightColor->setColor("/Qt/KWinPalette/activeBackground");
overHighlightColor->setColor("/TQt/KWinPalette/activeBackground");
customMenuStripeColor->setChecked(false);
menuStripeColor->setColor("/Qt/KWinPalette/activeBackground");
menuStripeColor->setColor("/TQt/KWinPalette/activeBackground");
customFocusHighlightColor->setChecked(false);
focusHighlightColor->setColor("/Qt/KWinPalette/activeBackground");
focusHighlightColor->setColor("/TQt/KWinPalette/activeBackground");
customCheckMarkColor->setChecked(false);
checkMarkColor->setColor("/Qt/KWinPalette/activeBackground");
checkMarkColor->setColor("/TQt/KWinPalette/activeBackground");
customTabHighlightColor->setChecked(false);
tabHighlightColor->setColor("/Qt/KWinPalette/activeBackground");
tabHighlightColor->setColor("/TQt/KWinPalette/activeBackground");
//updateChanged would be done by setChecked already
}
@ -677,23 +677,23 @@ void LipstikStyleConfig::updateChanged()
}
//Scrollbar types
QString LipstikStyleConfig::scrollBarType( int listnr )
TQString LipstikStyleConfig::scrollBarType( int listnr )
{
switch ( listnr ) {
case 0:
return QString("WindowsStyleScrollBar");
return TQString("WindowsStyleScrollBar");
case 1:
return QString("PlatinumStyleScrollBar");
return TQString("PlatinumStyleScrollBar");
case 2:
return QString("ThreeButtonScrollBar");
return TQString("ThreeButtonScrollBar");
case 3:
return QString("NextStyleScrollBar");
return TQString("NextStyleScrollBar");
default:
return QString("PlatinumStyleScrollBar");
return TQString("PlatinumStyleScrollBar");
}
}
int LipstikStyleConfig::scrollBarItem( QString kSBType )
int LipstikStyleConfig::scrollBarItem( TQString kSBType )
{
if( !strcmp(kSBType,"WindowsStyleScrollBar") )
return 0;
@ -708,21 +708,21 @@ int LipstikStyleConfig::scrollBarItem( QString kSBType )
}
//Scrollbar Widths
QString LipstikStyleConfig::scrollBarWidthType( int widthListnr )
TQString LipstikStyleConfig::scrollBarWidthType( int widthListnr )
{
switch ( widthListnr ) {
case 0:
return QString("Small");
return TQString("Small");
case 1:
return QString("Normal");
return TQString("Normal");
case 2:
return QString("Large");
return TQString("Large");
default:
return QString("Small");
return TQString("Small");
}
}
int LipstikStyleConfig::scrollBarWidthItem( QString kSBWidthType )
int LipstikStyleConfig::scrollBarWidthItem( TQString kSBWidthType )
{
if( !strcmp(kSBWidthType,"Small") )
return 0;
@ -735,7 +735,7 @@ int LipstikStyleConfig::scrollBarWidthItem( QString kSBWidthType )
}
//Slider types
int LipstikStyleConfig::sliderItem( QString kSliderType )
int LipstikStyleConfig::sliderItem( TQString kSliderType )
{
if( !strcmp(kSliderType,"sliderPlastikStyle") )
return 0;
@ -747,17 +747,17 @@ int LipstikStyleConfig::sliderItem( QString kSliderType )
return 2;
}
QString LipstikStyleConfig::sliderType( int sliderlistnr )
TQString LipstikStyleConfig::sliderType( int sliderlistnr )
{
switch ( sliderlistnr ) {
case 0:
return QString("sliderPlastikStyle");
return TQString("sliderPlastikStyle");
case 1:
return QString("sliderLipstikStyle");
return TQString("sliderLipstikStyle");
case 2:
return QString("sliderGtkStyle");
return TQString("sliderGtkStyle");
default:
return QString("sliderGtkStyle");
return TQString("sliderGtkStyle");
}
}

@ -31,13 +31,14 @@ DEALINGS IN THE SOFTWARE.
#ifndef LIPSTIK_CONF_H
#define LIPSTIK_CONF_H
class QCheckBox;
class TQCheckBox;
class LipstikStyleConfig: public QWidget
class LipstikStyleConfig: public TQWidget
{
Q_OBJECT
TQ_OBJECT
public:
LipstikStyleConfig(QWidget* parent);
LipstikStyleConfig(TQWidget* tqparent);
~LipstikStyleConfig();
//This signal and the next two slots are the plugin
@ -56,57 +57,57 @@ protected slots:
protected:
//We store settings directly in widgets to
//avoid the hassle of sync'ing things
QCheckBox* animateProgressBar;
QCheckBox* reverseGradients;
QString scrollBarType( int listnr );
int scrollBarItem( QString kSBType );
QComboBox* scrollBarStyle;
QString scrollBarWidthType( int widthListnr );
int scrollBarWidthItem( QString kSBWidth );
QComboBox* scrollBarWidth;
QString sliderType( int sliderlistnr );
int sliderItem( QString kSliderType );
QComboBox* sliderStyle;
QSpinBox* menuSpacing;
QSpinBox* toolBarSpacing;
QCheckBox* paintGroove;
QCheckBox* sharperMenuGradient;
QCheckBox* alterMenuGradients;
QCheckBox* menuLeftSideBar;
QCheckBox* drawStatusBarFrame;
QCheckBox* drawToolBarHandle;
QCheckBox* comboboxColored;
QCheckBox* coloredMenuBar;
QCheckBox* kickerHighlight;
QCheckBox* drawTabHighlight;
QCheckBox* flatStripe;
QCheckBox* compressedMenus;
QCheckBox* drawToolBarSeparator;
QCheckBox* drawToolBarGradient;
QCheckBox* invertBarGrad;
QCheckBox* drawToolBarItemSeparator;
QCheckBox* drawFocusRect;
QCheckBox* newKickerButtons;
QCheckBox* flatHeaders;
QCheckBox* tickCheckMark;
QCheckBox* drawTriangularExpander;
QCheckBox* inputFocusHighlight;
QCheckBox* customOverHighlightColor;
TQCheckBox* animateProgressBar;
TQCheckBox* reverseGradients;
TQString scrollBarType( int listnr );
int scrollBarItem( TQString kSBType );
TQComboBox* scrollBarStyle;
TQString scrollBarWidthType( int widthListnr );
int scrollBarWidthItem( TQString kSBWidth );
TQComboBox* scrollBarWidth;
TQString sliderType( int sliderlistnr );
int sliderItem( TQString kSliderType );
TQComboBox* sliderStyle;
TQSpinBox* menuSpacing;
TQSpinBox* toolBarSpacing;
TQCheckBox* paintGroove;
TQCheckBox* sharperMenuGradient;
TQCheckBox* alterMenuGradients;
TQCheckBox* menuLeftSideBar;
TQCheckBox* drawStatusBarFrame;
TQCheckBox* drawToolBarHandle;
TQCheckBox* comboboxColored;
TQCheckBox* coloredMenuBar;
TQCheckBox* kickerHighlight;
TQCheckBox* drawTabHighlight;
TQCheckBox* flatStripe;
TQCheckBox* compressedMenus;
TQCheckBox* drawToolBarSeparator;
TQCheckBox* drawToolBarGradient;
TQCheckBox* invertBarGrad;
TQCheckBox* drawToolBarItemSeparator;
TQCheckBox* drawFocusRect;
TQCheckBox* newKickerButtons;
TQCheckBox* flatHeaders;
TQCheckBox* tickCheckMark;
TQCheckBox* drawTriangularExpander;
TQCheckBox* inputFocusHighlight;
TQCheckBox* customOverHighlightColor;
KColorButton* overHighlightColor;
QCheckBox* customMenuStripeColor;
TQCheckBox* customMenuStripeColor;
KColorButton* menuStripeColor;
QCheckBox* customFocusHighlightColor;
TQCheckBox* customFocusHighlightColor;
KColorButton* focusHighlightColor;
QCheckBox* customCheckMarkColor;
TQCheckBox* customCheckMarkColor;
KColorButton* checkMarkColor;
QCheckBox* customTabHighlightColor;
TQCheckBox* customTabHighlightColor;
KColorButton* tabHighlightColor;
//Original settings, for accurate dirtiness tracking
@ -135,20 +136,20 @@ protected:
bool origDrawTriangularExpander;
bool origInputFocusHighlight;
bool origCustomOverHighlightColor;
QColor origOverHighlightColor;
TQColor origOverHighlightColor;
bool origCustomMenuStripeColor;
QColor origMenuStripeColor;
TQColor origMenuStripeColor;
bool origCustomFocusHighlightColor;
QColor origFocusHighlightColor;
TQColor origFocusHighlightColor;
bool origCustomCheckMarkColor;
QColor origCheckMarkColor;
TQColor origCheckMarkColor;
bool origCustomTabHighlightColor;
QColor origTabHighlightColor;
QString origScrollBarStyle;
QString origScrollBarWidth;
QString origSliderStyle;
TQColor origTabHighlightColor;
TQString origScrollBarStyle;
TQString origScrollBarWidth;
TQString origSliderStyle;
int origMenuSpacing;
int origToolBarSpacing;

File diff suppressed because it is too large Load Diff

@ -19,7 +19,7 @@
(c) 2002,2003 Maksim Orlovich <mo002j@mail.rochester.edu>
based on the KDE3 HighColor Style
Copyright (C) 2001-2002 Karol Szwed <gallium@kde.org>
(C) 2001-2002 Fredrik Höglund <fredrik@kde.org>
(C) 2001-2002 Fredrik H<EFBFBD>glund <fredrik@kde.org>
Drawing routines adapted from the KDE2 HCStyle,
Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org>
(C) 2000 Dirk Mueller <mueller@kde.org>
@ -46,92 +46,93 @@
#define __LIPSTIK_H
#include <kstyle.h>
#include <qbitmap.h>
#include <qintcache.h>
#include <tqbitmap.h>
#include <tqintcache.h>
#define u_arrow -4,1, 2,1, -3,0, 1,0, -2,-1, 0,-1, -1,-2
#define d_arrow -4,-2, 2,-2, -3,-1, 1,-1, -2,0, 0,0, -1,1
#define l_arrow 0,-3, 0,3,-1,-2,-1,2,-2,-1,-2,1,-3,0
#define r_arrow -2,-3,-2,3,-1,-2, -1,2,0,-1,0,1,1,0
#define QCOORDARRLEN(x) sizeof(x)/(sizeof(QCOORD)*2)
#define TQCOORDARRLEN(x) sizeof(x)/(sizeof(TQCOORD)*2)
class QSettings;
class QTab;
class QTimer;
class TQSettings;
class TQTab;
class TQTimer;
class LipstikStyle : public KStyle
{
Q_OBJECT
TQ_OBJECT
public:
LipstikStyle();
virtual ~LipstikStyle();
void polish(QApplication* app );
void polish(QWidget* widget );
void unPolish(QWidget* widget );
void polish(TQApplication* app );
void polish(TQWidget* widget );
void unPolish(TQWidget* widget );
void drawKStylePrimitive(KStylePrimitive kpe,
QPainter* p,
const QWidget* widget,
const QRect &r,
const QColorGroup &cg,
TQPainter* p,
const TQWidget* widget,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
const QStyleOption& = QStyleOption::Default ) const;
const TQStyleOption& = TQStyleOption::Default ) const;
void drawPrimitive(PrimitiveElement pe,
QPainter *p,
const QRect &r,
const QColorGroup &cg,
void tqdrawPrimitive(PrimitiveElement pe,
TQPainter *p,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
const QStyleOption &opt = QStyleOption::Default ) const;
const TQStyleOption &opt = TQStyleOption::Default ) const;
void drawControl(ControlElement element,
QPainter *p,
const QWidget *widget,
const QRect &r,
const QColorGroup &cg,
void tqdrawControl(ControlElement element,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
const QStyleOption& = QStyleOption::Default ) const;
const TQStyleOption& = TQStyleOption::Default ) const;
void drawControlMask( ControlElement, QPainter *, const QWidget *, const QRect &, const QStyleOption &) const;
void tqdrawControlMask( ControlElement, TQPainter *, const TQWidget *, const TQRect &, const TQStyleOption &) const;
void drawComplexControl(ComplexControl control,
QPainter *p,
const QWidget *widget,
const QRect &r,
const QColorGroup &cg,
void tqdrawComplexControl(ComplexControl control,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
const TQColorGroup &cg,
SFlags flags = Style_Default,
SCFlags controls = SC_All,
SCFlags active = SC_None,
const QStyleOption& = QStyleOption::Default ) const;
const TQStyleOption& = TQStyleOption::Default ) const;
int pixelMetric(PixelMetric m,
const QWidget *widget = 0 ) const;
int tqpixelMetric(PixelMetric m,
const TQWidget *widget = 0 ) const;
QRect subRect(SubRect r,
const QWidget *widget ) const;
TQRect subRect(SubRect r,
const TQWidget *widget ) const;
QRect querySubControlMetrics(ComplexControl control,
const QWidget *widget,
TQRect querySubControlMetrics(ComplexControl control,
const TQWidget *widget,
SubControl subcontrol,
const QStyleOption &opt = QStyleOption::Default ) const;
const TQStyleOption &opt = TQStyleOption::Default ) const;
void drawComplexControlMask(QStyle::ComplexControl c,
QPainter *p,
const QWidget *w,
const QRect &r,
const QStyleOption &o=QStyleOption::Default) const;
void tqdrawComplexControlMask(TQStyle::ComplexControl c,
TQPainter *p,
const TQWidget *w,
const TQRect &r,
const TQStyleOption &o=TQStyleOption::Default) const;
QSize sizeFromContents(QStyle::ContentsType t,
const QWidget *w,
const QSize &s,
const QStyleOption &o) const;
TQSize tqsizeFromContents(TQStyle::ContentsType t,
const TQWidget *w,
const TQSize &s,
const TQStyleOption &o) const;
int styleHint(StyleHint, const QWidget * = 0,
const QStyleOption & = QStyleOption::Default,
QStyleHintReturn * = 0 ) const;
int tqstyleHint(StyleHint, const TQWidget * = 0,
const TQStyleOption & = TQStyleOption::Default,
TQStyleHintReturn * = 0 ) const;
protected:
enum TabPosition
@ -191,66 +192,66 @@ protected:
Draw_AlphaBlend = 0x00020000
};
void renderContour(QPainter *p,
const QRect &r,
const QColor &backgroundColor,
const QColor &contourColor,
void renderContour(TQPainter *p,
const TQRect &r,
const TQColor &backgroundColor,
const TQColor &contourColor,
const uint flags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom|
Round_UpperLeft|Round_UpperRight|Round_BottomLeft|Round_BottomRight) const;
void renderMask(QPainter *p,
const QRect &r,
const QColor &color,
void renderMask(TQPainter *p,
const TQRect &r,
const TQColor &color,
const uint flags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom|
Round_UpperLeft|Round_UpperRight|Round_BottomLeft|Round_BottomRight) const;
void renderSurface(QPainter *p,
const QRect &r,
const QColor &backgroundColor,
const QColor &buttonColor,
const QColor &highlightColor,
void renderSurface(TQPainter *p,
const TQRect &r,
const TQColor &backgroundColor,
const TQColor &buttonColor,
const TQColor &highlightColor,
int intensity = 5,
const uint flags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom|
Round_UpperLeft|Round_UpperRight|Round_BottomLeft|Round_BottomRight|
Is_Horizontal) const;
inline void renderPixel(QPainter *p,
const QPoint &pos,
inline void renderPixel(TQPainter *p,
const TQPoint &pos,
const int alpha,
const QColor &color,
const QColor &background = QColor(),
const TQColor &color,
const TQColor &background = TQColor(),
bool fullAlphaBlend = true) const;
void renderButton(QPainter *p,
const QRect &r,
const QColorGroup &g,
void renderButton(TQPainter *p,
const TQRect &r,
const TQColorGroup &g,
bool sunken = false,
bool mouseOver = false,
bool horizontal = true,
bool enabled = true,
bool khtmlMode = false) const;
void renderPanel(QPainter *p,
const QRect &r,
const QColorGroup &g,
void renderPanel(TQPainter *p,
const TQRect &r,
const TQColorGroup &g,
const bool pseudo3d = true,
const bool sunken = true) const;
void renderDot(QPainter *p,
const QPoint &point,
const QColor &baseColor,
void renderDot(TQPainter *p,
const TQPoint &point,
const TQColor &baseColor,
const bool thick = false,
const bool sunken = false) const;
void renderGradient(QPainter *p,
const QRect &r,
const QColor &c1,
const QColor &c2,
void renderGradient(TQPainter *p,
const TQRect &r,
const TQColor &c1,
const TQColor &c2,
bool horizontal = true) const;
void renderTab(QPainter *p,
const QRect &r,
const QColorGroup &g,
void renderTab(TQPainter *p,
const TQRect &r,
const TQColorGroup &g,
bool mouseOver = false,
const bool selected = false,
const bool bottom = false,
@ -258,21 +259,21 @@ protected:
const bool triangular = false,
const bool cornerWidget = false) const;
virtual void renderMenuBlendPixmap( KPixmap& pix, const QColorGroup& cg,
const QPopupMenu* popup ) const;
virtual void renderMenuBlendPixmap( KPixmap& pix, const TQColorGroup& cg,
const TQPopupMenu* popup ) const;
bool eventFilter(QObject *, QEvent *);
bool eventFilter(TQObject *, TQEvent *);
QWidget* hoverWidget;
TQWidget* hoverWidget;
protected slots:
void khtmlWidgetDestroyed(QObject* w);
void khtmlWidgetDestroyed(TQObject* w);
//Animation slots.
void updateProgressPos();
void progressBarDestroyed(QObject* bar);
void progressBarDestroyed(TQObject* bar);
inline QColor getColor(const QColorGroup &cg, const ColorType t, const bool enabled = true)const;
inline QColor getColor(const QColorGroup &cg, const ColorType t, const WidgetState s)const;
inline TQColor getColor(const TQColorGroup &cg, const ColorType t, const bool enabled = true)const;
inline TQColor getColor(const TQColorGroup &cg, const ColorType t, const WidgetState s)const;
private:
// Disable copy constructor and = operator
LipstikStyle( const LipstikStyle & );
@ -313,25 +314,25 @@ private:
bool _tickCheckMark;
bool _flatStripe;
QString _scrollBarStyle;
QString _scrollBarWidth;
QString _sliderStyle;
TQString _scrollBarStyle;
TQString _scrollBarWidth;
TQString _sliderStyle;
QColor _overHighlightColor;
QColor _focusHighlightColor;
QColor _checkMarkColor;
QColor _tabHighlightColor;
QColor _menuStripeColor;
QColor _defaultMenuStripeColor;
// QColor _arrowColor;
TQColor _overHighlightColor;
TQColor _focusHighlightColor;
TQColor _checkMarkColor;
TQColor _tabHighlightColor;
TQColor _menuStripeColor;
TQColor _defaultMenuStripeColor;
// TQColor _arrowColor;
QTab *hoverTab;
TQTab *hoverTab;
// track khtml widgets.
QMap<const QWidget*,bool> khtmlWidgets;
TQMap<const TQWidget*,bool> khtmlWidgets;
//Animation support.
QMap<QWidget*, int> progAnimWidgets;
TQMap<TQWidget*, int> progAnimWidgets;
// pixmap cache.
enum CacheEntryType {
@ -344,14 +345,14 @@ private:
CacheEntryType type;
int width;
int height;
QRgb c1Rgb;
QRgb c2Rgb;
TQRgb c1Rgb;
TQRgb c2Rgb;
bool horizontal;
QPixmap* pixmap;
TQPixmap* pixmap;
CacheEntry(CacheEntryType t, int w, int h, QRgb c1, QRgb c2 = 0,
bool hor = false, QPixmap* p = 0 ):
CacheEntry(CacheEntryType t, int w, int h, TQRgb c1, TQRgb c2 = 0,
bool hor = false, TQPixmap* p = 0 ):
type(t), width(w), height(h), c1Rgb(c1), c2Rgb(c2), horizontal(hor), pixmap(p)
{}
@ -362,7 +363,7 @@ private:
int key()
{
// create an int key from the properties which is used to refer to entries in the QIntCache.
// create an int key from the properties which is used to refer to entries in the TQIntCache.
// the result may not be 100% correct as we don't have so much space in one integer -- use
// == operator after find to make sure we got the right one. :)
return horizontal ^ (type<<1) ^ (width<<5) ^ (height<<10) ^ (c1Rgb<<19) ^ (c2Rgb<<22);
@ -387,18 +388,18 @@ private:
return match;
}
};
QIntCache<CacheEntry> *pixmapCache;
TQIntCache<CacheEntry> *pixmapCache;
// For renderFocusRect
mutable QBitmap *verticalDots;
mutable QBitmap *horizontalDots;
mutable TQBitmap *verticalDots;
mutable TQBitmap *horizontalDots;
// For KPE_ListViewBranch
mutable QBitmap *verticalLine;
mutable QBitmap *horizontalLine;
mutable TQBitmap *verticalLine;
mutable TQBitmap *horizontalLine;
// For progress bar animation
QTimer *animationTimer;
TQTimer *animationTimer;
};
#endif // __LIPSTIK_H

@ -16,23 +16,23 @@
* Boston, MA 02110-1301, USA.
*/
#include <qcolor.h>
#include <tqcolor.h>
#include "misc.h"
QColor alphaBlendColors(const QColor &bgColor, const QColor &fgColor, const int a)
TQColor alphaBlendColors(const TQColor &bgColor, const TQColor &fgColor, const int a)
{
// normal button...
QRgb rgb = bgColor.rgb();
QRgb rgb_b = fgColor.rgb();
TQRgb rgb = bgColor.rgb();
TQRgb rgb_b = fgColor.rgb();
int alpha = a;
if(alpha>255) alpha = 255;
if(alpha<0) alpha = 0;
int inv_alpha = 255 - alpha;
QColor result = QColor( qRgb(qRed(rgb_b)*inv_alpha/255 + qRed(rgb)*alpha/255,
qGreen(rgb_b)*inv_alpha/255 + qGreen(rgb)*alpha/255,
qBlue(rgb_b)*inv_alpha/255 + qBlue(rgb)*alpha/255) );
TQColor result = TQColor( tqRgb(tqRed(rgb_b)*inv_alpha/255 + tqRed(rgb)*alpha/255,
tqGreen(rgb_b)*inv_alpha/255 +