Rename a number of old tq methods that are no longer tq specific

pull/1/head
Timothy Pearson 12 years ago
parent edf786fd79
commit fefd761868

@ -29,7 +29,7 @@ DEALINGS IN THE SOFTWARE.
*/
#include <tqcheckbox.h>
#include <tqlayout.h>
#include <layout.h>
#include <tqhbox.h>
#include <tqsettings.h>
#include <tqcolor.h>
@ -56,20 +56,20 @@ extern "C"
LipstikStyleConfig::LipstikStyleConfig(TQWidget* parent): TQWidget(parent)
{
TQVBoxLayout* tqlayout = new TQVBoxLayout(this, 0, 0);
TQVBoxLayout* layout = new TQVBoxLayout(this, 0, 0);
TQGridLayout* tabLayout = new TQGridLayout(this, 2, 1, 10);
KGlobal::locale()->insertCatalogue("kstyle_lipstik_config");
///Init tabs
TQTabWidget *tabWidget = new TQTabWidget(this);
tqlayout->addWidget(tabWidget);
layout->addWidget(tabWidget);
///Init tab1
TQWidget *page1 = new TQWidget(tabWidget);
tqlayout = new TQVBoxLayout(page1);
layout = new TQVBoxLayout(page1);
tabWidget->insertTab(page1, i18n("Configuration"));
tqlayout->addLayout(tabLayout);
layout->addLayout(tabLayout);
///General group
TQVGroupBox *generalGrp = new TQVGroupBox(i18n("General"), page1);
@ -110,7 +110,7 @@ LipstikStyleConfig::LipstikStyleConfig(TQWidget* parent): TQWidget(parent)
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) );
menuColorBox->layout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) );
menuStripeColor = new KColorButton(menuColorBox);
@ -171,22 +171,22 @@ LipstikStyleConfig::LipstikStyleConfig(TQWidget* parent): TQWidget(parent)
customFocusHighlightColor = new TQCheckBox(i18n("Input fields highlight :"), otherGrp);
TQHBox *hbox1 = new TQHBox(otherGrp);
hbox1->tqlayout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) );
hbox1->layout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) );
focusHighlightColor = new KColorButton(hbox1);
customOverHighlightColor = new TQCheckBox(i18n("Mouse hover highlight :"), otherGrp);
TQHBox *hbox2 = new TQHBox(otherGrp);
hbox2->tqlayout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) );
hbox2->layout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) );
overHighlightColor = new KColorButton(hbox2);
customCheckMarkColor = new TQCheckBox(i18n("Checkmark/Radiobuttons :"), otherGrp);
TQHBox *hbox3 = new TQHBox(otherGrp);
hbox3->tqlayout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) );
hbox3->layout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) );
checkMarkColor = new KColorButton(hbox3);
customTabHighlightColor = new TQCheckBox(i18n("Active tab highlight :"), otherGrp);
TQHBox *hbox4 = new TQHBox(otherGrp);
hbox4->tqlayout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) );
hbox4->layout()->addItem(new TQSpacerItem(20, 0, TQSizePolicy::Fixed, TQSizePolicy::Minimum) );
tabHighlightColor = new KColorButton(hbox4);
tabLayout->addWidget(otherGrp,1,2,0);
@ -211,7 +211,7 @@ LipstikStyleConfig::LipstikStyleConfig(TQWidget* parent): TQWidget(parent)
TQLabel* pcbsdLabel;
TQLabel* othersLabel;
tqlayout = new TQVBoxLayout(page2, 10, -1);
layout = new TQVBoxLayout(page2, 10, -1);
tabWidget->insertTab(page2, i18n("About"));
@ -267,29 +267,29 @@ LipstikStyleConfig::LipstikStyleConfig(TQWidget* parent): TQWidget(parent)
othersLabel = new TQLabel(page2);
othersLabel->setText(i18n("Special thanks to Dominique and all the kde-look.org users."));
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);
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);
///Populate!
TQSettings s;

