Port to TDE

Signed-off-by: Mavridis Philippe <mavridisf@gmail.com>
pull/3/head
Mavridis Philippe 7 months ago
parent db5c38267d
commit 8dbc6179f8
No known key found for this signature in database
GPG Key ID: 93F66F98F906147D

@ -3,7 +3,7 @@
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
# Project related configuration options # Project related configuration options
#--------------------------------------------------------------------------- #---------------------------------------------------------------------------
PROJECT_NAME = polyester.kdevelop PROJECT_NAME = polyester.tdevelop
PROJECT_NUMBER = 0.1 PROJECT_NUMBER = 0.1
OUTPUT_DIRECTORY = OUTPUT_DIRECTORY =
CREATE_SUBDIRS = NO CREATE_SUBDIRS = NO

@ -1 +1 @@
Polyester is a kde widget style and a kwin decoration both aimed to be a good balance between eye candy and simplicity. Polyester is a TDE widget style and a twin decoration both aimed to be a good balance between eye candy and simplicity.

@ -1,5 +1,5 @@
#include <kdialog.h> #include <kdialog.h>
#include <klocale.h> #include <tdelocale.h>
/**************************************************************************** /****************************************************************************
** Form implementation generated from reading ui file './configdialog.ui' ** Form implementation generated from reading ui file './configdialog.ui'
** **

@ -10,9 +10,9 @@
// Please see the header file for copyright and license information. // Please see the header file for copyright and license information.
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
#include <kconfig.h> #include <tdeconfig.h>
#include <klocale.h> #include <tdelocale.h>
#include <kglobal.h> #include <tdeglobal.h>
#include <tqbuttongroup.h> #include <tqbuttongroup.h>
#include <tqgroupbox.h> #include <tqgroupbox.h>
#include <tqradiobutton.h> #include <tqradiobutton.h>
@ -29,11 +29,11 @@
// ------------- // -------------
// Constructor // Constructor
polyesterConfig::polyesterConfig(KConfig* config, TQWidget* parent) polyesterConfig::polyesterConfig(TDEConfig* config, TQWidget* parent)
: TQObject(parent), config_(0), dialog_(0) { : TQObject(parent), config_(0), dialog_(0) {
// create the configuration object // create the configuration object
config_ = new KConfig("kwinpolyesterrc"); config_ = new TDEConfig("twinpolyesterrc");
KGlobal::locale()->insertCatalogue("kwin_polyester_config"); TDEGlobal::locale()->insertCatalogue("twin_polyester_config");
// create and show the configuration dialog // create and show the configuration dialog
dialog_ = new ConfigDialog(parent); dialog_ = new ConfigDialog(parent);
@ -104,7 +104,7 @@ void polyesterConfig::selectionChanged(int) {
// ------ // ------
// Load configuration data // Load configuration data
void polyesterConfig::load(KConfig*) { void polyesterConfig::load(TDEConfig*) {
config_->setGroup("General"); config_->setGroup("General");
TQString value = config_->readEntry("TitleAlignment", "AlignHCenter"); TQString value = config_->readEntry("TitleAlignment", "AlignHCenter");
@ -141,7 +141,7 @@ void polyesterConfig::load(KConfig*) {
// ------ // ------
// Save configuration data // Save configuration data
void polyesterConfig::save(KConfig*) { void polyesterConfig::save(TDEConfig*) {
config_->setGroup("General"); config_->setGroup("General");
TQRadioButton *button = (TQRadioButton*)dialog_->titlealign->selected(); TQRadioButton *button = (TQRadioButton*)dialog_->titlealign->selected();
@ -197,7 +197,7 @@ void polyesterConfig::defaults() {
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
extern "C" { extern "C" {
TQObject* allocate_config(KConfig* config, TQWidget* parent) { TQObject* allocate_config(TDEConfig* config, TQWidget* parent) {
return (new polyesterConfig(config, parent)); return (new polyesterConfig(config, parent));
} }
} }

@ -32,28 +32,28 @@
#include <tqobject.h> #include <tqobject.h>
class KConfig; class TDEConfig;
class ConfigDialog; class ConfigDialog;
class polyesterConfig : public TQObject { class polyesterConfig : public TQObject {
TQ_OBJECT TQ_OBJECT
public: public:
polyesterConfig(KConfig* config, TQWidget* parent); polyesterConfig(TDEConfig* config, TQWidget* parent);
~polyesterConfig(); ~polyesterConfig();
signals: signals:
void changed(); void changed();
public slots: public slots:
void load(KConfig*); void load(TDEConfig*);
void save(KConfig*); void save(TDEConfig*);
void defaults(); void defaults();
protected slots: protected slots:
void selectionChanged(int); void selectionChanged(int);
private: private:
KConfig *config_; TDEConfig *config_;
ConfigDialog *dialog_; ConfigDialog *dialog_;
}; };

@ -14,11 +14,11 @@
////////////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////////////
#include <kconfig.h> #include <tdeconfig.h>
#include <kdeversion.h> #include <tdeversion.h>
#include <kglobal.h> #include <tdeglobal.h>
#include <kglobalsettings.h> #include <tdeglobalsettings.h>
#include <klocale.h> #include <tdelocale.h>
#include <kpixmap.h> #include <kpixmap.h>
#include <kimageeffect.h> #include <kimageeffect.h>
#include <kpixmapeffect.h> #include <kpixmapeffect.h>
@ -136,7 +136,7 @@ bool polyesterFactory::reset(unsigned long changed) {
bool polyesterFactory::readConfig() { bool polyesterFactory::readConfig() {
// create a config object // create a config object
KConfig config("kwinpolyesterrc"); TDEConfig config("twinpolyesterrc");
config.setGroup("General"); config.setGroup("General");
// grab settings // grab settings
@ -1408,7 +1408,7 @@ void polyesterClient::mouseDoubleClickEvent(TQMouseEvent *e) {
// Mousewheel over titlebar // Mousewheel over titlebar
void polyesterClient::wheelEvent(TQWheelEvent * e) { void polyesterClient::wheelEvent(TQWheelEvent * e) {
#if KDE_VERSION > KDE_MAKE_VERSION(3,4,3) #if TDE_VERSION > TDE_MAKE_VERSION(3,4,3)
if (titleLayout_->geometry().contains(e->pos())) if (titleLayout_->geometry().contains(e->pos()))
titlebarMouseWheelOperation(e->delta()); titlebarMouseWheelOperation(e->delta());
#endif #endif

@ -2,4 +2,4 @@
[Desktop Entry] [Desktop Entry]
Encoding=UTF-8 Encoding=UTF-8
Name=Polyester Name=Polyester
X-KDE-Library=kwin3_polyester X-TDE-Library=twin3_polyester

@ -1,6 +1,6 @@
/* Copyright (C) 2003 by Sandro Giessl /* Copyright (C) 2003 by Sandro Giessl
* based on the nice CVS KDesktop KShadowEngine class. thanks! * based on the nice CVS KDesktop KShadowEngine class. thanks!
* looking forward to see KShadowEngine in kdefx somewhen btw.. :) * looking forward to see KShadowEngine in tdefx somewhen btw.. :)
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
* these are the original copyright notes: * these are the original copyright notes:
* This file is proposed to be part of the KDE libraries. * This file is proposed to be part of the KDE libraries.

@ -1,6 +1,6 @@
/* Copyright (C) 2003 by Sandro Giessl /* Copyright (C) 2003 by Sandro Giessl
* based on the nice CVS KDesktop KShadowEngine class. thanks! * based on the nice CVS KDesktop KShadowEngine class. thanks!
* looking forward to see KShadowEngine in kdefx somewhen btw.. :) * looking forward to see KShadowEngine in tdefx somewhen btw.. :)
* ------------------------------------------------------------------------ * ------------------------------------------------------------------------
* these are the original copyright notes: * these are the original copyright notes:
* This file is proposed to be part of the KDE libraries. * This file is proposed to be part of the KDE libraries.

@ -38,7 +38,7 @@
<executable path="" params="" /> <executable path="" params="" />
<valgrind path="" params="" /> <valgrind path="" params="" />
<calltree path="" params="" /> <calltree path="" params="" />
<kcachegrind path="" /> <tdecachegrind path="" />
</kdevvalgrind> </kdevvalgrind>
</pluginList> </pluginList>
</KDevPrjSession> </KDevPrjSession>

@ -1,5 +1,5 @@
<?xml version = '1.0'?> <?xml version = '1.0'?>
<kdevelop> <tdevelop>
<general> <general>
<author>Marco Martin</author> <author>Marco Martin</author>
<email>notmart@gmail.com</email> <email>notmart@gmail.com</email>
@ -178,7 +178,7 @@
<custom>false</custom> <custom>false</custom>
<bzip>false</bzip> <bzip>false</bzip>
<archname/> <archname/>
<appname>polyester.kdevelop</appname> <appname>polyester.tdevelop</appname>
<version>0.7</version> <version>0.7</version>
<release>1</release> <release>1</release>
<vendor>suse</vendor> <vendor>suse</vendor>
@ -186,7 +186,7 @@
<summary>A glossy kde theme</summary> <summary>A glossy kde theme</summary>
<group>System/GUI/KDE</group> <group>System/GUI/KDE</group>
<packager>Marco Martin</packager> <packager>Marco Martin</packager>
<description>Widget style + kwin decoration both aimed to be a good balance between eye candy and simplicity</description> <description>Widget style + twin decoration both aimed to be a good balance between eye candy and simplicity</description>
<changelog>Polyester 0.7:misc:-(hopefully) fixed gentoo ebuild (i don't have gentoo installed atm, so let me know)widget:-some little code cleanups-menubar text shadow configurable-as requested the look has been made a little bit similar to http://kdelook.org/content/show.php?content=33522 (but not identical)-active menu item more button-like-new option (default off) &quot;menubar emphasis&quot; that makes the menubar more glass-likedeco:-litte modification of the titlebar border-titlebar buttons with more contrast-when a dark color is chosen for the titlebar buttons, their icons become white</changelog> <changelog>Polyester 0.7:misc:-(hopefully) fixed gentoo ebuild (i don't have gentoo installed atm, so let me know)widget:-some little code cleanups-menubar text shadow configurable-as requested the look has been made a little bit similar to http://kdelook.org/content/show.php?content=33522 (but not identical)-active menu item more button-like-new option (default off) &quot;menubar emphasis&quot; that makes the menubar more glass-likedeco:-litte modification of the titlebar border-titlebar buttons with more contrast-when a dark color is chosen for the titlebar buttons, their icons become white</changelog>
<devpackage>false</devpackage> <devpackage>false</devpackage>
<docspackage>false</docspackage> <docspackage>false</docspackage>
@ -198,4 +198,4 @@
<appskde>false</appskde> <appskde>false</appskde>
<url/> <url/>
</dist> </dist>
</kdevelop> </tdevelop>

@ -36,8 +36,8 @@ DEALINGS IN THE SOFTWARE.
#include <tqsettings.h> #include <tqsettings.h>
#include <tqcolor.h> #include <tqcolor.h>
#include <tqgroupbox.h> #include <tqgroupbox.h>
#include <kglobal.h> #include <tdeglobal.h>
#include <klocale.h> #include <tdelocale.h>
#include <kcolorbutton.h> #include <kcolorbutton.h>
#include <kdemacros.h> #include <kdemacros.h>
@ -48,7 +48,7 @@ extern "C"
{ {
KDE_EXPORT TQWidget* allocate_kstyle_config(TQWidget* parent) KDE_EXPORT TQWidget* allocate_kstyle_config(TQWidget* parent)
{ {
KGlobal::locale()->insertCatalogue("polyester"); TDEGlobal::locale()->insertCatalogue("polyester");
return new PolyesterStyleConfig(parent); return new PolyesterStyleConfig(parent);
} }
} }
@ -59,7 +59,7 @@ PolyesterStyleConfig::PolyesterStyleConfig(TQWidget* parent): TQWidget(parent)
//Should have no margins here, the dialog provides them //Should have no margins here, the dialog provides them
TQVBoxLayout* layout = new TQVBoxLayout(this, 0, 0); TQVBoxLayout* layout = new TQVBoxLayout(this, 0, 0);
dialog_ = new ConfigDialog(this); dialog_ = new ConfigDialog(this);
KGlobal::locale()->insertCatalogue("kstyle_polyester_config"); TDEGlobal::locale()->insertCatalogue("kstyle_polyester_config");
layout->addWidget(dialog_); layout->addWidget(dialog_);

@ -23,7 +23,7 @@
Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org> Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org>
(C) 2000 Dirk Mueller <mueller@kde.org> (C) 2000 Dirk Mueller <mueller@kde.org>
(C) 2001 Martijn Klingens <klingens@kde.org> (C) 2001 Martijn Klingens <klingens@kde.org>
Progressbar code based on KStyle, Progressbar code based on TDEStyle,
Copyright (C) 2001-2002 Karol Szwed <gallium@kde.org> Copyright (C) 2001-2002 Karol Szwed <gallium@kde.org>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
@ -73,7 +73,7 @@
#include <tqsettings.h> #include <tqsettings.h>
#include <kpixmap.h> #include <kpixmap.h>
#include <kimageeffect.h> #include <kimageeffect.h>
#include <kglobal.h> #include <tdeglobal.h>
#include "polyester.h" #include "polyester.h"
#include "polyester.moc" #include "polyester.moc"
@ -160,7 +160,7 @@ class PolyesterStylePlugin : public TQStylePlugin
KDE_Q_EXPORT_PLUGIN( PolyesterStylePlugin ) KDE_Q_EXPORT_PLUGIN( PolyesterStylePlugin )
// -- end -- // -- end --
PolyesterStyle::PolyesterStyle() : KStyle( AllowMenuTransparency, ThreeButtonScrollBar), PolyesterStyle::PolyesterStyle() : TDEStyle( AllowMenuTransparency, ThreeButtonScrollBar),
kickerMode(false), kickerMode(false),
kornMode(false), kornMode(false),
flatMode(false) flatMode(false)
@ -236,19 +236,19 @@ PolyesterStyle::PolyesterStyle() : KStyle( AllowMenuTransparency, ThreeButtonScr
this hack may be disabled in the future, let's see...*/ this hack may be disabled in the future, let's see...*/
if( !qstrcmp( tqApp->argv() [ 0 ], "unknown" ) ) if( !qstrcmp( tqApp->argv() [ 0 ], "unknown" ) )
{ {
_scrollBarType = KStyle::WindowsStyleScrollBar; _scrollBarType = TDEStyle::WindowsStyleScrollBar;
_menuStripe = false; _menuStripe = false;
} }
//Thanks, Lipstik :-) //Thanks, Lipstik :-)
else if( !strcmp(_scrollBarStyle,"ThreeButtonScrollBar" ) ) else if( !strcmp(_scrollBarStyle,"ThreeButtonScrollBar" ) )
_scrollBarType = KStyle::ThreeButtonScrollBar; _scrollBarType = TDEStyle::ThreeButtonScrollBar;
else if( !strcmp(_scrollBarStyle,"WindowsStyleScrollBar" ) ) else if( !strcmp(_scrollBarStyle,"WindowsStyleScrollBar" ) )
_scrollBarType = KStyle::WindowsStyleScrollBar; _scrollBarType = TDEStyle::WindowsStyleScrollBar;
else if( !strcmp(_scrollBarStyle,"PlatinumStyleScrollBar" ) ) else if( !strcmp(_scrollBarStyle,"PlatinumStyleScrollBar" ) )
_scrollBarType = KStyle::PlatinumStyleScrollBar; _scrollBarType = TDEStyle::PlatinumStyleScrollBar;
else if( !strcmp(_scrollBarStyle,"NextStyleScrollBar" ) ) else if( !strcmp(_scrollBarStyle,"NextStyleScrollBar" ) )
_scrollBarType = KStyle::NextStyleScrollBar; _scrollBarType = TDEStyle::NextStyleScrollBar;
//HACK for gtk-qt: if setScrollBarType is called wxwidgets applications will broke //HACK for gtk-qt: if setScrollBarType is called wxwidgets applications will broke
/*if( qstrcmp( tqApp->argv() [ 0 ], "unknown" ) ) /*if( qstrcmp( tqApp->argv() [ 0 ], "unknown" ) )
@ -363,9 +363,9 @@ void PolyesterStyle::polish(TQApplication* app)
void PolyesterStyle::polish(TQWidget* widget) void PolyesterStyle::polish(TQWidget* widget)
{ {
if( !strcmp(widget->name(), "__khtml") ) { // is it a khtml widget...? if( !strcmp(widget->name(), "__tdehtml") ) { // is it a tdehtml widget...?
khtmlWidgets[widget] = true; tdehtmlWidgets[widget] = true;
connect(widget, SIGNAL(destroyed(TQObject*)), this, SLOT(khtmlWidgetDestroyed(TQObject*))); connect(widget, SIGNAL(destroyed(TQObject*)), this, SLOT(tdehtmlWidgetDestroyed(TQObject*)));
} }
// use tqt_cast where possible to check if the widget inheits one of the classes. might improve // use tqt_cast where possible to check if the widget inheits one of the classes. might improve
@ -401,7 +401,7 @@ void PolyesterStyle::polish(TQWidget* widget)
widget->installEventFilter(this); widget->installEventFilter(this);
} else if (::tqt_cast<TQPopupMenu*>(widget)) { } else if (::tqt_cast<TQPopupMenu*>(widget)) {
widget->setBackgroundMode( NoBackground ); widget->setBackgroundMode( NoBackground );
} else if ( !qstrcmp(widget->name(), "kde toolbar widget") ) { } else if ( !qstrcmp(widget->name(), "tde toolbar widget") ) {
widget->installEventFilter(this); widget->installEventFilter(this);
} else if (::tqt_cast<TQHeader*>(widget)) { } else if (::tqt_cast<TQHeader*>(widget)) {
connect(widget->parent(), SIGNAL(contentsMoving(int, int)), widget, SLOT(update())); connect(widget->parent(), SIGNAL(contentsMoving(int, int)), widget, SLOT(update()));
@ -421,13 +421,13 @@ void PolyesterStyle::polish(TQWidget* widget)
KStyle::polish(widget); TDEStyle::polish(widget);
} }
void PolyesterStyle::unPolish(TQWidget* widget) void PolyesterStyle::unPolish(TQWidget* widget)
{ {
if( !strcmp(widget->name(), "__khtml") ) { // is it a khtml widget...? if( !strcmp(widget->name(), "__tdehtml") ) { // is it a tdehtml widget...?
khtmlWidgets.remove(widget); tdehtmlWidgets.remove(widget);
} }
// use tqt_cast to check if the widget inheits one of the classes. // use tqt_cast to check if the widget inheits one of the classes.
@ -446,7 +446,7 @@ void PolyesterStyle::unPolish(TQWidget* widget)
widget->removeEventFilter(this); widget->removeEventFilter(this);
} else if (::tqt_cast<TQPopupMenu*>(widget)) { } else if (::tqt_cast<TQPopupMenu*>(widget)) {
widget->setBackgroundMode( PaletteBackground ); widget->setBackgroundMode( PaletteBackground );
} else if ( !qstrcmp(widget->name(), "kde toolbar widget") ) { } else if ( !qstrcmp(widget->name(), "tde toolbar widget") ) {
widget->removeEventFilter(this); widget->removeEventFilter(this);
} }
@ -459,13 +459,13 @@ void PolyesterStyle::unPolish(TQWidget* widget)
progAnimWidgets.remove(widget); progAnimWidgets.remove(widget);
} }
KStyle::unPolish(widget); TDEStyle::unPolish(widget);
} }
/*a bunch of slots stuff...*/ /*a bunch of slots stuff...*/
void PolyesterStyle::khtmlWidgetDestroyed(TQObject* obj) void PolyesterStyle::tdehtmlWidgetDestroyed(TQObject* obj)
{ {
khtmlWidgets.remove(static_cast<TQWidget*>(obj)); tdehtmlWidgets.remove(static_cast<TQWidget*>(obj));
} }
void PolyesterStyle::progressBarDestroyed(TQObject* obj) void PolyesterStyle::progressBarDestroyed(TQObject* obj)
@ -962,7 +962,7 @@ void PolyesterStyle::renderButton(TQPainter *p,
bool mouseOver, bool mouseOver,
bool horizontal, bool horizontal,
bool enabled, bool enabled,
bool khtmlMode, bool tdehtmlMode,
int animFrame, int animFrame,
bool isDefault //TODO: move here all the default-button related code? bool isDefault //TODO: move here all the default-button related code?
) const ) const
@ -975,7 +975,7 @@ void PolyesterStyle::renderButton(TQPainter *p,
uint contourFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom; uint contourFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom;
if(!enabled) contourFlags|=Is_Disabled; if(!enabled) contourFlags|=Is_Disabled;
if(khtmlMode) contourFlags|=Draw_AlphaBlend; if(tdehtmlMode) contourFlags|=Draw_AlphaBlend;
uint surfaceFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom; uint surfaceFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom;
if(horizontal) surfaceFlags|=Is_Horizontal; if(horizontal) surfaceFlags|=Is_Horizontal;
@ -1547,7 +1547,7 @@ void PolyesterStyle::sliderThumbMoved(int val)
} }
} }
void PolyesterStyle::drawKStylePrimitive(KStylePrimitive kpe, void PolyesterStyle::drawTDEStylePrimitive(TDEStylePrimitive kpe,
TQPainter *p, TQPainter *p,
const TQWidget* widget, const TQWidget* widget,
const TQRect &r, const TQRect &r,
@ -1844,7 +1844,7 @@ void PolyesterStyle::drawKStylePrimitive(KStylePrimitive kpe,
break; break;
} }
// copied and slightly modified from KStyle. // copied and slightly modified from TDEStyle.
case KPE_ListViewBranch: { case KPE_ListViewBranch: {
// Typical Windows style listview branch element (dotted line). // Typical Windows style listview branch element (dotted line).
@ -1917,7 +1917,7 @@ void PolyesterStyle::drawKStylePrimitive(KStylePrimitive kpe,
} }
default: default:
KStyle::drawKStylePrimitive(kpe, p, widget, r, cg, flags, opt); TDEStyle::drawTDEStylePrimitive(kpe, p, widget, r, cg, flags, opt);
} }
} }
@ -2093,12 +2093,12 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
case PE_ButtonTool: case PE_ButtonTool:
case PE_ButtonDropDown: case PE_ButtonDropDown:
case PE_ButtonCommand: { case PE_ButtonCommand: {
bool khtmlMode = khtmlWidgets.contains(opt.widget()); bool tdehtmlMode = tdehtmlWidgets.contains(opt.widget());
int animFrame = 0; int animFrame = 0;
if( _animateButton && animWidgets.contains(opt.widget()) ) if( _animateButton && animWidgets.contains(opt.widget()) )
animFrame = (int)animWidgets[opt.widget()].animFrame; animFrame = (int)animWidgets[opt.widget()].animFrame;
renderButton(p, r, cg, (on||down), mouseOver, true, enabled, renderButton(p, r, cg, (on||down), mouseOver, true, enabled,
khtmlMode, animFrame, flags & Style_ButtonDefault ); tdehtmlMode, animFrame, flags & Style_ButtonDefault );
break; break;
} }
@ -2222,14 +2222,14 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
//coordinates for the surface //coordinates for the surface
uint xs=x,ws=w; uint xs=x,ws=w;
if( pe == PE_ScrollBarSubPage && ( _scrollBarType == KStyle::PlatinumStyleScrollBar ) ) if( pe == PE_ScrollBarSubPage && ( _scrollBarType == TDEStyle::PlatinumStyleScrollBar ) )
{ {
contourFlags |= Draw_Left|Round_UpperLeft|Round_BottomLeft; contourFlags |= Draw_Left|Round_UpperLeft|Round_BottomLeft;
surfaceFlags |= Round_UpperLeft|Round_BottomLeft; surfaceFlags |= Round_UpperLeft|Round_BottomLeft;
xs++; xs++;
ws--; ws--;
} }
else if( pe == PE_ScrollBarAddPage && ( _scrollBarType == KStyle::NextStyleScrollBar ) ) else if( pe == PE_ScrollBarAddPage && ( _scrollBarType == TDEStyle::NextStyleScrollBar ) )
{ {
contourFlags |= Draw_Right|Round_UpperRight|Round_BottomRight; contourFlags |= Draw_Right|Round_UpperRight|Round_BottomRight;
surfaceFlags |= Round_UpperRight|Round_BottomRight; surfaceFlags |= Round_UpperRight|Round_BottomRight;
@ -2255,14 +2255,14 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
//coordinates for the surface //coordinates for the surface
uint ys=y,hs=h; uint ys=y,hs=h;
if( pe == PE_ScrollBarSubPage && ( _scrollBarType == KStyle::PlatinumStyleScrollBar ) ) if( pe == PE_ScrollBarSubPage && ( _scrollBarType == TDEStyle::PlatinumStyleScrollBar ) )
{ {
contourFlags |= Draw_Top|Round_UpperLeft|Round_UpperRight; contourFlags |= Draw_Top|Round_UpperLeft|Round_UpperRight;
surfaceFlags |= Round_UpperLeft|Round_UpperRight; surfaceFlags |= Round_UpperLeft|Round_UpperRight;
ys++; ys++;
hs--; hs--;
} }
else if( pe == PE_ScrollBarAddPage && ( _scrollBarType == KStyle::NextStyleScrollBar ) ) else if( pe == PE_ScrollBarAddPage && ( _scrollBarType == TDEStyle::NextStyleScrollBar ) )
{ {
contourFlags |= Draw_Bottom|Round_BottomLeft|Round_BottomRight; contourFlags |= Draw_Bottom|Round_BottomLeft|Round_BottomRight;
surfaceFlags |= Round_BottomLeft|Round_BottomRight; surfaceFlags |= Round_BottomLeft|Round_BottomRight;
@ -2349,7 +2349,7 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
} }
case PE_ScrollBarAddLine: { case PE_ScrollBarAddLine: {
uint isNext = _scrollBarType == KStyle::NextStyleScrollBar; uint isNext = _scrollBarType == TDEStyle::NextStyleScrollBar;
uint contourFlags = (!isNext||!horiz||down?Draw_Left:0)| uint contourFlags = (!isNext||!horiz||down?Draw_Left:0)|
Draw_Right| Draw_Right|
(!isNext||horiz||down?Draw_Top:0)| (!isNext||horiz||down?Draw_Top:0)|
@ -2378,13 +2378,13 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
if( horiz ) if( horiz )
{ {
contourFlags |= Sharp_UpperLeft|Sharp_BottomLeft; contourFlags |= Sharp_UpperLeft|Sharp_BottomLeft;
if( _scrollBarType == KStyle::NextStyleScrollBar ) if( _scrollBarType == TDEStyle::NextStyleScrollBar )
contourFlags |= Sharp_UpperRight|Sharp_BottomRight; contourFlags |= Sharp_UpperRight|Sharp_BottomRight;
} }
else else
{ {
contourFlags |= Sharp_UpperLeft|Sharp_UpperRight; contourFlags |= Sharp_UpperLeft|Sharp_UpperRight;
if( _scrollBarType == KStyle::NextStyleScrollBar ) if( _scrollBarType == TDEStyle::NextStyleScrollBar )
contourFlags |= Sharp_BottomLeft|Sharp_BottomRight; contourFlags |= Sharp_BottomLeft|Sharp_BottomRight;
} }
@ -2561,12 +2561,12 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
// HACK!! // HACK!!
// //
// In order to draw nice edges in khtml, we need to paint alpha-blended. // In order to draw nice edges in tdehtml, we need to paint alpha-blended.
// On the other hand, we can't paint alpha-blended in normal widgets. // On the other hand, we can't paint alpha-blended in normal widgets.
// //
// In this place there is no reliable way to detect if we are in khtml; the // In this place there is no reliable way to detect if we are in tdehtml; the
// only thing we know is that khtml buffers its widgets into a pixmap. So // only thing we know is that tdehtml buffers its widgets into a pixmap. So
// when the paint device is a TQPixmap, chances are high that we are in khtml. // when the paint device is a TQPixmap, chances are high that we are in tdehtml.
// It's possible that this breaks other things, so let's see how it works... // It's possible that this breaks other things, so let's see how it works...
if (p->device() && dynamic_cast<TQPixmap*>(p->device() ) ) { if (p->device() && dynamic_cast<TQPixmap*>(p->device() ) ) {
contourFlags += Draw_AlphaBlend; contourFlags += Draw_AlphaBlend;
@ -2873,7 +2873,7 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
} }
default: { default: {
return KStyle::drawPrimitive(pe, p, r, cg, flags, opt); return TDEStyle::drawPrimitive(pe, p, r, cg, flags, opt);
} }
} }
} }
@ -3169,7 +3169,7 @@ void PolyesterStyle::drawControl(ControlElement element,
renderTab(p, r, cg, mouseOver, selected, true, pos, false, cornerWidget); renderTab(p, r, cg, mouseOver, selected, true, pos, false, cornerWidget);
break; break;
default: default:
KStyle::drawControl(element, p, widget, r, cg, flags, opt); TDEStyle::drawControl(element, p, widget, r, cg, flags, opt);
} }
break; break;
@ -3720,7 +3720,7 @@ void PolyesterStyle::drawControl(ControlElement element,
} }
default: default:
KStyle::drawControl(element, p, widget, r, cg, flags, opt); TDEStyle::drawControl(element, p, widget, r, cg, flags, opt);
} }
} }
@ -3739,7 +3739,7 @@ void PolyesterStyle::drawControlMask(ControlElement element,
} }
default: { default: {
KStyle::drawControlMask (element, p, w, r, opt); TDEStyle::drawControlMask (element, p, w, r, opt);
} }
} }
} }
@ -3760,7 +3760,7 @@ void PolyesterStyle::drawComplexControlMask(ComplexControl c,
break; break;
} }
default: { default: {
KStyle::drawComplexControlMask (c, p, w, r, o); TDEStyle::drawComplexControlMask (c, p, w, r, o);
} }
} }
} }
@ -3806,7 +3806,7 @@ void PolyesterStyle::drawComplexControl(ComplexControl control,
:cg.background(); :cg.background();
uint contourFlags = 0; uint contourFlags = 0;
if( khtmlWidgets.contains(cb) ) if( tdehtmlWidgets.contains(cb) )
contourFlags |= Draw_AlphaBlend; contourFlags |= Draw_AlphaBlend;
if (_inputFocusHighlight && hasFocus && editable && enabled) if (_inputFocusHighlight && hasFocus && editable && enabled)
@ -4185,7 +4185,7 @@ void PolyesterStyle::drawComplexControl(ComplexControl control,
} }
default: default:
KStyle::drawComplexControl(control, p, widget, TDEStyle::drawComplexControl(control, p, widget,
r, cg, flags, controls, r, cg, flags, controls,
active, opt); active, opt);
break; break;
@ -4200,7 +4200,7 @@ TQRect PolyesterStyle::subRect(SubRect r, const TQWidget *widget) const
return querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxEditField ); return querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxEditField );
} }
// Don't use KStyles progressbar subrect // Don't use TDEStyles progressbar subrect
// TODO: // TODO:
case SR_ProgressBarGroove: { case SR_ProgressBarGroove: {
return TQRect(widget->rect()); return TQRect(widget->rect());
@ -4212,7 +4212,7 @@ TQRect PolyesterStyle::subRect(SubRect r, const TQWidget *widget) const
} }
default: { default: {
return KStyle::subRect(r, widget); return TDEStyle::subRect(r, widget);
} }
} }
} }
@ -4235,7 +4235,7 @@ TQRect PolyesterStyle::querySubControlMetrics(ComplexControl control,
return TQRect(r.left()+2, r.top()+2, r.width()-4-15-1, r.height()-4); return TQRect(r.left()+2, r.top()+2, r.width()-4-15-1, r.height()-4);
} }
default: { default: {
return KStyle::querySubControlMetrics(control, widget, subcontrol, opt); return TDEStyle::querySubControlMetrics(control, widget, subcontrol, opt);
} }
} }
break; break;
@ -4279,13 +4279,13 @@ TQRect PolyesterStyle::querySubControlMetrics(ComplexControl control,
return TQRect(buttonsLeft, r.top()+1, bs.width(), r.height()-2); return TQRect(buttonsLeft, r.top()+1, bs.width(), r.height()-2);
} }
default: { default: {
return KStyle::querySubControlMetrics(control, widget, subcontrol, opt); return TDEStyle::querySubControlMetrics(control, widget, subcontrol, opt);
} }
} }
break; break;
} }
default: { default: {
return KStyle::querySubControlMetrics(control, widget, subcontrol, opt); return TDEStyle::querySubControlMetrics(control, widget, subcontrol, opt);
} }
} }
} }
@ -4391,19 +4391,19 @@ int PolyesterStyle::pixelMetric(PixelMetric m, const TQWidget *widget) const
} }
default: default:
return KStyle::pixelMetric(m, widget); return TDEStyle::pixelMetric(m, widget);
} }
} }
int PolyesterStyle::kPixelMetric(KStylePixelMetric kpm, const TQWidget *widget) const int PolyesterStyle::kPixelMetric(TDEStylePixelMetric kpm, const TQWidget *widget) const
{ {
switch(kpm) switch(kpm)
{ {
case KPM_MenuItemSeparatorHeight: case KPM_MenuItemSeparatorHeight:
return 2; return 2;
default: default:
return KStyle::kPixelMetric(kpm, widget); return TDEStyle::kPixelMetric(kpm, widget);
} }
} }
@ -4483,14 +4483,14 @@ TQSize PolyesterStyle::sizeFromContents(ContentsType t,
if(widget->parent() && ::tqt_cast<TQToolBar*>(widget->parent()) ) if(widget->parent() && ::tqt_cast<TQToolBar*>(widget->parent()) )
return TQSize( s.width()+2*4, s.height()+2*4 ); return TQSize( s.width()+2*4, s.height()+2*4 );
else else
return KStyle::sizeFromContents (t, widget, s, opt); return TDEStyle::sizeFromContents (t, widget, s, opt);
} }
default: default:
return KStyle::sizeFromContents (t, widget, s, opt); return TDEStyle::sizeFromContents (t, widget, s, opt);
} }
return KStyle::sizeFromContents (t, widget, s, opt); return TDEStyle::sizeFromContents (t, widget, s, opt);
} }
int PolyesterStyle::styleHint( StyleHint stylehint, int PolyesterStyle::styleHint( StyleHint stylehint,
@ -4532,14 +4532,14 @@ int PolyesterStyle::styleHint( StyleHint stylehint,
} }
#endif #endif
default: default:
return KStyle::styleHint(stylehint, widget, option, returnData); return TDEStyle::styleHint(stylehint, widget, option, returnData);
} }
} }
bool PolyesterStyle::eventFilter(TQObject *obj, TQEvent *ev) bool PolyesterStyle::eventFilter(TQObject *obj, TQEvent *ev)
{ {
if (KStyle::eventFilter(obj, ev) ) if (TDEStyle::eventFilter(obj, ev) )
return true; return true;
if (!obj->isWidgetType() ) return false; if (!obj->isWidgetType() ) return false;
@ -4690,7 +4690,7 @@ bool PolyesterStyle::eventFilter(TQObject *obj, TQEvent *ev)
animationTimer->start( 50, false ); animationTimer->start( 50, false );
} }
} }
if ( !qstrcmp(obj->name(), "kde toolbar widget") ) if ( !qstrcmp(obj->name(), "tde toolbar widget") )
{ {
TQWidget* lb = static_cast<TQWidget*>(obj); TQWidget* lb = static_cast<TQWidget*>(obj);
if (lb->backgroundMode() == TQt::PaletteButton) if (lb->backgroundMode() == TQt::PaletteButton)

@ -23,7 +23,7 @@
Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org> Copyright (C) 2000 Daniel M. Duley <mosfet@kde.org>
(C) 2000 Dirk Mueller <mueller@kde.org> (C) 2000 Dirk Mueller <mueller@kde.org>
(C) 2001 Martijn Klingens <klingens@kde.org> (C) 2001 Martijn Klingens <klingens@kde.org>
Progressbar code based on KStyle, Progressbar code based on TDEStyle,
Copyright (C) 2001-2002 Karol Szwed <gallium@kde.org> Copyright (C) 2001-2002 Karol Szwed <gallium@kde.org>
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
@ -44,7 +44,7 @@
#ifndef __POLYESTER_H #ifndef __POLYESTER_H
#define __POLYESTER_H #define __POLYESTER_H
#include <kstyle.h> #include <tdestyle.h>
#include <tqbitmap.h> #include <tqbitmap.h>
#include <tqintcache.h> #include <tqintcache.h>
@ -62,7 +62,7 @@ class TQTimer;
//a tiny reimplementation of max... //a tiny reimplementation of max...
int max(int a, int b){return (a>b?a:b);} int max(int a, int b){return (a>b?a:b);}
class PolyesterStyle : public KStyle class PolyesterStyle : public TDEStyle
{ {
TQ_OBJECT TQ_OBJECT
@ -74,7 +74,7 @@ public:
void polish(TQWidget* widget ); void polish(TQWidget* widget );
void unPolish(TQWidget* widget ); void unPolish(TQWidget* widget );
void drawKStylePrimitive(KStylePrimitive kpe, void drawTDEStylePrimitive(TDEStylePrimitive kpe,
TQPainter* p, TQPainter* p,
const TQWidget* widget, const TQWidget* widget,
const TQRect &r, const TQRect &r,
@ -112,7 +112,7 @@ public:
int pixelMetric(PixelMetric m, int pixelMetric(PixelMetric m,
const TQWidget *widget = 0 ) const; const TQWidget *widget = 0 ) const;
int kPixelMetric(KStylePixelMetric kpm, const TQWidget *widget) const; int kPixelMetric(TDEStylePixelMetric kpm, const TQWidget *widget) const;
TQRect subRect(SubRect r, TQRect subRect(SubRect r,
const TQWidget *widget ) const; const TQWidget *widget ) const;
@ -242,7 +242,7 @@ protected:
bool mouseOver = false, bool mouseOver = false,
bool horizontal = true, bool horizontal = true,
bool enabled = true, bool enabled = true,
bool khtmlMode = false, bool tdehtmlMode = false,
int animFrame = 0, int animFrame = 0,
bool isDefault = false) const; bool isDefault = false) const;
@ -285,7 +285,7 @@ protected:
int hoverHeaderId; int hoverHeaderId;
protected slots: protected slots:
void khtmlWidgetDestroyed(TQObject* w); void tdehtmlWidgetDestroyed(TQObject* w);
void sliderThumbMoved(int val); void sliderThumbMoved(int val);
@ -311,7 +311,7 @@ private:
bool _scrollBarLines; bool _scrollBarLines;
TQString _scrollBarStyle; TQString _scrollBarStyle;
int _scrollBarExtent; int _scrollBarExtent;
KStyle::KStyleScrollBarType _scrollBarType; TDEStyle::TDEStyleScrollBarType _scrollBarType;
bool _useLowerCaseText; bool _useLowerCaseText;
bool _animateProgressBar; bool _animateProgressBar;
bool _animateButton; bool _animateButton;
@ -346,8 +346,8 @@ private:
TQTab *hoverTab; TQTab *hoverTab;
// track khtml widgets. // track tdehtml widgets.
TQMap<const TQWidget*,bool> khtmlWidgets; TQMap<const TQWidget*,bool> tdehtmlWidgets;
//Animation support. //Animation support.
TQMap<TQWidget*, int> progAnimWidgets; TQMap<TQWidget*, int> progAnimWidgets;

Loading…
Cancel
Save