|
|
@ -1486,12 +1486,12 @@ void TQtCurveStyle::polish(TQWidget *widget)
|
|
|
|
#if 0
|
|
|
|
#if 0
|
|
|
|
//((TQScrollView *)widget)->setMargin(1);
|
|
|
|
//((TQScrollView *)widget)->setMargin(1);
|
|
|
|
|
|
|
|
|
|
|
|
const TQObjectList *tqchildren(widget->tqchildren());
|
|
|
|
const TQObjectList *children(widget->children());
|
|
|
|
|
|
|
|
|
|
|
|
if(tqchildren)
|
|
|
|
if(children)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQObjectList::Iterator it(tqchildren->begin()),
|
|
|
|
TQObjectList::Iterator it(children->begin()),
|
|
|
|
end(tqchildren->end());
|
|
|
|
end(children->end());
|
|
|
|
|
|
|
|
|
|
|
|
for(; it!=end; ++it)
|
|
|
|
for(; it!=end; ++it)
|
|
|
|
if(::tqqt_cast<TQWidget *>(*it))
|
|
|
|
if(::tqqt_cast<TQWidget *>(*it))
|
|
|
@ -2045,7 +2045,7 @@ bool TQtCurveStyle::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
else if (NO_FRAME(opts.groupBox) && TQEvent::Move==event->type() && isCheckBoxOfGroupBox(object))
|
|
|
|
else if (NO_FRAME(opts.groupBox) && TQEvent::Move==event->type() && isCheckBoxOfGroupBox(object))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQCheckBox *cb=static_cast<TQCheckBox *>(TQT_TQWIDGET(object));
|
|
|
|
TQCheckBox *cb=static_cast<TQCheckBox *>(TQT_TQWIDGET(object));
|
|
|
|
TQRect r(cb->tqgeometry());
|
|
|
|
TQRect r(cb->geometry());
|
|
|
|
|
|
|
|
|
|
|
|
cb->removeEventFilter(this);
|
|
|
|
cb->removeEventFilter(this);
|
|
|
|
if(TQApplication::reverseLayout())
|
|
|
|
if(TQApplication::reverseLayout())
|
|
|
@ -2098,8 +2098,8 @@ bool TQtCurveStyle::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
TQRect r(widget->rect());
|
|
|
|
TQRect r(widget->rect());
|
|
|
|
int tbHeight(tb ? tb->height()-1 : 28);
|
|
|
|
int tbHeight(tb ? tb->height()-1 : 28);
|
|
|
|
|
|
|
|
|
|
|
|
if(tb && (TQTabBar::RoundedBelow == tb->tqshape() ||
|
|
|
|
if(tb && (TQTabBar::RoundedBelow == tb->shape() ||
|
|
|
|
TQTabBar::TriangularBelow == tb->tqshape()))
|
|
|
|
TQTabBar::TriangularBelow == tb->shape()))
|
|
|
|
r.addCoords(0, 0, 0, -tbHeight);
|
|
|
|
r.addCoords(0, 0, 0, -tbHeight);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
r.addCoords(0, tbHeight, 0, 0);
|
|
|
|
r.addCoords(0, tbHeight, 0, 0);
|
|
|
@ -2158,11 +2158,11 @@ bool TQtCurveStyle::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
|
|
|
|
|
|
|
|
if (::tqqt_cast<TQSpinWidget*>(widget->parentWidget()))
|
|
|
|
if (::tqqt_cast<TQSpinWidget*>(widget->parentWidget()))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
widget->parentWidget()->tqrepaint(false);
|
|
|
|
widget->parentWidget()->repaint(false);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
widget->tqrepaint(false);
|
|
|
|
widget->repaint(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2209,11 +2209,11 @@ bool TQtCurveStyle::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
case TQEvent::WindowActivate:
|
|
|
|
case TQEvent::WindowActivate:
|
|
|
|
itsActive=true;
|
|
|
|
itsActive=true;
|
|
|
|
((TQWidget *)object)->tqrepaint(false);
|
|
|
|
((TQWidget *)object)->repaint(false);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
case TQEvent::WindowDeactivate:
|
|
|
|
case TQEvent::WindowDeactivate:
|
|
|
|
itsActive=false;
|
|
|
|
itsActive=false;
|
|
|
|
((TQWidget *)object)->tqrepaint(false);
|
|
|
|
((TQWidget *)object)->repaint(false);
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -2362,14 +2362,14 @@ bool TQtCurveStyle::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
case TQEvent::FocusIn:
|
|
|
|
case TQEvent::FocusIn:
|
|
|
|
case TQEvent::FocusOut:
|
|
|
|
case TQEvent::FocusOut:
|
|
|
|
if(opts.highlightScrollViews && object->isWidgetType() && ::tqqt_cast<TQScrollView*>(object))
|
|
|
|
if(opts.highlightScrollViews && object->isWidgetType() && ::tqqt_cast<TQScrollView*>(object))
|
|
|
|
((TQWidget *)object)->tqrepaint(false);
|
|
|
|
((TQWidget *)object)->repaint(false);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQEvent::Hide:
|
|
|
|
case TQEvent::Hide:
|
|
|
|
case TQEvent::Show:
|
|
|
|
case TQEvent::Show:
|
|
|
|
if(::tqqt_cast<TQListBox *>(object) &&
|
|
|
|
if(::tqqt_cast<TQListBox *>(object) &&
|
|
|
|
(((TQListBox *)object)->parentWidget() &&
|
|
|
|
(((TQListBox *)object)->parentWidget() &&
|
|
|
|
::tqqt_cast<TQComboBox *>(((TQListBox *)object)->parentWidget())))
|
|
|
|
::tqqt_cast<TQComboBox *>(((TQListBox *)object)->parentWidget())))
|
|
|
|
((TQComboBox *)(((TQListBox *)object)->parentWidget()))->tqrepaint(false);
|
|
|
|
((TQComboBox *)(((TQListBox *)object)->parentWidget()))->repaint(false);
|
|
|
|
// else if(::tqqt_cast<TQFrame *>(object) &&
|
|
|
|
// else if(::tqqt_cast<TQFrame *>(object) &&
|
|
|
|
// (TQFrame::Box==((TQFrame *)object)->frameShape() || TQFrame::Panel==((TQFrame *)object)->frameShape() ||
|
|
|
|
// (TQFrame::Box==((TQFrame *)object)->frameShape() || TQFrame::Panel==((TQFrame *)object)->frameShape() ||
|
|
|
|
// TQFrame::WinPanel==((TQFrame *)object)->frameShape()))
|
|
|
|
// TQFrame::WinPanel==((TQFrame *)object)->frameShape()))
|
|
|
@ -2385,12 +2385,12 @@ bool TQtCurveStyle::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
if(::tqqt_cast<TQTabBar*>(object) && TQT_TQWIDGET(object)->isEnabled())
|
|
|
|
if(::tqqt_cast<TQTabBar*>(object) && TQT_TQWIDGET(object)->isEnabled())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
itsHoverTab=0L;
|
|
|
|
itsHoverTab=0L;
|
|
|
|
itsHoverWidget->tqrepaint(false);
|
|
|
|
itsHoverWidget->repaint(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(!itsHoverWidget->hasMouseTracking() ||
|
|
|
|
else if(!itsHoverWidget->hasMouseTracking() ||
|
|
|
|
(itsFormMode=isFormWidget(itsHoverWidget)))
|
|
|
|
(itsFormMode=isFormWidget(itsHoverWidget)))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
itsHoverWidget->tqrepaint(false);
|
|
|
|
itsHoverWidget->repaint(false);
|
|
|
|
itsFormMode=false;
|
|
|
|
itsFormMode=false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2405,7 +2405,7 @@ bool TQtCurveStyle::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
if(itsHoverWidget && TQT_BASE_OBJECT(object)==TQT_BASE_OBJECT(itsHoverWidget))
|
|
|
|
if(itsHoverWidget && TQT_BASE_OBJECT(object)==TQT_BASE_OBJECT(itsHoverWidget))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
resetHover();
|
|
|
|
resetHover();
|
|
|
|
((TQWidget *)object)->tqrepaint(false);
|
|
|
|
((TQWidget *)object)->repaint(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case TQEvent::MouseMove: // Only occurs for widgets with mouse tracking enabled
|
|
|
|
case TQEvent::MouseMove: // Only occurs for widgets with mouse tracking enabled
|
|
|
@ -2415,7 +2415,7 @@ bool TQtCurveStyle::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
if(me && itsHoverWidget && object->isWidgetType())
|
|
|
|
if(me && itsHoverWidget && object->isWidgetType())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(!me->pos().isNull() && itsIsSpecialHover && redrawHoverWidget(me->pos()))
|
|
|
|
if(!me->pos().isNull() && itsIsSpecialHover && redrawHoverWidget(me->pos()))
|
|
|
|
itsHoverWidget->tqrepaint(false);
|
|
|
|
itsHoverWidget->repaint(false);
|
|
|
|
itsOldPos=me->pos();
|
|
|
|
itsOldPos=me->pos();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -4515,7 +4515,7 @@ void TQtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQWi
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQRect tr(r);
|
|
|
|
TQRect tr(r);
|
|
|
|
bool top(TQTabBar::TriangularAbove==tb->tqshape() || TQTabBar::RoundedAbove==tb->tqshape());
|
|
|
|
bool top(TQTabBar::TriangularAbove==tb->shape() || TQTabBar::RoundedAbove==tb->shape());
|
|
|
|
|
|
|
|
|
|
|
|
if(active && opts.tabBgnd)
|
|
|
|
if(active && opts.tabBgnd)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -4715,11 +4715,11 @@ void TQtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQWi
|
|
|
|
|
|
|
|
|
|
|
|
if (t->identifier() == tb->currentTab())
|
|
|
|
if (t->identifier() == tb->currentTab())
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if(TQTabBar::RoundedAbove==tb->tqshape() || TQTabBar::TriangularAbove==tb->tqshape())
|
|
|
|
if(TQTabBar::RoundedAbove==tb->shape() || TQTabBar::TriangularAbove==tb->shape())
|
|
|
|
tr.addCoords(0, -shift, 0, -shift);
|
|
|
|
tr.addCoords(0, -shift, 0, -shift);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
if(TQTabBar::RoundedBelow==tb->tqshape() || TQTabBar::TriangularBelow==tb->tqshape())
|
|
|
|
if(TQTabBar::RoundedBelow==tb->shape() || TQTabBar::TriangularBelow==tb->shape())
|
|
|
|
tr.addCoords(0, shift, 0, shift);
|
|
|
|
tr.addCoords(0, shift, 0, shift);
|
|
|
|
|
|
|
|
|
|
|
|
if(APP_MACTOR==itsThemedApp)
|
|
|
|
if(APP_MACTOR==itsThemedApp)
|
|
|
@ -4755,7 +4755,7 @@ void TQtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQWi
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQRect fr(r);
|
|
|
|
TQRect fr(r);
|
|
|
|
|
|
|
|
|
|
|
|
if(TQTabBar::RoundedAbove==tb->tqshape() || TQTabBar::TriangularAbove==tb->tqshape())
|
|
|
|
if(TQTabBar::RoundedAbove==tb->shape() || TQTabBar::TriangularAbove==tb->shape())
|
|
|
|
fr.addCoords(0, 1, 0, -1);
|
|
|
|
fr.addCoords(0, 1, 0, -1);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
fr.addCoords(0, 0, 0, -1);
|
|
|
|
fr.addCoords(0, 0, 0, -1);
|
|
|
@ -5315,9 +5315,9 @@ void TQtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQWi
|
|
|
|
false, opts.selectionAppearance, WIDGET_SELECTION);
|
|
|
|
false, opts.selectionAppearance, WIDGET_SELECTION);
|
|
|
|
p->setClipping(false);
|
|
|
|
p->setClipping(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int tqalignment(TQApplication::reverseLayout() ? AlignRight : AlignLeft);
|
|
|
|
int alignment(TQApplication::reverseLayout() ? AlignRight : AlignLeft);
|
|
|
|
|
|
|
|
|
|
|
|
drawItem(p, r, tqalignment | AlignVCenter | ShowPrefix, cg,
|
|
|
|
drawItem(p, r, alignment | AlignVCenter | ShowPrefix, cg,
|
|
|
|
flags & Style_Enabled, checkbox->pixmap(), checkbox->text());
|
|
|
|
flags & Style_Enabled, checkbox->pixmap(), checkbox->text());
|
|
|
|
|
|
|
|
|
|
|
|
if(checkbox->hasFocus() && FOCUS_GLOW!=opts.focus)
|
|
|
|
if(checkbox->hasFocus() && FOCUS_GLOW!=opts.focus)
|
|
|
@ -5360,9 +5360,9 @@ void TQtCurveStyle::drawControl(ControlElement control, TQPainter *p, const TQWi
|
|
|
|
p->setClipping(false);
|
|
|
|
p->setClipping(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int tqalignment(TQApplication::reverseLayout() ? AlignRight : AlignLeft);
|
|
|
|
int alignment(TQApplication::reverseLayout() ? AlignRight : AlignLeft);
|
|
|
|
|
|
|
|
|
|
|
|
drawItem(p, r, tqalignment | AlignVCenter | ShowPrefix, cg, flags & Style_Enabled,
|
|
|
|
drawItem(p, r, alignment | AlignVCenter | ShowPrefix, cg, flags & Style_Enabled,
|
|
|
|
radiobutton->pixmap(), radiobutton->text());
|
|
|
|
radiobutton->pixmap(), radiobutton->text());
|
|
|
|
|
|
|
|
|
|
|
|
if(radiobutton->hasFocus() && FOCUS_GLOW!=opts.focus)
|
|
|
|
if(radiobutton->hasFocus() && FOCUS_GLOW!=opts.focus)
|
|
|
@ -6319,24 +6319,24 @@ void TQtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, con
|
|
|
|
|
|
|
|
|
|
|
|
if (controls&SC_TitleBarLabel)
|
|
|
|
if (controls&SC_TitleBarLabel)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int tqalignment=AlignVCenter|SingleLine;
|
|
|
|
int alignment=AlignVCenter|SingleLine;
|
|
|
|
bool full=false;
|
|
|
|
bool full=false;
|
|
|
|
|
|
|
|
|
|
|
|
switch(opts.titlebarAlignment)
|
|
|
|
switch(opts.titlebarAlignment)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
case ALIGN_LEFT:
|
|
|
|
case ALIGN_LEFT:
|
|
|
|
tqalignment|=TQt::AlignLeft;
|
|
|
|
alignment|=TQt::AlignLeft;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ALIGN_CENTER:
|
|
|
|
case ALIGN_CENTER:
|
|
|
|
tqalignment|=TQt::AlignHCenter;
|
|
|
|
alignment|=TQt::AlignHCenter;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ALIGN_FULL_CENTER:
|
|
|
|
case ALIGN_FULL_CENTER:
|
|
|
|
tqalignment|=TQt::AlignHCenter;
|
|
|
|
alignment|=TQt::AlignHCenter;
|
|
|
|
full=true;
|
|
|
|
full=true;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case ALIGN_RIGHT:
|
|
|
|
case ALIGN_RIGHT:
|
|
|
|
tqalignment|=TQt::AlignRight;
|
|
|
|
alignment|=TQt::AlignRight;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
TQRect ir(visualRect(querySubControlMetrics(CC_TitleBar, widget, SC_TitleBarLabel), widget)),
|
|
|
|
TQRect ir(visualRect(querySubControlMetrics(CC_TitleBar, widget, SC_TitleBarLabel), widget)),
|
|
|
@ -6354,13 +6354,13 @@ void TQtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, con
|
|
|
|
int textWidth=fm.boundingRect(titleString).width();
|
|
|
|
int textWidth=fm.boundingRect(titleString).width();
|
|
|
|
if(ir.left()>((textRect.width()-textWidth)>>1))
|
|
|
|
if(ir.left()>((textRect.width()-textWidth)>>1))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tqalignment=TQt::AlignVCenter|TQt::AlignLeft;
|
|
|
|
alignment=TQt::AlignVCenter|TQt::AlignLeft;
|
|
|
|
textRect=ir;
|
|
|
|
textRect=ir;
|
|
|
|
full=false;
|
|
|
|
full=false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if(ir.right()<((textRect.width()+textWidth)>>1))
|
|
|
|
else if(ir.right()<((textRect.width()+textWidth)>>1))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tqalignment=TQt::AlignVCenter|TQt::AlignRight;
|
|
|
|
alignment=TQt::AlignVCenter|TQt::AlignRight;
|
|
|
|
textRect=ir;
|
|
|
|
textRect=ir;
|
|
|
|
full=false;
|
|
|
|
full=false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -6369,9 +6369,9 @@ void TQtCurveStyle::drawComplexControl(ComplexControl control, TQPainter *p, con
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
p->setPen(shadowCol);
|
|
|
|
p->setPen(shadowCol);
|
|
|
|
p->drawText(textRect.x()+1, textRect.y()+1, textRect.width(), textRect.height(), tqalignment, titleString);
|
|
|
|
p->drawText(textRect.x()+1, textRect.y()+1, textRect.width(), textRect.height(), alignment, titleString);
|
|
|
|
p->setPen(textCol);
|
|
|
|
p->setPen(textCol);
|
|
|
|
p->drawText(textRect.x(), textRect.y(), textRect.width(), textRect.height(), tqalignment, titleString);
|
|
|
|
p->drawText(textRect.x(), textRect.y(), textRect.width(), textRect.height(), alignment, titleString);
|
|
|
|
if(full)
|
|
|
|
if(full)
|
|
|
|
p->setClipping(false);
|
|
|
|
p->setClipping(false);
|
|
|
|
|
|
|
|
|
|
|
@ -6750,7 +6750,7 @@ int TQtCurveStyle::pixelMetric(PixelMetric metric, const TQWidget *widget) const
|
|
|
|
const TQTabBar *tb=widget ? ::tqqt_cast<const TQTabBar *>(widget) : 0;
|
|
|
|
const TQTabBar *tb=widget ? ::tqqt_cast<const TQTabBar *>(widget) : 0;
|
|
|
|
|
|
|
|
|
|
|
|
return tb
|
|
|
|
return tb
|
|
|
|
? TQTabBar::RoundedAbove==tb->tqshape() || TQTabBar::TriangularAbove==tb->tqshape()
|
|
|
|
? TQTabBar::RoundedAbove==tb->shape() || TQTabBar::TriangularAbove==tb->shape()
|
|
|
|
? 1
|
|
|
|
? 1
|
|
|
|
: -1
|
|
|
|
: -1
|
|
|
|
: BASE_STYLE::pixelMetric(metric, widget);
|
|
|
|
: BASE_STYLE::pixelMetric(metric, widget);
|
|
|
|