|
|
@ -421,7 +421,7 @@ void PhaseStyle::drawPhaseTab(TQPainter *painter,
|
|
|
|
edge = false;
|
|
|
|
edge = false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
switch (TQTabBar::Shape(bar->tqshape())) {
|
|
|
|
switch (TQTabBar::Shape(bar->shape())) {
|
|
|
|
case TQTabBar::RoundedAbove:
|
|
|
|
case TQTabBar::RoundedAbove:
|
|
|
|
case TQTabBar::TriangularAbove: {
|
|
|
|
case TQTabBar::TriangularAbove: {
|
|
|
|
// is there a corner widget?
|
|
|
|
// is there a corner widget?
|
|
|
@ -727,8 +727,8 @@ void PhaseStyle::tqdrawPrimitive(TQ_PrimitiveElement element,
|
|
|
|
|
|
|
|
|
|
|
|
case PE_Indicator:
|
|
|
|
case PE_Indicator:
|
|
|
|
drawPhasePanel(painter, x+1, y+1, w-2, h-2, group, true, enabled ?
|
|
|
|
drawPhasePanel(painter, x+1, y+1, w-2, h-2, group, true, enabled ?
|
|
|
|
&group.tqbrush(TQColorGroup::Base) :
|
|
|
|
&group.brush(TQColorGroup::Base) :
|
|
|
|
&group.tqbrush(TQColorGroup::Background));
|
|
|
|
&group.brush(TQColorGroup::Background));
|
|
|
|
|
|
|
|
|
|
|
|
if (on) {
|
|
|
|
if (on) {
|
|
|
|
painter->setPen(mouseover
|
|
|
|
painter->setPen(mouseover
|
|
|
@ -736,7 +736,7 @@ void PhaseStyle::tqdrawPrimitive(TQ_PrimitiveElement element,
|
|
|
|
: group.dark());
|
|
|
|
: group.dark());
|
|
|
|
painter->drawRect(x+4, y+4, w-8, h-8);
|
|
|
|
painter->drawRect(x+4, y+4, w-8, h-8);
|
|
|
|
painter->fillRect(x+5, y+5, w-10, h-10,
|
|
|
|
painter->fillRect(x+5, y+5, w-10, h-10,
|
|
|
|
group.tqbrush(TQColorGroup::Highlight));
|
|
|
|
group.brush(TQColorGroup::Highlight));
|
|
|
|
} else if (mouseover) {
|
|
|
|
} else if (mouseover) {
|
|
|
|
painter->setPen(TQColor(group.highlight().dark(contrast)));
|
|
|
|
painter->setPen(TQColor(group.highlight().dark(contrast)));
|
|
|
|
painter->drawRect(x+4, y+4, w-8, h-8);
|
|
|
|
painter->drawRect(x+4, y+4, w-8, h-8);
|
|
|
@ -749,7 +749,7 @@ void PhaseStyle::tqdrawPrimitive(TQ_PrimitiveElement element,
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case PE_ExclusiveIndicator: {
|
|
|
|
case PE_ExclusiveIndicator: {
|
|
|
|
// note that this requires an even size from tqpixelMetric
|
|
|
|
// note that this requires an even size from pixelMetric
|
|
|
|
cx = (x + x2) / 2;
|
|
|
|
cx = (x + x2) / 2;
|
|
|
|
cy = (y + y2) / 2;
|
|
|
|
cy = (y + y2) / 2;
|
|
|
|
|
|
|
|
|
|
|
@ -761,14 +761,14 @@ void PhaseStyle::tqdrawPrimitive(TQ_PrimitiveElement element,
|
|
|
|
parray.putPoints(0, 8,
|
|
|
|
parray.putPoints(0, 8,
|
|
|
|
x+1,cy+1, x+1,cy, cx,y+1, cx+1,y+1,
|
|
|
|
x+1,cy+1, x+1,cy, cx,y+1, cx+1,y+1,
|
|
|
|
x2-1,cy, x2-1,cy+1, cx+1,y2-1, cx,y2-1);
|
|
|
|
x2-1,cy, x2-1,cy+1, cx+1,y2-1, cx,y2-1);
|
|
|
|
painter->tqdrawConvexPolygon(parray, 0, 8);
|
|
|
|
painter->drawConvexPolygon(parray, 0, 8);
|
|
|
|
|
|
|
|
|
|
|
|
painter->setPen(group.mid());
|
|
|
|
painter->setPen(group.mid());
|
|
|
|
parray.putPoints(0, 4, x,cy, cx,y, cx+1,y, x2,cy);
|
|
|
|
parray.putPoints(0, 4, x,cy, cx,y, cx+1,y, x2,cy);
|
|
|
|
painter->tqdrawPolyline(parray, 0, 4);
|
|
|
|
painter->drawPolyline(parray, 0, 4);
|
|
|
|
painter->setPen(group.midlight());
|
|
|
|
painter->setPen(group.midlight());
|
|
|
|
parray.putPoints(0, 4, x2,cy+1, cx+1,y2, cx,y2, x,cy+1);
|
|
|
|
parray.putPoints(0, 4, x2,cy+1, cx+1,y2, cx,y2, x,cy+1);
|
|
|
|
painter->tqdrawPolyline(parray, 0, 4);
|
|
|
|
painter->drawPolyline(parray, 0, 4);
|
|
|
|
|
|
|
|
|
|
|
|
if (on) {
|
|
|
|
if (on) {
|
|
|
|
painter->setBrush(group.brush(TQColorGroup::Highlight));
|
|
|
|
painter->setBrush(group.brush(TQColorGroup::Highlight));
|
|
|
@ -778,14 +778,14 @@ void PhaseStyle::tqdrawPrimitive(TQ_PrimitiveElement element,
|
|
|
|
parray.putPoints(0, 8,
|
|
|
|
parray.putPoints(0, 8,
|
|
|
|
x+4,cy+1, x+4,cy, cx,y+4, cx+1,y+4,
|
|
|
|
x+4,cy+1, x+4,cy, cx,y+4, cx+1,y+4,
|
|
|
|
x2-4,cy, x2-4,cy+1, cx+1,y2-4, cx,y2-4);
|
|
|
|
x2-4,cy, x2-4,cy+1, cx+1,y2-4, cx,y2-4);
|
|
|
|
painter->tqdrawConvexPolygon(parray, 0, 8);
|
|
|
|
painter->drawConvexPolygon(parray, 0, 8);
|
|
|
|
} else if (mouseover) {
|
|
|
|
} else if (mouseover) {
|
|
|
|
painter->setPen(TQColor(group.highlight().dark(contrast)));
|
|
|
|
painter->setPen(TQColor(group.highlight().dark(contrast)));
|
|
|
|
parray.putPoints(0, 9,
|
|
|
|
parray.putPoints(0, 9,
|
|
|
|
x+4,cy+1, x+4,cy, cx,y+4, cx+1,y+4,
|
|
|
|
x+4,cy+1, x+4,cy, cx,y+4, cx+1,y+4,
|
|
|
|
x2-4,cy, x2-4,cy+1, cx+1,y2-4, cx,y2-4,
|
|
|
|
x2-4,cy, x2-4,cy+1, cx+1,y2-4, cx,y2-4,
|
|
|
|
x+4,cy+1);
|
|
|
|
x+4,cy+1);
|
|
|
|
painter->tqdrawPolyline(parray, 0, 9);
|
|
|
|
painter->drawPolyline(parray, 0, 9);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -798,13 +798,13 @@ void PhaseStyle::tqdrawPrimitive(TQ_PrimitiveElement element,
|
|
|
|
parray.putPoints(0, 8,
|
|
|
|
parray.putPoints(0, 8,
|
|
|
|
x,cy+1, x,cy, cx,y, cx+1,y,
|
|
|
|
x,cy+1, x,cy, cx,y, cx+1,y,
|
|
|
|
x2,cy, x2,cy+1, cx+1,y2, cx,y2);
|
|
|
|
x2,cy, x2,cy+1, cx+1,y2, cx,y2);
|
|
|
|
painter->tqdrawConvexPolygon(parray, 0, 8);
|
|
|
|
painter->drawConvexPolygon(parray, 0, 8);
|
|
|
|
painter->setPen(TQt::color0);
|
|
|
|
painter->setPen(TQt::color0);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case PE_DockWindowResizeHandle:
|
|
|
|
case PE_DockWindowResizeHandle:
|
|
|
|
drawPhasePanel(painter, x, y, w, h, group, false,
|
|
|
|
drawPhasePanel(painter, x, y, w, h, group, false,
|
|
|
|
&group.tqbrush(TQColorGroup::Background));
|
|
|
|
&group.brush(TQColorGroup::Background));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case PE_Splitter:
|
|
|
|
case PE_Splitter:
|
|
|
@ -1095,7 +1095,7 @@ void PhaseStyle::drawKStylePrimitive(KStylePrimitive element,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
drawPhasePanel(painter, x, y, w, h, group, true,
|
|
|
|
drawPhasePanel(painter, x, y, w, h, group, true,
|
|
|
|
&group.tqbrush(TQColorGroup::Mid));
|
|
|
|
&group.brush(TQColorGroup::Mid));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1127,11 +1127,11 @@ void PhaseStyle::drawKStylePrimitive(KStylePrimitive element,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// tqdrawControl()
|
|
|
|
// drawControl()
|
|
|
|
// -------------
|
|
|
|
// -------------
|
|
|
|
// Draw the control
|
|
|
|
// Draw the control
|
|
|
|
|
|
|
|
|
|
|
|
void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
TQPainter *painter,
|
|
|
|
TQPainter *painter,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQRect &rect,
|
|
|
|
const TQRect &rect,
|
|
|
@ -1153,11 +1153,11 @@ void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
switch (element) {
|
|
|
|
switch (element) {
|
|
|
|
case CE_PushButton: {
|
|
|
|
case CE_PushButton: {
|
|
|
|
depress = flags & (Style_Down | Style_On);
|
|
|
|
depress = flags & (Style_Down | Style_On);
|
|
|
|
int bd = tqpixelMetric(PM_ButtonDefaultIndicator, widget) + 1;
|
|
|
|
int bd = pixelMetric(PM_ButtonDefaultIndicator, widget) + 1;
|
|
|
|
|
|
|
|
|
|
|
|
if ((flags & Style_ButtonDefault) && !depress) {
|
|
|
|
if ((flags & Style_ButtonDefault) && !depress) {
|
|
|
|
drawPhasePanel(painter, x, y, w, h, group, true,
|
|
|
|
drawPhasePanel(painter, x, y, w, h, group, true,
|
|
|
|
&group.tqbrush(TQColorGroup::Mid));
|
|
|
|
&group.brush(TQColorGroup::Mid));
|
|
|
|
drawPhaseBevel(painter, x+bd, y+bd, w-bd*2, h-bd*2, group,
|
|
|
|
drawPhaseBevel(painter, x+bd, y+bd, w-bd*2, h-bd*2, group,
|
|
|
|
(widget==hover_)
|
|
|
|
(widget==hover_)
|
|
|
|
? TQColor(group.button().light(contrast))
|
|
|
|
? TQColor(group.button().light(contrast))
|
|
|
@ -1181,7 +1181,7 @@ void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
case CE_PushButtonLabel: {
|
|
|
|
case CE_PushButtonLabel: {
|
|
|
|
const TQPushButton* button = ::tqqt_cast<const TQPushButton*>(widget);
|
|
|
|
const TQPushButton* button = ::tqqt_cast<const TQPushButton*>(widget);
|
|
|
|
if (!button) {
|
|
|
|
if (!button) {
|
|
|
|
KStyle::tqdrawControl(element, painter, widget, rect, group,
|
|
|
|
KStyle::drawControl(element, painter, widget, rect, group,
|
|
|
|
flags, option);
|
|
|
|
flags, option);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1193,7 +1193,7 @@ void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (button->isMenuButton()) { // menu indicator
|
|
|
|
if (button->isMenuButton()) { // menu indicator
|
|
|
|
int dx = tqpixelMetric(PM_MenuButtonIndicator, widget);
|
|
|
|
int dx = pixelMetric(PM_MenuButtonIndicator, widget);
|
|
|
|
tqdrawPrimitive(PE_ArrowDown, painter,
|
|
|
|
tqdrawPrimitive(PE_ArrowDown, painter,
|
|
|
|
TQRect(x+w-dx-2, y+2, dx, h-4),
|
|
|
|
TQRect(x+w-dx-2, y+2, dx, h-4),
|
|
|
|
group, flags, option);
|
|
|
|
group, flags, option);
|
|
|
@ -1232,24 +1232,24 @@ void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
for(int n=0; n<2; n++) {
|
|
|
|
for(int n=0; n<2; n++) {
|
|
|
|
drawItem(painter, TQRect(x+n, y, w, h),
|
|
|
|
drawItem(painter, TQRect(x+n, y, w, h),
|
|
|
|
AlignCenter | ShowPrefix,
|
|
|
|
AlignCenter | ShowPrefix,
|
|
|
|
button->tqcolorGroup(),
|
|
|
|
button->colorGroup(),
|
|
|
|
button->isEnabled(),
|
|
|
|
button->isEnabled(),
|
|
|
|
button->pixmap(),
|
|
|
|
button->pixmap(),
|
|
|
|
button->text(), -1,
|
|
|
|
button->text(), -1,
|
|
|
|
(button->isEnabled()) ?
|
|
|
|
(button->isEnabled()) ?
|
|
|
|
&button->tqcolorGroup().buttonText() :
|
|
|
|
&button->colorGroup().buttonText() :
|
|
|
|
&button->tqcolorGroup().mid());
|
|
|
|
&button->colorGroup().mid());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else { // normal button
|
|
|
|
} else { // normal button
|
|
|
|
drawItem(painter, TQRect(x, y, w, h),
|
|
|
|
drawItem(painter, TQRect(x, y, w, h),
|
|
|
|
AlignCenter | ShowPrefix,
|
|
|
|
AlignCenter | ShowPrefix,
|
|
|
|
button->tqcolorGroup(),
|
|
|
|
button->colorGroup(),
|
|
|
|
button->isEnabled(),
|
|
|
|
button->isEnabled(),
|
|
|
|
button->pixmap(),
|
|
|
|
button->pixmap(),
|
|
|
|
button->text(), -1,
|
|
|
|
button->text(), -1,
|
|
|
|
(button->isEnabled()) ?
|
|
|
|
(button->isEnabled()) ?
|
|
|
|
&button->tqcolorGroup().buttonText() :
|
|
|
|
&button->colorGroup().buttonText() :
|
|
|
|
&button->tqcolorGroup().mid());
|
|
|
|
&button->colorGroup().mid());
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1259,14 +1259,14 @@ void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
const TQButton *b = ::tqqt_cast<const TQButton*>(widget);
|
|
|
|
const TQButton *b = ::tqqt_cast<const TQButton*>(widget);
|
|
|
|
if (!b) return;
|
|
|
|
if (!b) return;
|
|
|
|
|
|
|
|
|
|
|
|
int tqalignment = reverse_ ? AlignRight : AlignLeft;
|
|
|
|
int alignment = reverse_ ? AlignRight : AlignLeft;
|
|
|
|
drawItem(painter, rect, tqalignment | AlignVCenter | ShowPrefix,
|
|
|
|
drawItem(painter, rect, alignment | AlignVCenter | ShowPrefix,
|
|
|
|
group, flags & Style_Enabled, b->pixmap(), b->text());
|
|
|
|
group, flags & Style_Enabled, b->pixmap(), b->text());
|
|
|
|
|
|
|
|
|
|
|
|
// only draw focus if content (forms on html won't)
|
|
|
|
// only draw focus if content (forms on html won't)
|
|
|
|
if ((flags & Style_HasFocus) && ((!b->text().isNull()) || b->pixmap())) {
|
|
|
|
if ((flags & Style_HasFocus) && ((!b->text().isNull()) || b->pixmap())) {
|
|
|
|
tqdrawPrimitive(PE_FocusRect, painter,
|
|
|
|
tqdrawPrimitive(PE_FocusRect, painter,
|
|
|
|
tqvisualRect(subRect(SR_RadioButtonFocusRect,
|
|
|
|
visualRect(subRect(SR_RadioButtonFocusRect,
|
|
|
|
widget), widget),
|
|
|
|
widget), widget),
|
|
|
|
group, flags);
|
|
|
|
group, flags);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1296,7 +1296,7 @@ void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
case CE_MenuBarItem: {
|
|
|
|
case CE_MenuBarItem: {
|
|
|
|
const TQMenuBar *mbar = ::tqqt_cast<const TQMenuBar*>(widget);
|
|
|
|
const TQMenuBar *mbar = ::tqqt_cast<const TQMenuBar*>(widget);
|
|
|
|
if (!mbar) {
|
|
|
|
if (!mbar) {
|
|
|
|
KStyle::tqdrawControl(element, painter, widget, rect, group,
|
|
|
|
KStyle::drawControl(element, painter, widget, rect, group,
|
|
|
|
flags, option);
|
|
|
|
flags, option);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1306,7 +1306,7 @@ void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
if ((flags & Style_Active) && (flags & Style_HasFocus)) {
|
|
|
|
if ((flags & Style_Active) && (flags & Style_HasFocus)) {
|
|
|
|
if (flags & Style_Down) {
|
|
|
|
if (flags & Style_Down) {
|
|
|
|
drawPhasePanel(painter, x, y, w, h, group, true,
|
|
|
|
drawPhasePanel(painter, x, y, w, h, group, true,
|
|
|
|
&group.tqbrush(TQColorGroup::Background));
|
|
|
|
&group.brush(TQColorGroup::Background));
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
drawPhaseBevel(painter, x, y, w, h,
|
|
|
|
drawPhaseBevel(painter, x, y, w, h,
|
|
|
|
group, group.background(),
|
|
|
|
group, group.background(),
|
|
|
@ -1327,7 +1327,7 @@ void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
case CE_PopupMenuItem: {
|
|
|
|
case CE_PopupMenuItem: {
|
|
|
|
const TQPopupMenu *popup = ::tqqt_cast<const TQPopupMenu*>(widget);
|
|
|
|
const TQPopupMenu *popup = ::tqqt_cast<const TQPopupMenu*>(widget);
|
|
|
|
if (!popup) {
|
|
|
|
if (!popup) {
|
|
|
|
KStyle::tqdrawControl(element, painter, widget, rect, group,
|
|
|
|
KStyle::drawControl(element, painter, widget, rect, group,
|
|
|
|
flags, option);
|
|
|
|
flags, option);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1341,7 +1341,7 @@ void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
int tabwidth = option.tabWidth();
|
|
|
|
int tabwidth = option.tabWidth();
|
|
|
|
int checkwidth = option.maxIconWidth();
|
|
|
|
int checkwidth = option.maxIconWidth();
|
|
|
|
bool checkable = popup->isCheckable();
|
|
|
|
bool checkable = popup->isCheckable();
|
|
|
|
bool etchtext = tqstyleHint(SH_EtchDisabledText);
|
|
|
|
bool etchtext = styleHint(SH_EtchDisabledText);
|
|
|
|
active = flags & Style_Active;
|
|
|
|
active = flags & Style_Active;
|
|
|
|
enabled = mi->isEnabled();
|
|
|
|
enabled = mi->isEnabled();
|
|
|
|
TQRect vrect;
|
|
|
|
TQRect vrect;
|
|
|
@ -1380,7 +1380,7 @@ void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
|
|
|
|
|
|
|
|
pixmap = mi->iconSet()->pixmap(TQIconSet::Small, mode);
|
|
|
|
pixmap = mi->iconSet()->pixmap(TQIconSet::Small, mode);
|
|
|
|
TQRect pmrect(0, 0, pixmap.width(), pixmap.height());
|
|
|
|
TQRect pmrect(0, 0, pixmap.width(), pixmap.height());
|
|
|
|
vrect = tqvisualRect(TQRect(x, y, checkwidth, h), rect);
|
|
|
|
vrect = visualRect(TQRect(x, y, checkwidth, h), rect);
|
|
|
|
pmrect.moveCenter(vrect.center());
|
|
|
|
pmrect.moveCenter(vrect.center());
|
|
|
|
painter->drawPixmap(pmrect.topLeft(), pixmap);
|
|
|
|
painter->drawPixmap(pmrect.topLeft(), pixmap);
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1477,7 +1477,7 @@ void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
if (mi->popup()) { // draw submenu arrow
|
|
|
|
if (mi->popup()) { // draw submenu arrow
|
|
|
|
TQ_PrimitiveElement arrow = reverse_ ? PE_ArrowLeft : PE_ArrowRight;
|
|
|
|
TQ_PrimitiveElement arrow = reverse_ ? PE_ArrowLeft : PE_ArrowRight;
|
|
|
|
int dim = (h-2*ITEMFRAME) / 2;
|
|
|
|
int dim = (h-2*ITEMFRAME) / 2;
|
|
|
|
vrect = tqvisualRect(TQRect(x + w - ARROWMARGIN - ITEMFRAME - dim,
|
|
|
|
vrect = visualRect(TQRect(x + w - ARROWMARGIN - ITEMFRAME - dim,
|
|
|
|
y + h / 2 - dim / 2, dim, dim), rect);
|
|
|
|
y + h / 2 - dim / 2, dim, dim), rect);
|
|
|
|
tqdrawPrimitive(arrow, painter, vrect, group,
|
|
|
|
tqdrawPrimitive(arrow, painter, vrect, group,
|
|
|
|
enabled ? Style_Enabled : Style_Default);
|
|
|
|
enabled ? Style_Enabled : Style_Default);
|
|
|
@ -1495,7 +1495,7 @@ void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
drawPhaseTab(painter, x, y, w, h, group, tab, option,
|
|
|
|
drawPhaseTab(painter, x, y, w, h, group, tab, option,
|
|
|
|
flags);
|
|
|
|
flags);
|
|
|
|
} else { // not a tabbar
|
|
|
|
} else { // not a tabbar
|
|
|
|
KStyle::tqdrawControl(element, painter, widget, rect, group,
|
|
|
|
KStyle::drawControl(element, painter, widget, rect, group,
|
|
|
|
flags, option);
|
|
|
|
flags, option);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1504,14 +1504,14 @@ void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
|
|
|
|
|
|
|
|
case CE_ProgressBarGroove: {
|
|
|
|
case CE_ProgressBarGroove: {
|
|
|
|
drawPhasePanel(painter, x, y, w, h, group, true,
|
|
|
|
drawPhasePanel(painter, x, y, w, h, group, true,
|
|
|
|
&group.tqbrush(TQColorGroup::Base));
|
|
|
|
&group.brush(TQColorGroup::Base));
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
case CE_ProgressBarContents: {
|
|
|
|
case CE_ProgressBarContents: {
|
|
|
|
const TQProgressBar* pbar = ::tqqt_cast<const TQProgressBar*>(widget);
|
|
|
|
const TQProgressBar* pbar = ::tqqt_cast<const TQProgressBar*>(widget);
|
|
|
|
if (!pbar) {
|
|
|
|
if (!pbar) {
|
|
|
|
KStyle::tqdrawControl(element, painter, widget, rect, group,
|
|
|
|
KStyle::drawControl(element, painter, widget, rect, group,
|
|
|
|
flags, option);
|
|
|
|
flags, option);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1522,7 +1522,7 @@ void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
|
|
|
|
|
|
|
|
if (!pbar->totalSteps()) {
|
|
|
|
if (!pbar->totalSteps()) {
|
|
|
|
// busy indicator
|
|
|
|
// busy indicator
|
|
|
|
int bar = tqpixelMetric(PM_ProgressBarChunkWidth, widget) + 2;
|
|
|
|
int bar = pixelMetric(PM_ProgressBarChunkWidth, widget) + 2;
|
|
|
|
int progress = pbar->progress() % ((w-bar) * 2);
|
|
|
|
int progress = pbar->progress() % ((w-bar) * 2);
|
|
|
|
if (progress > (w-bar)) progress = 2 * (w-bar) - progress;
|
|
|
|
if (progress > (w-bar)) progress = 2 * (w-bar) - progress;
|
|
|
|
painter->drawRect(x+progress+1, y+1, bar-2, h-2);
|
|
|
|
painter->drawRect(x+progress+1, y+1, bar-2, h-2);
|
|
|
@ -1540,7 +1540,7 @@ void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
case CE_ToolBoxTab: {
|
|
|
|
case CE_ToolBoxTab: {
|
|
|
|
const TQToolBox *box = ::tqqt_cast<const TQToolBox*>(widget);
|
|
|
|
const TQToolBox *box = ::tqqt_cast<const TQToolBox*>(widget);
|
|
|
|
if (!box) {
|
|
|
|
if (!box) {
|
|
|
|
KStyle::tqdrawControl(element, painter, widget, rect, group,
|
|
|
|
KStyle::drawControl(element, painter, widget, rect, group,
|
|
|
|
flags, option);
|
|
|
|
flags, option);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1556,7 +1556,7 @@ void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
if (box->currentItem() && (flags & Style_Selected)) {
|
|
|
|
if (box->currentItem() && (flags & Style_Selected)) {
|
|
|
|
painter->setPen(group.dark());
|
|
|
|
painter->setPen(group.dark());
|
|
|
|
painter->setBrush(box->currentItem()->paletteBackgroundColor());
|
|
|
|
painter->setBrush(box->currentItem()->paletteBackgroundColor());
|
|
|
|
painter->tqdrawConvexPolygon(parray, 0, 6);
|
|
|
|
painter->drawConvexPolygon(parray, 0, 6);
|
|
|
|
painter->setBrush(NoBrush);
|
|
|
|
painter->setBrush(NoBrush);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
painter->setClipRegion(parray, TQPainter::CoordPainter);
|
|
|
|
painter->setClipRegion(parray, TQPainter::CoordPainter);
|
|
|
@ -1564,28 +1564,28 @@ void PhaseStyle::tqdrawControl(TQ_ControlElement element,
|
|
|
|
group.background(),
|
|
|
|
group.background(),
|
|
|
|
false, 0, 0, 0, h*2, false);
|
|
|
|
false, 0, 0, 0, h*2, false);
|
|
|
|
painter->setClipping(false);
|
|
|
|
painter->setClipping(false);
|
|
|
|
painter->tqdrawPolyline(parray, 0, 4);
|
|
|
|
painter->drawPolyline(parray, 0, 4);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
parray.putPoints(0, 4, x,y+1, cx,y+1, rx-2,y2-1, x2,y2-1);
|
|
|
|
parray.putPoints(0, 4, x,y+1, cx,y+1, rx-2,y2-1, x2,y2-1);
|
|
|
|
painter->setPen(group.midlight());
|
|
|
|
painter->setPen(group.midlight());
|
|
|
|
painter->tqdrawPolyline(parray, 0, 4);
|
|
|
|
painter->drawPolyline(parray, 0, 4);
|
|
|
|
|
|
|
|
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::tqdrawControl(element, painter, widget, rect, group,
|
|
|
|
KStyle::drawControl(element, painter, widget, rect, group,
|
|
|
|
flags, option);
|
|
|
|
flags, option);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// tqdrawControlMask()
|
|
|
|
// drawControlMask()
|
|
|
|
// -----------------
|
|
|
|
// -----------------
|
|
|
|
// Draw a bitmask for the element
|
|
|
|
// Draw a bitmask for the element
|
|
|
|
|
|
|
|
|
|
|
|
void PhaseStyle::tqdrawControlMask(TQ_ControlElement element,
|
|
|
|
void PhaseStyle::drawControlMask(TQ_ControlElement element,
|
|
|
|
TQPainter *painter,
|
|
|
|
TQPainter *painter,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQRect &rect,
|
|
|
|
const TQRect &rect,
|
|
|
@ -1598,16 +1598,16 @@ void PhaseStyle::tqdrawControlMask(TQ_ControlElement element,
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::tqdrawControlMask(element, painter, widget, rect, option);
|
|
|
|
KStyle::drawControlMask(element, painter, widget, rect, option);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// tqdrawComplexControl()
|
|
|
|
// drawComplexControl()
|
|
|
|
// --------------------
|
|
|
|
// --------------------
|
|
|
|
// Draw a complex control
|
|
|
|
// Draw a complex control
|
|
|
|
|
|
|
|
|
|
|
|
void PhaseStyle::tqdrawComplexControl(TQ_ComplexControl control,
|
|
|
|
void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
TQPainter *painter,
|
|
|
|
TQPainter *painter,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQRect &rect,
|
|
|
|
const TQRect &rect,
|
|
|
@ -1629,7 +1629,7 @@ void PhaseStyle::tqdrawComplexControl(TQ_ComplexControl control,
|
|
|
|
case CC_ComboBox: {
|
|
|
|
case CC_ComboBox: {
|
|
|
|
const TQComboBox * combo = ::tqqt_cast<const TQComboBox*>(widget);
|
|
|
|
const TQComboBox * combo = ::tqqt_cast<const TQComboBox*>(widget);
|
|
|
|
if (!combo) {
|
|
|
|
if (!combo) {
|
|
|
|
KStyle::tqdrawComplexControl(control, painter, widget, rect, group,
|
|
|
|
KStyle::drawComplexControl(control, painter, widget, rect, group,
|
|
|
|
flags, controls, active, option);
|
|
|
|
flags, controls, active, option);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1641,20 +1641,20 @@ void PhaseStyle::tqdrawComplexControl(TQ_ComplexControl control,
|
|
|
|
: group.button(), sunken);
|
|
|
|
: group.button(), sunken);
|
|
|
|
|
|
|
|
|
|
|
|
if (controls & SC_ComboBoxArrow) { // draw arrow box
|
|
|
|
if (controls & SC_ComboBoxArrow) { // draw arrow box
|
|
|
|
subrect = tqvisualRect(querySubControlMetrics(CC_ComboBox, widget,
|
|
|
|
subrect = visualRect(querySubControlMetrics(CC_ComboBox, widget,
|
|
|
|
SC_ComboBoxArrow), widget);
|
|
|
|
SC_ComboBoxArrow), widget);
|
|
|
|
|
|
|
|
|
|
|
|
subrect.rect(&x, &y, &w, &h);
|
|
|
|
subrect.rect(&x, &y, &w, &h);
|
|
|
|
int slot = TQMAX(h/4, 6) + (h % 2);
|
|
|
|
int slot = TQMAX(h/4, 6) + (h % 2);
|
|
|
|
drawPhasePanel(painter, x+3, y+(h/2)-(slot/2), w-6,
|
|
|
|
drawPhasePanel(painter, x+3, y+(h/2)-(slot/2), w-6,
|
|
|
|
slot, group, true,
|
|
|
|
slot, group, true,
|
|
|
|
sunken ? &group.tqbrush(TQColorGroup::Midlight)
|
|
|
|
sunken ? &group.brush(TQColorGroup::Midlight)
|
|
|
|
: &group.tqbrush(TQColorGroup::Mid));
|
|
|
|
: &group.brush(TQColorGroup::Mid));
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (controls & SC_ComboBoxEditField) { // draw edit box
|
|
|
|
if (controls & SC_ComboBoxEditField) { // draw edit box
|
|
|
|
if (combo->editable()) { // editable box
|
|
|
|
if (combo->editable()) { // editable box
|
|
|
|
subrect = tqvisualRect(querySubControlMetrics(CC_ComboBox,
|
|
|
|
subrect = visualRect(querySubControlMetrics(CC_ComboBox,
|
|
|
|
widget, SC_ComboBoxEditField), widget);
|
|
|
|
widget, SC_ComboBoxEditField), widget);
|
|
|
|
x2 = subrect.right(); y2 = subrect.bottom();
|
|
|
|
x2 = subrect.right(); y2 = subrect.bottom();
|
|
|
|
painter->setPen(group.dark());
|
|
|
|
painter->setPen(group.dark());
|
|
|
@ -1664,7 +1664,7 @@ void PhaseStyle::tqdrawComplexControl(TQ_ComplexControl control,
|
|
|
|
painter->setPen(group.button());
|
|
|
|
painter->setPen(group.button());
|
|
|
|
painter->drawPoint(x2+2, y2);
|
|
|
|
painter->drawPoint(x2+2, y2);
|
|
|
|
} else if (combo->hasFocus()) { // non editable box
|
|
|
|
} else if (combo->hasFocus()) { // non editable box
|
|
|
|
subrect = tqvisualRect(subRect(SR_ComboBoxFocusRect,
|
|
|
|
subrect = visualRect(subRect(SR_ComboBoxFocusRect,
|
|
|
|
combo), widget);
|
|
|
|
combo), widget);
|
|
|
|
tqdrawPrimitive(PE_FocusRect, painter, subrect, group,
|
|
|
|
tqdrawPrimitive(PE_FocusRect, painter, subrect, group,
|
|
|
|
Style_FocusAtBorder,
|
|
|
|
Style_FocusAtBorder,
|
|
|
@ -1680,7 +1680,7 @@ void PhaseStyle::tqdrawComplexControl(TQ_ComplexControl control,
|
|
|
|
// always a three button scrollbar
|
|
|
|
// always a three button scrollbar
|
|
|
|
const TQScrollBar *sb = ::tqqt_cast<const TQScrollBar*>(widget);
|
|
|
|
const TQScrollBar *sb = ::tqqt_cast<const TQScrollBar*>(widget);
|
|
|
|
if (!sb) {
|
|
|
|
if (!sb) {
|
|
|
|
KStyle::tqdrawComplexControl(control, painter, widget, rect, group,
|
|
|
|
KStyle::drawComplexControl(control, painter, widget, rect, group,
|
|
|
|
flags, controls, active, option);
|
|
|
|
flags, controls, active, option);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1777,7 +1777,7 @@ void PhaseStyle::tqdrawComplexControl(TQ_ComplexControl control,
|
|
|
|
case CC_SpinWidget: {
|
|
|
|
case CC_SpinWidget: {
|
|
|
|
const TQSpinWidget *spin = ::tqqt_cast<const TQSpinWidget*>(widget);
|
|
|
|
const TQSpinWidget *spin = ::tqqt_cast<const TQSpinWidget*>(widget);
|
|
|
|
if (!spin) {
|
|
|
|
if (!spin) {
|
|
|
|
KStyle::tqdrawComplexControl(control, painter, widget, rect, group,
|
|
|
|
KStyle::drawComplexControl(control, painter, widget, rect, group,
|
|
|
|
flags, controls, active, option);
|
|
|
|
flags, controls, active, option);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1837,7 +1837,7 @@ void PhaseStyle::tqdrawComplexControl(TQ_ComplexControl control,
|
|
|
|
case CC_ToolButton: {
|
|
|
|
case CC_ToolButton: {
|
|
|
|
const TQToolButton *btn = ::tqqt_cast<const TQToolButton*>(widget);
|
|
|
|
const TQToolButton *btn = ::tqqt_cast<const TQToolButton*>(widget);
|
|
|
|
if (!btn) {
|
|
|
|
if (!btn) {
|
|
|
|
KStyle::tqdrawComplexControl(control, painter, widget, rect, group,
|
|
|
|
KStyle::drawComplexControl(control, painter, widget, rect, group,
|
|
|
|
flags, controls, active, option);
|
|
|
|
flags, controls, active, option);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1905,7 +1905,7 @@ void PhaseStyle::tqdrawComplexControl(TQ_ComplexControl control,
|
|
|
|
// now draw active buttons
|
|
|
|
// now draw active buttons
|
|
|
|
if (down || on) {
|
|
|
|
if (down || on) {
|
|
|
|
drawPhasePanel(painter, x, y, w, h, group, true,
|
|
|
|
drawPhasePanel(painter, x, y, w, h, group, true,
|
|
|
|
&group.tqbrush(TQColorGroup::Button));
|
|
|
|
&group.brush(TQColorGroup::Button));
|
|
|
|
} else if (raised) {
|
|
|
|
} else if (raised) {
|
|
|
|
drawPhaseBevel(painter, x, y, w, h, group, group.button(),
|
|
|
|
drawPhaseBevel(painter, x, y, w, h, group, group.button(),
|
|
|
|
false, !horiz, true);
|
|
|
|
false, !horiz, true);
|
|
|
@ -1915,18 +1915,18 @@ void PhaseStyle::tqdrawComplexControl(TQ_ComplexControl control,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::tqdrawComplexControl(control, painter, widget, rect, group,
|
|
|
|
KStyle::drawComplexControl(control, painter, widget, rect, group,
|
|
|
|
flags, controls, active, option);
|
|
|
|
flags, controls, active, option);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// tqdrawComplexControlMask()
|
|
|
|
// drawComplexControlMask()
|
|
|
|
// ------------------------
|
|
|
|
// ------------------------
|
|
|
|
// Draw a bitmask for the control
|
|
|
|
// Draw a bitmask for the control
|
|
|
|
|
|
|
|
|
|
|
|
void PhaseStyle::tqdrawComplexControlMask(TQ_ComplexControl control,
|
|
|
|
void PhaseStyle::drawComplexControlMask(TQ_ComplexControl control,
|
|
|
|
TQPainter *painter,
|
|
|
|
TQPainter *painter,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQRect &rect,
|
|
|
|
const TQRect &rect,
|
|
|
@ -1941,16 +1941,16 @@ void PhaseStyle::tqdrawComplexControlMask(TQ_ComplexControl control,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::tqdrawComplexControlMask(control,painter,widget,rect,option);
|
|
|
|
KStyle::drawComplexControlMask(control,painter,widget,rect,option);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// tqpixelMetric()
|
|
|
|
// pixelMetric()
|
|
|
|
// -------------
|
|
|
|
// -------------
|
|
|
|
// Get the pixel metric for metric
|
|
|
|
// Get the pixel metric for metric
|
|
|
|
|
|
|
|
|
|
|
|
int PhaseStyle::tqpixelMetric(PixelMetric metric, const TQWidget *widget) const
|
|
|
|
int PhaseStyle::pixelMetric(PixelMetric metric, const TQWidget *widget) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// not using widget's font, so that all metrics are uniform
|
|
|
|
// not using widget's font, so that all metrics are uniform
|
|
|
|
int em = TQMAX(TQApplication::fontMetrics().strikeOutPos() * 3, 17);
|
|
|
|
int em = TQMAX(TQApplication::fontMetrics().strikeOutPos() * 3, 17);
|
|
|
@ -1973,7 +1973,7 @@ int PhaseStyle::tqpixelMetric(PixelMetric metric, const TQWidget *widget) const
|
|
|
|
|
|
|
|
|
|
|
|
case PM_TabBarTabVSpace:
|
|
|
|
case PM_TabBarTabVSpace:
|
|
|
|
if (const TQTabBar *tb = ::tqqt_cast<const TQTabBar*>(widget)) {
|
|
|
|
if (const TQTabBar *tb = ::tqqt_cast<const TQTabBar*>(widget)) {
|
|
|
|
if (tb->tqshape() == TQTabBar::RoundedAbove) {
|
|
|
|
if (tb->shape() == TQTabBar::RoundedAbove) {
|
|
|
|
return 10;
|
|
|
|
return 10;
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
return 6;
|
|
|
|
return 6;
|
|
|
@ -2000,7 +2000,7 @@ int PhaseStyle::tqpixelMetric(PixelMetric metric, const TQWidget *widget) const
|
|
|
|
return em;
|
|
|
|
return em;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return KStyle::tqpixelMetric(metric, widget);
|
|
|
|
return KStyle::pixelMetric(metric, widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2036,7 +2036,7 @@ TQRect PhaseStyle::querySubControlMetrics(TQ_ComplexControl control,
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQRect rect;
|
|
|
|
TQRect rect;
|
|
|
|
|
|
|
|
|
|
|
|
const int fw = tqpixelMetric(PM_DefaultFrameWidth, widget);
|
|
|
|
const int fw = pixelMetric(PM_DefaultFrameWidth, widget);
|
|
|
|
int w = widget->width(), h = widget->height();
|
|
|
|
int w = widget->width(), h = widget->height();
|
|
|
|
int xc;
|
|
|
|
int xc;
|
|
|
|
|
|
|
|
|
|
|
@ -2143,8 +2143,8 @@ TQSize PhaseStyle::tqsizeFromContents(ContentsType contents,
|
|
|
|
return KStyle::tqsizeFromContents(contents, widget, contentsize,
|
|
|
|
return KStyle::tqsizeFromContents(contents, widget, contentsize,
|
|
|
|
option);
|
|
|
|
option);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int margin = tqpixelMetric(PM_ButtonMargin, widget)
|
|
|
|
int margin = pixelMetric(PM_ButtonMargin, widget)
|
|
|
|
+ tqpixelMetric(PM_DefaultFrameWidth, widget) + 4;
|
|
|
|
+ pixelMetric(PM_DefaultFrameWidth, widget) + 4;
|
|
|
|
|
|
|
|
|
|
|
|
w += margin + 6; // add room for bold font
|
|
|
|
w += margin + 6; // add room for bold font
|
|
|
|
h += margin;
|
|
|
|
h += margin;
|
|
|
@ -2167,8 +2167,8 @@ TQSize PhaseStyle::tqsizeFromContents(ContentsType contents,
|
|
|
|
TQMenuItem *item = option.menuItem();
|
|
|
|
TQMenuItem *item = option.menuItem();
|
|
|
|
|
|
|
|
|
|
|
|
if (item->custom()) {
|
|
|
|
if (item->custom()) {
|
|
|
|
w = item->custom()->tqsizeHint().width();
|
|
|
|
w = item->custom()->sizeHint().width();
|
|
|
|
h = item->custom()->tqsizeHint().height();
|
|
|
|
h = item->custom()->sizeHint().height();
|
|
|
|
if (!item->custom()->fullSpan())
|
|
|
|
if (!item->custom()->fullSpan())
|
|
|
|
h += ITEMVMARGIN*2 + ITEMFRAME*2;
|
|
|
|
h += ITEMVMARGIN*2 + ITEMFRAME*2;
|
|
|
|
} else if (item->widget()) { // a menu item that is a widget
|
|
|
|
} else if (item->widget()) { // a menu item that is a widget
|
|
|
@ -2273,17 +2273,17 @@ bool PhaseStyle::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
TQPainter painter(widget);
|
|
|
|
TQPainter painter(widget);
|
|
|
|
if (flatToolbar(toolbar)) {
|
|
|
|
if (flatToolbar(toolbar)) {
|
|
|
|
painter.fillRect(widget->rect(),
|
|
|
|
painter.fillRect(widget->rect(),
|
|
|
|
parent->tqcolorGroup().background());
|
|
|
|
parent->colorGroup().background());
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
drawPhaseGradient(&painter, widget->rect(),
|
|
|
|
drawPhaseGradient(&painter, widget->rect(),
|
|
|
|
parent->tqcolorGroup().background(),
|
|
|
|
parent->colorGroup().background(),
|
|
|
|
!horiz, px, py,
|
|
|
|
!horiz, px, py,
|
|
|
|
prect.width(), prect.height(), true);
|
|
|
|
prect.width(), prect.height(), true);
|
|
|
|
if (horiz && (h==prect.height()-2)) {
|
|
|
|
if (horiz && (h==prect.height()-2)) {
|
|
|
|
painter.setPen(parent->tqcolorGroup().mid());
|
|
|
|
painter.setPen(parent->colorGroup().mid());
|
|
|
|
painter.drawLine(x, h-1, w-1, h-1);
|
|
|
|
painter.drawLine(x, h-1, w-1, h-1);
|
|
|
|
} else if (!horiz && (w==prect.width()-2)) {
|
|
|
|
} else if (!horiz && (w==prect.width()-2)) {
|
|
|
|
painter.setPen(parent->tqcolorGroup().mid());
|
|
|
|
painter.setPen(parent->colorGroup().mid());
|
|
|
|
painter.drawLine(w-1, y, w-1, h-1);
|
|
|
|
painter.drawLine(w-1, y, w-1, h-1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2298,42 +2298,42 @@ bool PhaseStyle::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
TQT_TQRECT_OBJECT(widget->rect()).rect(&x, &y, &w, &h);
|
|
|
|
TQT_TQRECT_OBJECT(widget->rect()).rect(&x, &y, &w, &h);
|
|
|
|
// draw the extension
|
|
|
|
// draw the extension
|
|
|
|
drawPhaseGradient(&painter, widget->rect(),
|
|
|
|
drawPhaseGradient(&painter, widget->rect(),
|
|
|
|
toolbar->tqcolorGroup().background(),
|
|
|
|
toolbar->colorGroup().background(),
|
|
|
|
!horiz, x, y, w-1, h-1, true);
|
|
|
|
!horiz, x, y, w-1, h-1, true);
|
|
|
|
if (horiz) {
|
|
|
|
if (horiz) {
|
|
|
|
painter.setPen(toolbar->tqcolorGroup().dark());
|
|
|
|
painter.setPen(toolbar->colorGroup().dark());
|
|
|
|
painter.drawLine(w-1, 0, w-1, h-1);
|
|
|
|
painter.drawLine(w-1, 0, w-1, h-1);
|
|
|
|
painter.setPen(toolbar->tqcolorGroup().mid());
|
|
|
|
painter.setPen(toolbar->colorGroup().mid());
|
|
|
|
painter.drawLine(w-2, 0, w-2, h-2);
|
|
|
|
painter.drawLine(w-2, 0, w-2, h-2);
|
|
|
|
painter.drawLine(x, h-1, w-2, h-1);
|
|
|
|
painter.drawLine(x, h-1, w-2, h-1);
|
|
|
|
painter.drawLine(x, y, x, h-2);
|
|
|
|
painter.drawLine(x, y, x, h-2);
|
|
|
|
painter.setPen(toolbar->tqcolorGroup().midlight());
|
|
|
|
painter.setPen(toolbar->colorGroup().midlight());
|
|
|
|
painter.drawLine(x+1, y, x+1, h-2);
|
|
|
|
painter.drawLine(x+1, y, x+1, h-2);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
painter.setPen(toolbar->tqcolorGroup().dark());
|
|
|
|
painter.setPen(toolbar->colorGroup().dark());
|
|
|
|
painter.drawLine(0, h-1, w-1, h-1);
|
|
|
|
painter.drawLine(0, h-1, w-1, h-1);
|
|
|
|
painter.setPen(toolbar->tqcolorGroup().mid());
|
|
|
|
painter.setPen(toolbar->colorGroup().mid());
|
|
|
|
painter.drawLine(0, h-2, w-2, h-2);
|
|
|
|
painter.drawLine(0, h-2, w-2, h-2);
|
|
|
|
painter.drawLine(w-1, y, w-1, h-2);
|
|
|
|
painter.drawLine(w-1, y, w-1, h-2);
|
|
|
|
painter.drawLine(x, y, w-2, y);
|
|
|
|
painter.drawLine(x, y, w-2, y);
|
|
|
|
painter.setPen(toolbar->tqcolorGroup().midlight());
|
|
|
|
painter.setPen(toolbar->colorGroup().midlight());
|
|
|
|
painter.drawLine(x, y+1, w-2, y+1);
|
|
|
|
painter.drawLine(x, y+1, w-2, y+1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TQFrame lines (do this guy last)
|
|
|
|
// TQFrame lines (do this guy last)
|
|
|
|
else if (0 != (frame = ::tqqt_cast<TQFrame*>(object))) {
|
|
|
|
else if (0 != (frame = ::tqqt_cast<TQFrame*>(object))) {
|
|
|
|
TQFrame::Shape tqshape = frame->frameShape();
|
|
|
|
TQFrame::Shape shape = frame->frameShape();
|
|
|
|
switch (tqshape) {
|
|
|
|
switch (shape) {
|
|
|
|
case TQFrame::HLine:
|
|
|
|
case TQFrame::HLine:
|
|
|
|
case TQFrame::VLine: {
|
|
|
|
case TQFrame::VLine: {
|
|
|
|
// NOTE: assuming lines have no content
|
|
|
|
// NOTE: assuming lines have no content
|
|
|
|
TQPainter painter(frame);
|
|
|
|
TQPainter painter(frame);
|
|
|
|
TQT_TQRECT_OBJECT(frame->rect()).rect(&x, &y, &w, &h);
|
|
|
|
TQT_TQRECT_OBJECT(frame->rect()).rect(&x, &y, &w, &h);
|
|
|
|
painter.setPen(frame->tqcolorGroup().dark());
|
|
|
|
painter.setPen(frame->colorGroup().dark());
|
|
|
|
if (tqshape == TQFrame::HLine) {
|
|
|
|
if (shape == TQFrame::HLine) {
|
|
|
|
painter.drawLine(0, h/2, w, h/2);
|
|
|
|
painter.drawLine(0, h/2, w, h/2);
|
|
|
|
} else if (tqshape == TQFrame::VLine) {
|
|
|
|
} else if (shape == TQFrame::VLine) {
|
|
|
|
painter.drawLine(w/2, 0, w/2, h);
|
|
|
|
painter.drawLine(w/2, 0, w/2, h);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
@ -2355,12 +2355,12 @@ bool PhaseStyle::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
if (0 != (widget = ::tqqt_cast<TQWidget*>(object)) &&
|
|
|
|
if (0 != (widget = ::tqqt_cast<TQWidget*>(object)) &&
|
|
|
|
widget->isEnabled()) {
|
|
|
|
widget->isEnabled()) {
|
|
|
|
hover_ = widget;
|
|
|
|
hover_ = widget;
|
|
|
|
widget->tqrepaint(false);
|
|
|
|
widget->repaint(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (event->type() == TQEvent::Leave) {
|
|
|
|
} else if (event->type() == TQEvent::Leave) {
|
|
|
|
if (0 != (widget = ::tqqt_cast<TQWidget*>(object))) {
|
|
|
|
if (0 != (widget = ::tqqt_cast<TQWidget*>(object))) {
|
|
|
|
hover_ = 0;
|
|
|
|
hover_ = 0;
|
|
|
|
widget->tqrepaint(false);
|
|
|
|
widget->repaint(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (::tqqt_cast<TQTabBar*>(object)) { // special case for qtabbar
|
|
|
|
} else if (::tqqt_cast<TQTabBar*>(object)) { // special case for qtabbar
|
|
|
@ -2369,13 +2369,13 @@ bool PhaseStyle::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
widget->isEnabled()) {
|
|
|
|
widget->isEnabled()) {
|
|
|
|
hover_ = widget;
|
|
|
|
hover_ = widget;
|
|
|
|
hovertab_ = 0;;
|
|
|
|
hovertab_ = 0;;
|
|
|
|
widget->tqrepaint(false);
|
|
|
|
widget->repaint(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (event->type() == TQEvent::Leave) {
|
|
|
|
} else if (event->type() == TQEvent::Leave) {
|
|
|
|
if (0 != (widget = ::tqqt_cast<TQWidget*>(object))) {
|
|
|
|
if (0 != (widget = ::tqqt_cast<TQWidget*>(object))) {
|
|
|
|
hover_ = 0;
|
|
|
|
hover_ = 0;
|
|
|
|
hovertab_ = 0;;
|
|
|
|
hovertab_ = 0;;
|
|
|
|
widget->tqrepaint(false);
|
|
|
|
widget->repaint(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} else if (event->type() == TQEvent::MouseMove) {
|
|
|
|
} else if (event->type() == TQEvent::MouseMove) {
|
|
|
|
TQTabBar *tabbar;
|
|
|
|
TQTabBar *tabbar;
|
|
|
@ -2385,7 +2385,7 @@ bool PhaseStyle::eventFilter(TQObject *object, TQEvent *event)
|
|
|
|
TQTab *tab = tabbar->selectTab(me->pos());
|
|
|
|
TQTab *tab = tabbar->selectTab(me->pos());
|
|
|
|
if (hovertab_ != tab) {
|
|
|
|
if (hovertab_ != tab) {
|
|
|
|
hovertab_ = tab;
|
|
|
|
hovertab_ = tab;
|
|
|
|
tabbar->tqrepaint(false);
|
|
|
|
tabbar->repaint(false);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|