@ -965,13 +965,13 @@ void LipstikStyle::renderPanel(TQPainter *p,
p->setPen(g.mid());
p->drawConvexPolygon(TQPointArray(4, corners));
p->setPen(g.mid());
p->tqdrawPolyline(TQPointArray(4, corners), 0, 3);
p->drawPolyline(TQPointArray(4, corners), 0, 3);
} else {
const TQCOORD corners[] = { x, y2, x, y, x2, y, x2, y2 };
p->setPen(g.background().dark());
p->drawPolygon(TQPointArray(4, corners));
p->setPen(g.background().light());
p->tqdrawPolyline(TQPointArray(4, corners), 0, 3);
p->drawPolyline(TQPointArray(4, corners), 0, 3);
}
} else {
renderContour(p, r, g.background(), getColor(g, PanelContour) );
@ -1236,7 +1236,7 @@ void LipstikStyle::renderTab(TQPainter *p,
// fake the panel border edge for tabs which are aligned left-most
// (i.e. only if there is no widget in the corner of the tabwidget!)
if(isFirst&&!reverseLayout&&!cornerWidget)
// normal tqlayout
// normal layout
{
if (!bottom) {
p->setPen(alphaBlendColors(g.background(), getColor(g,PanelContour), 50) );
@ -1258,7 +1258,7 @@ void LipstikStyle::renderTab(TQPainter *p,
p->drawPoint(Rb.x()+1, Rb.bottom() );
}
} else if(isFirst&&reverseLayout&&!cornerWidget)
// reverse tqlayout
// reverse layout
{
if (!bottom) {
p->setPen(alphaBlendColors(g.background(), getColor(g,PanelContour), 50) );
@ -2407,11 +2407,11 @@ void LipstikStyle::tqdrawPrimitive(PrimitiveElement pe,
}
}
const TQWMatrix oldMatrix( p->tqworldMatrix() );
const TQWMatrix oldMatrix( p->worldMatrix() );
if (flags & Style_Down) {
p->translate(tqpixelMetric(PM_ButtonShiftHorizontal),
tqpixelMetric(PM_ButtonShiftVertical));
p->translate(pixelMetric(PM_ButtonShiftHorizontal),
pixelMetric(PM_ButtonShiftVertical));
}
a.translate((r.x()+r.width()/2), (r.y()+r.height()/2));
@ -2452,7 +2452,7 @@ void LipstikStyle::tqdrawPrimitive(PrimitiveElement pe,
}
void LipstikStyle::tqdrawControl(ControlElement element,
void LipstikStyle::drawControl(ControlElement element,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
@ -2614,7 +2614,7 @@ void LipstikStyle::tqdrawControl(ControlElement element,
if(cw)
cornerWidget = true;
}
TQTabBar::Shape tbs = tb->tqshape();
TQTabBar::Shape tbs = tb->shape();
bool selected = false;
if (flags & Style_Selected) selected = true;
TabPosition pos;
@ -2650,7 +2650,7 @@ void LipstikStyle::tqdrawControl(ControlElement element,
renderTab(p, r, cg, mouseOver, selected, true, pos, false, cornerWidget);
break;
default:
KStyle::tqdrawControl(element, p, widget, r, cg, flags, opt);
KStyle::drawControl(element, p, widget, r, cg, flags, opt);
}
break;
@ -2693,15 +2693,15 @@ void LipstikStyle::tqdrawControl(ControlElement element,
// Shift button contents if pushed.
if ( active )
{
x += tqpixelMetric(PM_ButtonShiftHorizontal, widget);
y += tqpixelMetric(PM_ButtonShiftVertical, widget);
x += pixelMetric(PM_ButtonShiftHorizontal, widget);
y += pixelMetric(PM_ButtonShiftVertical, widget);
flags |= Style_Sunken;
}
// Does the button have a popup menu?
if ( button->isMenuButton() )
{
int dx = tqpixelMetric( PM_MenuButtonIndicator, widget );
int dx = pixelMetric( PM_MenuButtonIndicator, widget );
if ( button->iconSet() && !button->iconSet()->isNull() &&
(dx + button->iconSet()->pixmap (TQIconSet::Small, TQIconSet::Normal, TQIconSet::Off ).width()) >= w )
{
@ -2710,7 +2710,7 @@ void LipstikStyle::tqdrawControl(ControlElement element,
else
{
p->setPen(cg.buttonText());
tqdrawPrimitive( PE_ArrowDown, p, tqvisualRect( TQRect(x + w - dx - 8, y + 2, dx, h - 4), r ),
tqdrawPrimitive( PE_ArrowDown, p, visualRect( TQRect(x + w - dx - 8, y + 2, dx, h - 4), r ),
cg, flags, opt );
w -= dx;
}
@ -2736,7 +2736,7 @@ void LipstikStyle::tqdrawControl(ControlElement element,
p->drawPixmap( x + 4, y + h / 2 - pixmap.height() / 2, pixmap );
if (cornArrow) //Draw over the icon
tqdrawPrimitive( PE_ArrowDown, p, tqvisualRect( TQRect(x + w - 6, x + h - 6, 7, 7), r ),
tqdrawPrimitive( PE_ArrowDown, p, visualRect( TQRect(x + w - 6, x + h - 6, 7, 7), r ),
cg, flags, opt );
@ -2746,14 +2746,14 @@ void LipstikStyle::tqdrawControl(ControlElement element,
}
// Make the label indicate if the button is a default button or not
drawItem( p, TQRect(x, y, w, h), AlignCenter|ShowPrefix, button->tqcolorGroup(),
drawItem( p, TQRect(x, y, w, h), AlignCenter|ShowPrefix, button->colorGroup(),
button->isEnabled(), button->pixmap(), button->text(), -1,
&button->tqcolorGroup().buttonText() );
&button->colorGroup().buttonText() );
if ( flags & Style_HasFocus )
tqdrawPrimitive( PE_FocusRect, p,
tqvisualRect( subRect( SR_PushButtonFocusRect, widget ), widget ),
visualRect( subRect( SR_PushButtonFocusRect, widget ), widget ),
cg, flags );
break;
}
@ -2837,7 +2837,7 @@ void LipstikStyle::tqdrawControl(ControlElement element,
bool enabled = mi->isEnabled();
bool checkable = popupmenu->isCheckable();
bool active = flags & Style_Active;
bool etchtext = tqstyleHint( SH_EtchDisabledText );
bool etchtext = styleHint( SH_EtchDisabledText );
bool reverse = TQApplication::reverseLayout();
if ( checkable )
@ -2924,7 +2924,7 @@ void LipstikStyle::tqdrawControl(ControlElement element,
break;
}
TQRect cr = tqvisualRect( TQRect( r.x() + 2, r.y() + 2, checkcol - 1, r.height() - 4 ), r );
TQRect cr = visualRect( TQRect( r.x() + 2, r.y() + 2, checkcol - 1, r.height() - 4 ), r );
// Do we have an icon?
if ( mi->iconSet() ) {
@ -3077,8 +3077,8 @@ void LipstikStyle::tqdrawControl(ControlElement element,
// Does the menu item have a submenu?
if ( mi->popup() ) {
PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight;
int dim = tqpixelMetric(PM_MenuButtonIndicator) - 1;
TQRect vr = tqvisualRect( TQRect( r.x() + r.width() - 5 - 1 - dim,
int dim = pixelMetric(PM_MenuButtonIndicator) - 1;
TQRect vr = visualRect( TQRect( r.x() + r.width() - 5 - 1 - dim,
r.y() + r.height() / 2 - dim / 2, dim, dim), r );
// Draw an arrow at the far end of the menu item
@ -3124,11 +3124,11 @@ void LipstikStyle::tqdrawControl(ControlElement element,
break;
default:
KStyle::tqdrawControl(element, p, widget, r, cg, flags, opt);
KStyle::drawControl(element, p, widget, r, cg, flags, opt);
}
}
void LipstikStyle::tqdrawControlMask(ControlElement element,
void LipstikStyle::drawControlMask(ControlElement element,
TQPainter *p,
const TQWidget *w,
const TQRect &r,
@ -3143,12 +3143,12 @@ void LipstikStyle::tqdrawControlMask(ControlElement element,
}
default: {
KStyle::tqdrawControlMask (element, p, w, r, opt);
KStyle::drawControlMask (element, p, w, r, opt);
}
}
}
void LipstikStyle::tqdrawComplexControlMask(ComplexControl c,
void LipstikStyle::drawComplexControlMask(ComplexControl c,
TQPainter *p,
const TQWidget *w,
const TQRect &r,
@ -3164,12 +3164,12 @@ void LipstikStyle::tqdrawComplexControlMask(ComplexControl c,
break;
}
default: {
KStyle::tqdrawComplexControlMask (c, p, w, r, o);
KStyle::drawComplexControlMask (c, p, w, r, o);
}
}
}
void LipstikStyle::tqdrawComplexControl(ComplexControl control,
void LipstikStyle::drawComplexControl(ComplexControl control,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
@ -3596,7 +3596,7 @@ void LipstikStyle::tqdrawComplexControl(ComplexControl control,
}
default:
KStyle::tqdrawComplexControl(control, p, widget,
KStyle::drawComplexControl(control, p, widget,
r, cg, flags, controls,
active, opt);
break;
@ -3701,15 +3701,15 @@ TQRect LipstikStyle::querySubControlMetrics(ComplexControl control,
}
}
int LipstikStyle::tqpixelMetric(PixelMetric m, const TQWidget *widget) const
int LipstikStyle::pixelMetric(PixelMetric m, const TQWidget *widget) const
{
switch(m) {
// TABS
// ----
case PM_TabBarTabVSpace: {
const TQTabBar * tb = (const TQTabBar *) widget;
if (tb->tqshape() == TQTabBar::RoundedAbove ||
tb->tqshape() == TQTabBar::RoundedBelow)
if (tb->shape() == TQTabBar::RoundedAbove ||
tb->shape() == TQTabBar::RoundedBelow)
return 12;
else
return 4;
@ -3813,7 +3813,7 @@ int LipstikStyle::tqpixelMetric(PixelMetric m, const TQWidget *widget) const
}
default:
return KStyle::tqpixelMetric(m, widget);
return KStyle::pixelMetric(m, widget);
}
}
@ -3835,8 +3835,8 @@ TQSize LipstikStyle::tqsizeFromContents(ContentsType t,
bool checkable = popup->isCheckable();
if (mi->custom()) {
w = mi->custom()->tqsizeHint().width();
h = mi->custom()->tqsizeHint().height();
w = mi->custom()->sizeHint().width();
h = mi->custom()->sizeHint().height();
if (!mi->custom()->fullSpan() )
h += 4;
} else if (mi->widget()) {
@ -3882,8 +3882,8 @@ TQSize LipstikStyle::tqsizeFromContents(ContentsType t,
{
const TQPushButton* btn = static_cast<const TQPushButton*>(widget);
int w = s.width() + 2 * tqpixelMetric(PM_ButtonMargin, widget);
int h = s.height() + 2 * tqpixelMetric(PM_ButtonMargin, widget);
int w = s.width() + 2 * pixelMetric(PM_ButtonMargin, widget);
int h = s.height() + 2 * pixelMetric(PM_ButtonMargin, widget);
if ( btn->text().isEmpty() && s.width() < 32 ) return TQSize(w, h);
return TQSize( w+25, h+5 );
@ -3904,7 +3904,7 @@ TQSize LipstikStyle::tqsizeFromContents(ContentsType t,
return KStyle::tqsizeFromContents (t, widget, s, opt);
}
int LipstikStyle::tqstyleHint( StyleHint stylehint,
int LipstikStyle::styleHint( StyleHint stylehint,
const TQWidget *widget,
const TQStyleOption &option,
TQStyleHintReturn* returnData ) const
@ -3914,7 +3914,7 @@ int LipstikStyle::tqstyleHint( StyleHint stylehint,
return 96; // Motif-like delay...
default:
return KStyle::tqstyleHint(stylehint, widget, option, returnData);
return KStyle::styleHint(stylehint, widget, option, returnData);
}
}
@ -3934,14 +3934,14 @@ bool LipstikStyle::eventFilter(TQObject *obj, TQEvent *ev)
TQWidget* spinbox = widget->parentWidget();
if ((ev->type() == TQEvent::FocusIn) || (ev->type() == TQEvent::FocusOut))
{
spinbox->tqrepaint(false);
spinbox->repaint(false);
}
return false;
}
if ((ev->type() == TQEvent::FocusIn) || (ev->type() == TQEvent::FocusOut))
{
widget->tqrepaint(false);
widget->repaint(false);
}
return false;
}
@ -3957,13 +3957,13 @@ bool LipstikStyle::eventFilter(TQObject *obj, TQEvent *ev)
{
TQWidget* button = TQT_TQWIDGET(obj);
hoverWidget = button;
button->tqrepaint(false);
button->repaint(false);
}
else if ((ev->type() == TQEvent::Leave) && (TQT_BASE_OBJECT(obj) == TQT_BASE_OBJECT(hoverWidget)) )
{
TQWidget* button = TQT_TQWIDGET(obj);
hoverWidget = 0;
button->tqrepaint(false);
button->repaint(false);
}
return false;
}
@ -3973,7 +3973,7 @@ bool LipstikStyle::eventFilter(TQObject *obj, TQEvent *ev)
TQWidget* tabbar = TQT_TQWIDGET(obj);
hoverWidget = tabbar;
hoverTab = 0;
tabbar->tqrepaint(false);
tabbar->repaint(false);
}
else if (ev->type() == TQEvent::MouseMove)
{
@ -3984,15 +3984,15 @@ bool LipstikStyle::eventFilter(TQObject *obj, TQEvent *ev)
// avoid unnecessary repaints (which otherwise would occour on every
// MouseMove event causing high cpu load).
bool tqrepaint = true;
bool repaint = true;
TQTab *tab = tabbar->selectTab(me->pos() );
if (hoverTab == tab)
tqrepaint = false;
repaint = false;
hoverTab = tab;
if (tqrepaint)
tabbar->tqrepaint(false);
if (repaint)
tabbar->repaint(false);
}
}
else if (ev->type() == TQEvent::Leave)
@ -4000,7 +4000,7 @@ bool LipstikStyle::eventFilter(TQObject *obj, TQEvent *ev)
TQWidget* tabbar = TQT_TQWIDGET(obj);
hoverWidget = 0;
hoverTab = 0;
tabbar->tqrepaint(false);
tabbar->repaint(false);
}
return false;
}

@ -88,7 +88,7 @@ public:
SFlags flags = Style_Default,
const TQStyleOption &opt = TQStyleOption::Default ) const;
void tqdrawControl(ControlElement element,
void drawControl(ControlElement element,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
@ -96,9 +96,9 @@ public:
SFlags flags = Style_Default,
const TQStyleOption& = TQStyleOption::Default ) const;
void tqdrawControlMask( ControlElement, TQPainter *, const TQWidget *, const TQRect &, const TQStyleOption &) const;
void drawControlMask( ControlElement, TQPainter *, const TQWidget *, const TQRect &, const TQStyleOption &) const;
void tqdrawComplexControl(ComplexControl control,
void drawComplexControl(ComplexControl control,
TQPainter *p,
const TQWidget *widget,
const TQRect &r,
@ -108,7 +108,7 @@ public:
SCFlags active = SC_None,
const TQStyleOption& = TQStyleOption::Default ) const;
int tqpixelMetric(PixelMetric m,
int pixelMetric(PixelMetric m,
const TQWidget *widget = 0 ) const;
TQRect subRect(SubRect r,
@ -119,7 +119,7 @@ public:
SubControl subcontrol,
const TQStyleOption &opt = TQStyleOption::Default ) const;
void tqdrawComplexControlMask(TQStyle::ComplexControl c,
void drawComplexControlMask(TQStyle::ComplexControl c,
TQPainter *p,
const TQWidget *w,
const TQRect &r,
@ -130,7 +130,7 @@ public:
const TQSize &s,
const TQStyleOption &o) const;
int tqstyleHint(StyleHint, const TQWidget * = 0,
int styleHint(StyleHint, const TQWidget * = 0,
const TQStyleOption & = TQStyleOption::Default,
TQStyleHintReturn * = 0 ) const;

Loading…
Cancel
Save