summaryrefslogtreecommitdiffstats
path: root/style/polyester.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'style/polyester.cpp')
-rwxr-xr-xstyle/polyester.cpp116
1 files changed, 58 insertions, 58 deletions
diff --git a/style/polyester.cpp b/style/polyester.cpp
index 0c2b1bc..5fe43fa 100755
--- a/style/polyester.cpp
+++ b/style/polyester.cpp
@@ -23,7 +23,7 @@
Copyright (C) 2000 Daniel M. Duley <[email protected]>
(C) 2000 Dirk Mueller <[email protected]>
(C) 2001 Martijn Klingens <[email protected]>
- Progressbar code based on KStyle,
+ Progressbar code based on TDEStyle,
Copyright (C) 2001-2002 Karol Szwed <[email protected]>
This library is free software; you can redistribute it and/or
@@ -73,7 +73,7 @@
#include <tqsettings.h>
#include <kpixmap.h>
#include <kimageeffect.h>
-#include <kglobal.h>
+#include <tdeglobal.h>
#include "polyester.h"
#include "polyester.moc"
@@ -160,7 +160,7 @@ class PolyesterStylePlugin : public TQStylePlugin
KDE_Q_EXPORT_PLUGIN( PolyesterStylePlugin )
// -- end --
-PolyesterStyle::PolyesterStyle() : KStyle( AllowMenuTransparency, ThreeButtonScrollBar),
+PolyesterStyle::PolyesterStyle() : TDEStyle( AllowMenuTransparency, ThreeButtonScrollBar),
kickerMode(false),
kornMode(false),
flatMode(false)
@@ -236,19 +236,19 @@ PolyesterStyle::PolyesterStyle() : KStyle( AllowMenuTransparency, ThreeButtonScr
this hack may be disabled in the future, let's see...*/
if( !qstrcmp( tqApp->argv() [ 0 ], "unknown" ) )
{
- _scrollBarType = KStyle::WindowsStyleScrollBar;
+ _scrollBarType = TDEStyle::WindowsStyleScrollBar;
_menuStripe = false;
}
//Thanks, Lipstik :-)
else if( !strcmp(_scrollBarStyle,"ThreeButtonScrollBar" ) )
- _scrollBarType = KStyle::ThreeButtonScrollBar;
+ _scrollBarType = TDEStyle::ThreeButtonScrollBar;
else if( !strcmp(_scrollBarStyle,"WindowsStyleScrollBar" ) )
- _scrollBarType = KStyle::WindowsStyleScrollBar;
+ _scrollBarType = TDEStyle::WindowsStyleScrollBar;
else if( !strcmp(_scrollBarStyle,"PlatinumStyleScrollBar" ) )
- _scrollBarType = KStyle::PlatinumStyleScrollBar;
+ _scrollBarType = TDEStyle::PlatinumStyleScrollBar;
else if( !strcmp(_scrollBarStyle,"NextStyleScrollBar" ) )
- _scrollBarType = KStyle::NextStyleScrollBar;
+ _scrollBarType = TDEStyle::NextStyleScrollBar;
//HACK for gtk-qt: if setScrollBarType is called wxwidgets applications will broke
/*if( qstrcmp( tqApp->argv() [ 0 ], "unknown" ) )
@@ -363,9 +363,9 @@ void PolyesterStyle::polish(TQApplication* app)
void PolyesterStyle::polish(TQWidget* widget)
{
- if( !strcmp(widget->name(), "__khtml") ) { // is it a khtml widget...?
- khtmlWidgets[widget] = true;
- connect(widget, SIGNAL(destroyed(TQObject*)), this, SLOT(khtmlWidgetDestroyed(TQObject*)));
+ if( !strcmp(widget->name(), "__tdehtml") ) { // is it a tdehtml widget...?
+ tdehtmlWidgets[widget] = true;
+ 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
@@ -401,7 +401,7 @@ void PolyesterStyle::polish(TQWidget* widget)
widget->installEventFilter(this);
} else if (::tqt_cast<TQPopupMenu*>(widget)) {
widget->setBackgroundMode( NoBackground );
- } else if ( !qstrcmp(widget->name(), "kde toolbar widget") ) {
+ } else if ( !qstrcmp(widget->name(), "tde toolbar widget") ) {
widget->installEventFilter(this);
} else if (::tqt_cast<TQHeader*>(widget)) {
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)
{
- if( !strcmp(widget->name(), "__khtml") ) { // is it a khtml widget...?
- khtmlWidgets.remove(widget);
+ if( !strcmp(widget->name(), "__tdehtml") ) { // is it a tdehtml widget...?
+ tdehtmlWidgets.remove(widget);
}
// 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);
} else if (::tqt_cast<TQPopupMenu*>(widget)) {
widget->setBackgroundMode( PaletteBackground );
- } else if ( !qstrcmp(widget->name(), "kde toolbar widget") ) {
+ } else if ( !qstrcmp(widget->name(), "tde toolbar widget") ) {
widget->removeEventFilter(this);
}
@@ -459,13 +459,13 @@ void PolyesterStyle::unPolish(TQWidget* widget)
progAnimWidgets.remove(widget);
}
- KStyle::unPolish(widget);
+ TDEStyle::unPolish(widget);
}
/*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)
@@ -962,7 +962,7 @@ void PolyesterStyle::renderButton(TQPainter *p,
bool mouseOver,
bool horizontal,
bool enabled,
- bool khtmlMode,
+ bool tdehtmlMode,
int animFrame,
bool isDefault //TODO: move here all the default-button related code?
) const
@@ -975,7 +975,7 @@ void PolyesterStyle::renderButton(TQPainter *p,
uint contourFlags = Draw_Left|Draw_Right|Draw_Top|Draw_Bottom;
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;
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,
const TQWidget* widget,
const TQRect &r,
@@ -1844,7 +1844,7 @@ void PolyesterStyle::drawKStylePrimitive(KStylePrimitive kpe,
break;
}
- // copied and slightly modified from KStyle.
+ // copied and slightly modified from TDEStyle.
case KPE_ListViewBranch: {
// Typical Windows style listview branch element (dotted line).
@@ -1917,7 +1917,7 @@ void PolyesterStyle::drawKStylePrimitive(KStylePrimitive kpe,
}
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_ButtonDropDown:
case PE_ButtonCommand: {
- bool khtmlMode = khtmlWidgets.contains(opt.widget());
+ bool tdehtmlMode = tdehtmlWidgets.contains(opt.widget());
int animFrame = 0;
if( _animateButton && animWidgets.contains(opt.widget()) )
animFrame = (int)animWidgets[opt.widget()].animFrame;
renderButton(p, r, cg, (on||down), mouseOver, true, enabled,
- khtmlMode, animFrame, flags & Style_ButtonDefault );
+ tdehtmlMode, animFrame, flags & Style_ButtonDefault );
break;
}
@@ -2222,14 +2222,14 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
//coordinates for the surface
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;
surfaceFlags |= Round_UpperLeft|Round_BottomLeft;
xs++;
ws--;
}
- else if( pe == PE_ScrollBarAddPage && ( _scrollBarType == KStyle::NextStyleScrollBar ) )
+ else if( pe == PE_ScrollBarAddPage && ( _scrollBarType == TDEStyle::NextStyleScrollBar ) )
{
contourFlags |= Draw_Right|Round_UpperRight|Round_BottomRight;
surfaceFlags |= Round_UpperRight|Round_BottomRight;
@@ -2255,14 +2255,14 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
//coordinates for the surface
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;
surfaceFlags |= Round_UpperLeft|Round_UpperRight;
ys++;
hs--;
}
- else if( pe == PE_ScrollBarAddPage && ( _scrollBarType == KStyle::NextStyleScrollBar ) )
+ else if( pe == PE_ScrollBarAddPage && ( _scrollBarType == TDEStyle::NextStyleScrollBar ) )
{
contourFlags |= Draw_Bottom|Round_BottomLeft|Round_BottomRight;
surfaceFlags |= Round_BottomLeft|Round_BottomRight;
@@ -2349,7 +2349,7 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
}
case PE_ScrollBarAddLine: {
- uint isNext = _scrollBarType == KStyle::NextStyleScrollBar;
+ uint isNext = _scrollBarType == TDEStyle::NextStyleScrollBar;
uint contourFlags = (!isNext||!horiz||down?Draw_Left:0)|
Draw_Right|
(!isNext||horiz||down?Draw_Top:0)|
@@ -2378,13 +2378,13 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
if( horiz )
{
contourFlags |= Sharp_UpperLeft|Sharp_BottomLeft;
- if( _scrollBarType == KStyle::NextStyleScrollBar )
+ if( _scrollBarType == TDEStyle::NextStyleScrollBar )
contourFlags |= Sharp_UpperRight|Sharp_BottomRight;
}
else
{
contourFlags |= Sharp_UpperLeft|Sharp_UpperRight;
- if( _scrollBarType == KStyle::NextStyleScrollBar )
+ if( _scrollBarType == TDEStyle::NextStyleScrollBar )
contourFlags |= Sharp_BottomLeft|Sharp_BottomRight;
}
@@ -2561,12 +2561,12 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
// 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.
//
- // In this place there is no reliable way to detect if we are in khtml; the
- // only thing we know is that khtml buffers its widgets into a pixmap. So
- // when the paint device is a TQPixmap, chances are high that we are in khtml.
+ // In this place there is no reliable way to detect if we are in tdehtml; the
+ // 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 tdehtml.
// It's possible that this breaks other things, so let's see how it works...
if (p->device() && dynamic_cast<TQPixmap*>(p->device() ) ) {
contourFlags += Draw_AlphaBlend;
@@ -2873,7 +2873,7 @@ void PolyesterStyle::drawPrimitive(PrimitiveElement pe,
}
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);
break;
default:
- KStyle::drawControl(element, p, widget, r, cg, flags, opt);
+ TDEStyle::drawControl(element, p, widget, r, cg, flags, opt);
}
break;
@@ -3720,7 +3720,7 @@ void PolyesterStyle::drawControl(ControlElement element,
}
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: {
- KStyle::drawControlMask (element, p, w, r, opt);
+ TDEStyle::drawControlMask (element, p, w, r, opt);
}
}
}
@@ -3760,7 +3760,7 @@ void PolyesterStyle::drawComplexControlMask(ComplexControl c,
break;
}
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();
uint contourFlags = 0;
- if( khtmlWidgets.contains(cb) )
+ if( tdehtmlWidgets.contains(cb) )
contourFlags |= Draw_AlphaBlend;
if (_inputFocusHighlight && hasFocus && editable && enabled)
@@ -4185,7 +4185,7 @@ void PolyesterStyle::drawComplexControl(ComplexControl control,
}
default:
- KStyle::drawComplexControl(control, p, widget,
+ TDEStyle::drawComplexControl(control, p, widget,
r, cg, flags, controls,
active, opt);
break;
@@ -4200,7 +4200,7 @@ TQRect PolyesterStyle::subRect(SubRect r, const TQWidget *widget) const
return querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxEditField );
}
- // Don't use KStyles progressbar subrect
+ // Don't use TDEStyles progressbar subrect
// TODO:
case SR_ProgressBarGroove: {
return TQRect(widget->rect());
@@ -4212,7 +4212,7 @@ TQRect PolyesterStyle::subRect(SubRect r, const TQWidget *widget) const
}
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);
}
default: {
- return KStyle::querySubControlMetrics(control, widget, subcontrol, opt);
+ return TDEStyle::querySubControlMetrics(control, widget, subcontrol, opt);
}
}
break;
@@ -4279,13 +4279,13 @@ TQRect PolyesterStyle::querySubControlMetrics(ComplexControl control,
return TQRect(buttonsLeft, r.top()+1, bs.width(), r.height()-2);
}
default: {
- return KStyle::querySubControlMetrics(control, widget, subcontrol, opt);
+ return TDEStyle::querySubControlMetrics(control, widget, subcontrol, opt);
}
}
break;
}
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:
- 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)
{
case KPM_MenuItemSeparatorHeight:
return 2;
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()) )
return TQSize( s.width()+2*4, s.height()+2*4 );
else
- return KStyle::sizeFromContents (t, widget, s, opt);
+ return TDEStyle::sizeFromContents (t, widget, s, opt);
}
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,
@@ -4532,14 +4532,14 @@ int PolyesterStyle::styleHint( StyleHint stylehint,
}
#endif
default:
- return KStyle::styleHint(stylehint, widget, option, returnData);
+ return TDEStyle::styleHint(stylehint, widget, option, returnData);
}
}
bool PolyesterStyle::eventFilter(TQObject *obj, TQEvent *ev)
{
- if (KStyle::eventFilter(obj, ev) )
+ if (TDEStyle::eventFilter(obj, ev) )
return true;
if (!obj->isWidgetType() ) return false;
@@ -4690,7 +4690,7 @@ bool PolyesterStyle::eventFilter(TQObject *obj, TQEvent *ev)
animationTimer->start( 50, false );
}
}
- if ( !qstrcmp(obj->name(), "kde toolbar widget") )
+ if ( !qstrcmp(obj->name(), "tde toolbar widget") )
{
TQWidget* lb = static_cast<TQWidget*>(obj);
if (lb->backgroundMode() == TQt::PaletteButton)