|
|
@ -567,12 +567,14 @@ void PhaseStyle::drawPhaseTab(TQPainter *painter,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// tqdrawPrimitive()
|
|
|
|
// drawPrimitive()
|
|
|
|
// ---------------
|
|
|
|
// ---------------
|
|
|
|
// Draw the primitive element
|
|
|
|
// Draw the primitive element
|
|
|
|
|
|
|
|
|
|
|
|
void PhaseStyle::tqdrawPrimitive(TQ_PrimitiveElement element,
|
|
|
|
void PhaseStyle::drawPrimitive(TQ_PrimitiveElement element,
|
|
|
|
TQPainter *painter,
|
|
|
|
TQPainter *painter,
|
|
|
|
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
const TQRect &rect,
|
|
|
|
const TQRect &rect,
|
|
|
|
const TQColorGroup &group,
|
|
|
|
const TQColorGroup &group,
|
|
|
|
SFlags flags,
|
|
|
|
SFlags flags,
|
|
|
@ -663,9 +665,9 @@ void PhaseStyle::tqdrawPrimitive(TQ_PrimitiveElement element,
|
|
|
|
|
|
|
|
|
|
|
|
case PE_HeaderArrow:
|
|
|
|
case PE_HeaderArrow:
|
|
|
|
if (flags & Style_Up)
|
|
|
|
if (flags & Style_Up)
|
|
|
|
tqdrawPrimitive(PE_ArrowUp, painter, rect, group, Style_Enabled);
|
|
|
|
drawPrimitive(PE_ArrowUp, painter, ceData, elementFlags, rect, group, Style_Enabled);
|
|
|
|
else
|
|
|
|
else
|
|
|
|
tqdrawPrimitive(PE_ArrowDown, painter, rect, group, Style_Enabled);
|
|
|
|
drawPrimitive(PE_ArrowDown, painter, ceData, elementFlags, rect, group, Style_Enabled);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
case PE_ScrollBarAddPage:
|
|
|
|
case PE_ScrollBarAddPage:
|
|
|
@ -703,7 +705,7 @@ void PhaseStyle::tqdrawPrimitive(TQ_PrimitiveElement element,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
tqdrawPrimitive(arrow, painter, TQRect(x,y,h,w), group, flags);
|
|
|
|
drawPrimitive(arrow, painter, ceData, elementFlags, TQRect(x,y,h,w), group, flags);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -999,7 +1001,7 @@ void PhaseStyle::tqdrawPrimitive(TQ_PrimitiveElement element,
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::tqdrawPrimitive(element, painter, rect, group, flags, option);
|
|
|
|
KStyle::drawPrimitive(element, painter, ceData, elementFlags, rect, group, flags, option);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1010,11 +1012,13 @@ void PhaseStyle::tqdrawPrimitive(TQ_PrimitiveElement element,
|
|
|
|
|
|
|
|
|
|
|
|
void PhaseStyle::drawKStylePrimitive(KStylePrimitive element,
|
|
|
|
void PhaseStyle::drawKStylePrimitive(KStylePrimitive element,
|
|
|
|
TQPainter *painter,
|
|
|
|
TQPainter *painter,
|
|
|
|
const TQWidget *widget,
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
const TQRect &rect,
|
|
|
|
const TQRect &rect,
|
|
|
|
const TQColorGroup &group,
|
|
|
|
const TQColorGroup &group,
|
|
|
|
SFlags flags,
|
|
|
|
SFlags flags,
|
|
|
|
const TQStyleOption &option) const
|
|
|
|
const TQStyleOption &option,
|
|
|
|
|
|
|
|
const TQWidget *widget) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool horiz = flags & Style_Horizontal;
|
|
|
|
bool horiz = flags & Style_Horizontal;
|
|
|
|
int x, y, w, h, x2, y2, n, cx, cy;
|
|
|
|
int x, y, w, h, x2, y2, n, cx, cy;
|
|
|
@ -1121,8 +1125,8 @@ void PhaseStyle::drawKStylePrimitive(KStylePrimitive element,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::drawKStylePrimitive(element, painter, widget, rect,
|
|
|
|
KStyle::drawKStylePrimitive(element, painter, ceData, elementFlags, rect,
|
|
|
|
group, flags, option);
|
|
|
|
group, flags, option, widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1133,11 +1137,13 @@ void PhaseStyle::drawKStylePrimitive(KStylePrimitive element,
|
|
|
|
|
|
|
|
|
|
|
|
void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
TQPainter *painter,
|
|
|
|
TQPainter *painter,
|
|
|
|
const TQWidget *widget,
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
const TQRect &rect,
|
|
|
|
const TQRect &rect,
|
|
|
|
const TQColorGroup &group,
|
|
|
|
const TQColorGroup &group,
|
|
|
|
SFlags flags,
|
|
|
|
SFlags flags,
|
|
|
|
const TQStyleOption &option) const
|
|
|
|
const TQStyleOption &option,
|
|
|
|
|
|
|
|
const TQWidget *widget) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool active, enabled, depress;
|
|
|
|
bool active, enabled, depress;
|
|
|
|
int x, y, w, h, x2, y2, dx;
|
|
|
|
int x, y, w, h, x2, y2, dx;
|
|
|
@ -1153,7 +1159,7 @@ void PhaseStyle::drawControl(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 = pixelMetric(PM_ButtonDefaultIndicator, widget) + 1;
|
|
|
|
int bd = pixelMetric(PM_ButtonDefaultIndicator, ceData, elementFlags, 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,
|
|
|
@ -1171,8 +1177,8 @@ void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (flags & Style_HasFocus) { // draw focus
|
|
|
|
if (flags & Style_HasFocus) { // draw focus
|
|
|
|
tqdrawPrimitive(PE_FocusRect, painter,
|
|
|
|
drawPrimitive(PE_FocusRect, painter, ceData, elementFlags,
|
|
|
|
subRect(SR_PushButtonFocusRect, widget),
|
|
|
|
subRect(SR_PushButtonFocusRect, ceData, elementFlags, widget),
|
|
|
|
group, flags);
|
|
|
|
group, flags);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -1181,8 +1187,8 @@ void PhaseStyle::drawControl(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::drawControl(element, painter, widget, rect, group,
|
|
|
|
KStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
flags, option);
|
|
|
|
flags, option, widget);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
active = button->isOn() || button->isDown();
|
|
|
|
active = button->isOn() || button->isDown();
|
|
|
@ -1193,8 +1199,8 @@ void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
if (button->isMenuButton()) { // menu indicator
|
|
|
|
if (button->isMenuButton()) { // menu indicator
|
|
|
|
int dx = pixelMetric(PM_MenuButtonIndicator, widget);
|
|
|
|
int dx = pixelMetric(PM_MenuButtonIndicator, ceData, elementFlags, widget);
|
|
|
|
tqdrawPrimitive(PE_ArrowDown, painter,
|
|
|
|
drawPrimitive(PE_ArrowDown, painter, ceData, elementFlags,
|
|
|
|
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);
|
|
|
|
w -= dx;
|
|
|
|
w -= dx;
|
|
|
@ -1265,9 +1271,9 @@ void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
|
|
|
|
|
|
|
|
// 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,
|
|
|
|
drawPrimitive(PE_FocusRect, painter, ceData, elementFlags,
|
|
|
|
visualRect(subRect(SR_RadioButtonFocusRect,
|
|
|
|
visualRect(subRect(SR_RadioButtonFocusRect, ceData, elementFlags,
|
|
|
|
widget), widget),
|
|
|
|
widget), ceData, elementFlags),
|
|
|
|
group, flags);
|
|
|
|
group, flags);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -1296,8 +1302,8 @@ void PhaseStyle::drawControl(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::drawControl(element, painter, widget, rect, group,
|
|
|
|
KStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
flags, option);
|
|
|
|
flags, option, widget);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
mi = option.menuItem();
|
|
|
|
mi = option.menuItem();
|
|
|
@ -1327,8 +1333,8 @@ void PhaseStyle::drawControl(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::drawControl(element, painter, widget, rect, group,
|
|
|
|
KStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
flags, option);
|
|
|
|
flags, option, widget);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1341,7 +1347,7 @@ void PhaseStyle::drawControl(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 = styleHint(SH_EtchDisabledText);
|
|
|
|
bool etchtext = styleHint(SH_EtchDisabledText, ceData, elementFlags);
|
|
|
|
active = flags & Style_Active;
|
|
|
|
active = flags & Style_Active;
|
|
|
|
enabled = mi->isEnabled();
|
|
|
|
enabled = mi->isEnabled();
|
|
|
|
TQRect vrect;
|
|
|
|
TQRect vrect;
|
|
|
@ -1388,7 +1394,7 @@ void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
// draw check
|
|
|
|
// draw check
|
|
|
|
if (mi->isChecked()) {
|
|
|
|
if (mi->isChecked()) {
|
|
|
|
int cx = reverse_ ? x+w - checkwidth : x;
|
|
|
|
int cx = reverse_ ? x+w - checkwidth : x;
|
|
|
|
tqdrawPrimitive(PE_CheckMark, painter,
|
|
|
|
drawPrimitive(PE_CheckMark, painter, ceData, elementFlags,
|
|
|
|
TQRect(cx + ITEMFRAME, y + ITEMFRAME,
|
|
|
|
TQRect(cx + ITEMFRAME, y + ITEMFRAME,
|
|
|
|
checkwidth - ITEMFRAME*2, h - ITEMFRAME*2),
|
|
|
|
checkwidth - ITEMFRAME*2, h - ITEMFRAME*2),
|
|
|
|
group, Style_Default |
|
|
|
|
group, Style_Default |
|
|
|
@ -1479,7 +1485,7 @@ void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
int dim = (h-2*ITEMFRAME) / 2;
|
|
|
|
int dim = (h-2*ITEMFRAME) / 2;
|
|
|
|
vrect = visualRect(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,
|
|
|
|
drawPrimitive(arrow, painter, ceData, elementFlags, vrect, group,
|
|
|
|
enabled ? Style_Enabled : Style_Default);
|
|
|
|
enabled ? Style_Enabled : Style_Default);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -1495,8 +1501,8 @@ void PhaseStyle::drawControl(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::drawControl(element, painter, widget, rect, group,
|
|
|
|
KStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
flags, option);
|
|
|
|
flags, option, widget);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -1511,18 +1517,18 @@ void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
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::drawControl(element, painter, widget, rect, group,
|
|
|
|
KStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
flags, option);
|
|
|
|
flags, option, widget);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
subRect(SR_ProgressBarContents, widget).rect(&x, &y, &w, &h);
|
|
|
|
subRect(SR_ProgressBarContents, ceData, elementFlags, widget).rect(&x, &y, &w, &h);
|
|
|
|
|
|
|
|
|
|
|
|
painter->setBrush(group.brush(TQColorGroup::Highlight));
|
|
|
|
painter->setBrush(group.brush(TQColorGroup::Highlight));
|
|
|
|
painter->setPen(group.dark());
|
|
|
|
painter->setPen(group.dark());
|
|
|
|
|
|
|
|
|
|
|
|
if (!pbar->totalSteps()) {
|
|
|
|
if (!pbar->totalSteps()) {
|
|
|
|
// busy indicator
|
|
|
|
// busy indicator
|
|
|
|
int bar = pixelMetric(PM_ProgressBarChunkWidth, widget) + 2;
|
|
|
|
int bar = pixelMetric(PM_ProgressBarChunkWidth, ceData, elementFlags, 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,8 +1546,8 @@ void PhaseStyle::drawControl(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::drawControl(element, painter, widget, rect, group,
|
|
|
|
KStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
flags, option);
|
|
|
|
flags, option, widget);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1575,8 +1581,8 @@ void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::drawControl(element, painter, widget, rect, group,
|
|
|
|
KStyle::drawControl(element, painter, ceData, elementFlags, rect, group,
|
|
|
|
flags, option);
|
|
|
|
flags, option, widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1587,9 +1593,11 @@ void PhaseStyle::drawControl(TQ_ControlElement element,
|
|
|
|
|
|
|
|
|
|
|
|
void PhaseStyle::drawControlMask(TQ_ControlElement element,
|
|
|
|
void PhaseStyle::drawControlMask(TQ_ControlElement element,
|
|
|
|
TQPainter *painter,
|
|
|
|
TQPainter *painter,
|
|
|
|
const TQWidget *widget,
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
const TQRect &rect,
|
|
|
|
const TQRect &rect,
|
|
|
|
const TQStyleOption &option) const
|
|
|
|
const TQStyleOption &option,
|
|
|
|
|
|
|
|
const TQWidget *widget) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (element) {
|
|
|
|
switch (element) {
|
|
|
|
case CE_PushButton:
|
|
|
|
case CE_PushButton:
|
|
|
@ -1598,7 +1606,7 @@ void PhaseStyle::drawControlMask(TQ_ControlElement element,
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::drawControlMask(element, painter, widget, rect, option);
|
|
|
|
KStyle::drawControlMask(element, painter, ceData, elementFlags, rect, option, widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1609,13 +1617,15 @@ void PhaseStyle::drawControlMask(TQ_ControlElement element,
|
|
|
|
|
|
|
|
|
|
|
|
void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
TQPainter *painter,
|
|
|
|
TQPainter *painter,
|
|
|
|
const TQWidget *widget,
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
const TQRect &rect,
|
|
|
|
const TQRect &rect,
|
|
|
|
const TQColorGroup &group,
|
|
|
|
const TQColorGroup &group,
|
|
|
|
SFlags flags,
|
|
|
|
SFlags flags,
|
|
|
|
SCFlags controls,
|
|
|
|
SCFlags controls,
|
|
|
|
SCFlags active,
|
|
|
|
SCFlags active,
|
|
|
|
const TQStyleOption &option) const
|
|
|
|
const TQStyleOption &option,
|
|
|
|
|
|
|
|
const TQWidget *widget) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
bool down = flags & Style_Down;
|
|
|
|
bool down = flags & Style_Down;
|
|
|
|
bool on = flags & Style_On;
|
|
|
|
bool on = flags & Style_On;
|
|
|
@ -1629,8 +1639,8 @@ void PhaseStyle::drawComplexControl(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::drawComplexControl(control, painter, widget, rect, group,
|
|
|
|
KStyle::drawComplexControl(control, painter, ceData, elementFlags, rect, group,
|
|
|
|
flags, controls, active, option);
|
|
|
|
flags, controls, active, option, widget);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1641,8 +1651,8 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
: group.button(), sunken);
|
|
|
|
: group.button(), sunken);
|
|
|
|
|
|
|
|
|
|
|
|
if (controls & SC_ComboBoxArrow) { // draw arrow box
|
|
|
|
if (controls & SC_ComboBoxArrow) { // draw arrow box
|
|
|
|
subrect = visualRect(querySubControlMetrics(CC_ComboBox, widget,
|
|
|
|
subrect = visualRect(querySubControlMetrics(CC_ComboBox, ceData, elementFlags,
|
|
|
|
SC_ComboBoxArrow), widget);
|
|
|
|
SC_ComboBoxArrow, TQStyleOption::Default, widget), ceData, elementFlags);
|
|
|
|
|
|
|
|
|
|
|
|
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);
|
|
|
@ -1655,7 +1665,7 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
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 = visualRect(querySubControlMetrics(CC_ComboBox,
|
|
|
|
subrect = visualRect(querySubControlMetrics(CC_ComboBox,
|
|
|
|
widget, SC_ComboBoxEditField), widget);
|
|
|
|
ceData, elementFlags, SC_ComboBoxEditField, TQStyleOption::Default, widget), ceData, elementFlags);
|
|
|
|
x2 = subrect.right(); y2 = subrect.bottom();
|
|
|
|
x2 = subrect.right(); y2 = subrect.bottom();
|
|
|
|
painter->setPen(group.dark());
|
|
|
|
painter->setPen(group.dark());
|
|
|
|
painter->drawLine(x2+1, y, x2+1, y2);
|
|
|
|
painter->drawLine(x2+1, y, x2+1, y2);
|
|
|
@ -1664,9 +1674,9 @@ void PhaseStyle::drawComplexControl(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 = visualRect(subRect(SR_ComboBoxFocusRect,
|
|
|
|
subrect = visualRect(subRect(SR_ComboBoxFocusRect, ceData, elementFlags,
|
|
|
|
combo), widget);
|
|
|
|
combo), ceData, elementFlags);
|
|
|
|
tqdrawPrimitive(PE_FocusRect, painter, subrect, group,
|
|
|
|
drawPrimitive(PE_FocusRect, painter, ceData, elementFlags, subrect, group,
|
|
|
|
Style_FocusAtBorder,
|
|
|
|
Style_FocusAtBorder,
|
|
|
|
TQStyleOption(group.highlight()));
|
|
|
|
TQStyleOption(group.highlight()));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1680,8 +1690,8 @@ void PhaseStyle::drawComplexControl(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::drawComplexControl(control, painter, widget, rect, group,
|
|
|
|
KStyle::drawComplexControl(control, painter, ceData, elementFlags, rect, group,
|
|
|
|
flags, controls, active, option);
|
|
|
|
flags, controls, active, option, widget);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1694,10 +1704,10 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
|
|
|
|
|
|
|
|
// addline
|
|
|
|
// addline
|
|
|
|
if (controls & SC_ScrollBarAddLine) {
|
|
|
|
if (controls & SC_ScrollBarAddLine) {
|
|
|
|
srect = querySubControlMetrics(control, widget,
|
|
|
|
srect = querySubControlMetrics(control, ceData, elementFlags,
|
|
|
|
SC_ScrollBarAddLine, option);
|
|
|
|
SC_ScrollBarAddLine, option, widget);
|
|
|
|
if (srect.isValid())
|
|
|
|
if (srect.isValid())
|
|
|
|
tqdrawPrimitive(PE_ScrollBarAddLine, painter, srect, group,
|
|
|
|
drawPrimitive(PE_ScrollBarAddLine, painter, ceData, elementFlags, srect, group,
|
|
|
|
scrollflags | ((active == SC_ScrollBarAddLine)
|
|
|
|
scrollflags | ((active == SC_ScrollBarAddLine)
|
|
|
|
? Style_Down : Style_Default));
|
|
|
|
? Style_Down : Style_Default));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1705,19 +1715,19 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
// subline (two of them)
|
|
|
|
// subline (two of them)
|
|
|
|
if (controls & SC_ScrollBarSubLine) {
|
|
|
|
if (controls & SC_ScrollBarSubLine) {
|
|
|
|
// top/left subline
|
|
|
|
// top/left subline
|
|
|
|
srect = querySubControlMetrics(control, widget,
|
|
|
|
srect = querySubControlMetrics(control, ceData, elementFlags,
|
|
|
|
SC_ScrollBarSubLine, option);
|
|
|
|
SC_ScrollBarSubLine, option, widget);
|
|
|
|
if (srect.isValid())
|
|
|
|
if (srect.isValid())
|
|
|
|
tqdrawPrimitive(PE_ScrollBarSubLine, painter, srect, group,
|
|
|
|
drawPrimitive(PE_ScrollBarSubLine, painter, ceData, elementFlags, srect, group,
|
|
|
|
scrollflags | ((active == SC_ScrollBarSubLine)
|
|
|
|
scrollflags | ((active == SC_ScrollBarSubLine)
|
|
|
|
? Style_Down : Style_Default));
|
|
|
|
? Style_Down : Style_Default));
|
|
|
|
// bottom/right subline
|
|
|
|
// bottom/right subline
|
|
|
|
srect = querySubControlMetrics(control, widget,
|
|
|
|
srect = querySubControlMetrics(control, ceData, elementFlags,
|
|
|
|
SC_ScrollBarAddLine, option);
|
|
|
|
SC_ScrollBarAddLine, option, widget);
|
|
|
|
if (srect.isValid()) {
|
|
|
|
if (srect.isValid()) {
|
|
|
|
if (horizontal) srect.moveBy(-srect.width()+1, 0);
|
|
|
|
if (horizontal) srect.moveBy(-srect.width()+1, 0);
|
|
|
|
else srect.moveBy(0, -srect.height()+1);
|
|
|
|
else srect.moveBy(0, -srect.height()+1);
|
|
|
|
tqdrawPrimitive(PE_ScrollBarSubLine, painter, srect, group,
|
|
|
|
drawPrimitive(PE_ScrollBarSubLine, painter, ceData, elementFlags, srect, group,
|
|
|
|
scrollflags | ((active == SC_ScrollBarSubLine)
|
|
|
|
scrollflags | ((active == SC_ScrollBarSubLine)
|
|
|
|
? Style_Down : Style_Default));
|
|
|
|
? Style_Down : Style_Default));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1725,12 +1735,12 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
|
|
|
|
|
|
|
|
// addpage
|
|
|
|
// addpage
|
|
|
|
if (controls & SC_ScrollBarAddPage) {
|
|
|
|
if (controls & SC_ScrollBarAddPage) {
|
|
|
|
srect = querySubControlMetrics(control, widget,
|
|
|
|
srect = querySubControlMetrics(control, ceData, elementFlags,
|
|
|
|
SC_ScrollBarAddPage, option);
|
|
|
|
SC_ScrollBarAddPage, option, widget);
|
|
|
|
if (srect.isValid()) {
|
|
|
|
if (srect.isValid()) {
|
|
|
|
if (horizontal) srect.addCoords(1, 0, 1, 0);
|
|
|
|
if (horizontal) srect.addCoords(1, 0, 1, 0);
|
|
|
|
else srect.addCoords(0, 1, 0, 1);
|
|
|
|
else srect.addCoords(0, 1, 0, 1);
|
|
|
|
tqdrawPrimitive(PE_ScrollBarAddPage, painter, srect, group,
|
|
|
|
drawPrimitive(PE_ScrollBarAddPage, painter, ceData, elementFlags, srect, group,
|
|
|
|
scrollflags | ((active == SC_ScrollBarAddPage)
|
|
|
|
scrollflags | ((active == SC_ScrollBarAddPage)
|
|
|
|
? Style_Down : Style_Default));
|
|
|
|
? Style_Down : Style_Default));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1738,10 +1748,10 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
|
|
|
|
|
|
|
|
// subpage
|
|
|
|
// subpage
|
|
|
|
if (controls & SC_ScrollBarSubPage) {
|
|
|
|
if (controls & SC_ScrollBarSubPage) {
|
|
|
|
srect = querySubControlMetrics(control, widget,
|
|
|
|
srect = querySubControlMetrics(control, ceData, elementFlags,
|
|
|
|
SC_ScrollBarSubPage, option);
|
|
|
|
SC_ScrollBarSubPage, option, widget);
|
|
|
|
if (srect.isValid()) {
|
|
|
|
if (srect.isValid()) {
|
|
|
|
tqdrawPrimitive(PE_ScrollBarSubPage, painter, srect, group,
|
|
|
|
drawPrimitive(PE_ScrollBarSubPage, painter, ceData, elementFlags, srect, group,
|
|
|
|
scrollflags | ((active == SC_ScrollBarSubPage)
|
|
|
|
scrollflags | ((active == SC_ScrollBarSubPage)
|
|
|
|
? Style_Down : Style_Default));
|
|
|
|
? Style_Down : Style_Default));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1751,22 +1761,22 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
if (controls & SC_ScrollBarSlider) {
|
|
|
|
if (controls & SC_ScrollBarSlider) {
|
|
|
|
if (sb->minValue() == sb->maxValue()) {
|
|
|
|
if (sb->minValue() == sb->maxValue()) {
|
|
|
|
// maxed out
|
|
|
|
// maxed out
|
|
|
|
srect = querySubControlMetrics(control, widget,
|
|
|
|
srect = querySubControlMetrics(control, ceData, elementFlags,
|
|
|
|
SC_ScrollBarGroove, option);
|
|
|
|
SC_ScrollBarGroove, option, widget);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
srect = querySubControlMetrics(control, widget,
|
|
|
|
srect = querySubControlMetrics(control, ceData, elementFlags,
|
|
|
|
SC_ScrollBarSlider, option);
|
|
|
|
SC_ScrollBarSlider, option, widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if (srect.isValid()) {
|
|
|
|
if (srect.isValid()) {
|
|
|
|
if (horizontal) srect.addCoords(0, 0, 1, 0);
|
|
|
|
if (horizontal) srect.addCoords(0, 0, 1, 0);
|
|
|
|
else srect.addCoords(0, 0, 0, 1);
|
|
|
|
else srect.addCoords(0, 0, 0, 1);
|
|
|
|
tqdrawPrimitive(PE_ScrollBarSlider, painter, srect, group,
|
|
|
|
drawPrimitive(PE_ScrollBarSlider, painter, ceData, elementFlags, srect, group,
|
|
|
|
scrollflags | ((active == SC_ScrollBarSlider)
|
|
|
|
scrollflags | ((active == SC_ScrollBarSlider)
|
|
|
|
? Style_Down : Style_Default));
|
|
|
|
? Style_Down : Style_Default));
|
|
|
|
// focus
|
|
|
|
// focus
|
|
|
|
if (sb->hasFocus()) {
|
|
|
|
if (sb->hasFocus()) {
|
|
|
|
srect.addCoords(2, 2, -2, -2);
|
|
|
|
srect.addCoords(2, 2, -2, -2);
|
|
|
|
tqdrawPrimitive(PE_FocusRect, painter, srect, group,
|
|
|
|
drawPrimitive(PE_FocusRect, painter, ceData, elementFlags, srect, group,
|
|
|
|
Style_Default);
|
|
|
|
Style_Default);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1777,8 +1787,8 @@ void PhaseStyle::drawComplexControl(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::drawComplexControl(control, painter, widget, rect, group,
|
|
|
|
KStyle::drawComplexControl(control, painter, ceData, elementFlags, rect, group,
|
|
|
|
flags, controls, active, option);
|
|
|
|
flags, controls, active, option, widget);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1791,9 +1801,9 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
|
|
|
|
|
|
|
|
// draw button field
|
|
|
|
// draw button field
|
|
|
|
if (controls & SC_SpinWidgetButtonField) {
|
|
|
|
if (controls & SC_SpinWidgetButtonField) {
|
|
|
|
subrect = querySubControlMetrics(CC_SpinWidget, widget,
|
|
|
|
subrect = querySubControlMetrics(CC_SpinWidget, ceData, elementFlags,
|
|
|
|
SC_SpinWidgetButtonField,
|
|
|
|
SC_SpinWidgetButtonField,
|
|
|
|
option);
|
|
|
|
option, widget);
|
|
|
|
if (reverse_) subrect.moveLeft(spin->upRect().left());
|
|
|
|
if (reverse_) subrect.moveLeft(spin->upRect().left());
|
|
|
|
drawPhaseBevel(painter, subrect.x(), subrect.y(),
|
|
|
|
drawPhaseBevel(painter, subrect.x(), subrect.y(),
|
|
|
|
subrect.width(), subrect.height(), group,
|
|
|
|
subrect.width(), subrect.height(), group,
|
|
|
@ -1812,7 +1822,7 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
else
|
|
|
|
else
|
|
|
|
element = PE_SpinWidgetUp;
|
|
|
|
element = PE_SpinWidgetUp;
|
|
|
|
|
|
|
|
|
|
|
|
tqdrawPrimitive(element, painter, subrect, group, flags
|
|
|
|
drawPrimitive(element, painter, ceData, elementFlags, subrect, group, flags
|
|
|
|
| ((active == SC_SpinWidgetUp)
|
|
|
|
| ((active == SC_SpinWidgetUp)
|
|
|
|
? Style_On | Style_Sunken : Style_Raised));
|
|
|
|
? Style_On | Style_Sunken : Style_Raised));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1827,7 +1837,7 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
else
|
|
|
|
else
|
|
|
|
element = PE_SpinWidgetDown;
|
|
|
|
element = PE_SpinWidgetDown;
|
|
|
|
|
|
|
|
|
|
|
|
tqdrawPrimitive(element, painter, subrect, group, flags
|
|
|
|
drawPrimitive(element, painter, ceData, elementFlags, subrect, group, flags
|
|
|
|
| ((active == SC_SpinWidgetDown)
|
|
|
|
| ((active == SC_SpinWidgetDown)
|
|
|
|
? Style_On | Style_Sunken : Style_Raised));
|
|
|
|
? Style_On | Style_Sunken : Style_Raised));
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1837,8 +1847,8 @@ void PhaseStyle::drawComplexControl(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::drawComplexControl(control, painter, widget, rect, group,
|
|
|
|
KStyle::drawComplexControl(control, painter, ceData, elementFlags, rect, group,
|
|
|
|
flags, controls, active, option);
|
|
|
|
flags, controls, active, option, widget);
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1915,8 +1925,8 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::drawComplexControl(control, painter, widget, rect, group,
|
|
|
|
KStyle::drawComplexControl(control, painter, ceData, elementFlags, rect, group,
|
|
|
|
flags, controls, active, option);
|
|
|
|
flags, controls, active, option, widget);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1928,9 +1938,11 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
|
|
|
|
|
|
|
|
void PhaseStyle::drawComplexControlMask(TQ_ComplexControl control,
|
|
|
|
void PhaseStyle::drawComplexControlMask(TQ_ComplexControl control,
|
|
|
|
TQPainter *painter,
|
|
|
|
TQPainter *painter,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQStyleControlElementData ceData,
|
|
|
|
|
|
|
|
const ControlElementFlags elementFlags,
|
|
|
|
const TQRect &rect,
|
|
|
|
const TQRect &rect,
|
|
|
|
const TQStyleOption &option) const
|
|
|
|
const TQStyleOption &option,
|
|
|
|
|
|
|
|
const TQWidget *widget) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (control) {
|
|
|
|
switch (control) {
|
|
|
|
case CC_ComboBox:
|
|
|
|
case CC_ComboBox:
|
|
|
@ -1941,7 +1953,7 @@ void PhaseStyle::drawComplexControlMask(TQ_ComplexControl control,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::drawComplexControlMask(control,painter,widget,rect,option);
|
|
|
|
KStyle::drawComplexControlMask(control,painter,ceData,elementFlags,rect,option,widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1950,7 +1962,7 @@ void PhaseStyle::drawComplexControlMask(TQ_ComplexControl control,
|
|
|
|
// -------------
|
|
|
|
// -------------
|
|
|
|
// Get the pixel metric for metric
|
|
|
|
// Get the pixel metric for metric
|
|
|
|
|
|
|
|
|
|
|
|
int PhaseStyle::pixelMetric(PixelMetric metric, const TQWidget *widget) const
|
|
|
|
int PhaseStyle::pixelMetric(PixelMetric metric, TQStyleControlElementData ceData, ControlElementFlags elementFlags, 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);
|
|
|
@ -2000,7 +2012,7 @@ int PhaseStyle::pixelMetric(PixelMetric metric, const TQWidget *widget) const
|
|
|
|
return em;
|
|
|
|
return em;
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return KStyle::pixelMetric(metric, widget);
|
|
|
|
return KStyle::pixelMetric(metric, ceData, elementFlags, widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2009,18 +2021,18 @@ int PhaseStyle::pixelMetric(PixelMetric metric, const TQWidget *widget) const
|
|
|
|
// ---------
|
|
|
|
// ---------
|
|
|
|
// Return subrect for the widget in logical coordinates
|
|
|
|
// Return subrect for the widget in logical coordinates
|
|
|
|
|
|
|
|
|
|
|
|
TQRect PhaseStyle::subRect(SubRect rect, const TQWidget *widget) const
|
|
|
|
TQRect PhaseStyle::subRect(SubRect rect, const TQStyleControlElementData ceData, const ControlElementFlags elementFlags, const TQWidget *widget) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (rect) {
|
|
|
|
switch (rect) {
|
|
|
|
case SR_ComboBoxFocusRect: {
|
|
|
|
case SR_ComboBoxFocusRect: {
|
|
|
|
TQRect r = querySubControlMetrics(CC_ComboBox, widget,
|
|
|
|
TQRect r = querySubControlMetrics(CC_ComboBox, ceData, elementFlags,
|
|
|
|
SC_ComboBoxEditField);
|
|
|
|
SC_ComboBoxEditField, TQStyleOption::Default, widget);
|
|
|
|
r.addCoords(1, 1,-1,-1);
|
|
|
|
r.addCoords(1, 1,-1,-1);
|
|
|
|
return r;
|
|
|
|
return r;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return KStyle::subRect(rect, widget);
|
|
|
|
return KStyle::subRect(rect, ceData, elementFlags, widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2030,13 +2042,15 @@ TQRect PhaseStyle::subRect(SubRect rect, const TQWidget *widget) const
|
|
|
|
// Get metrics for subcontrols of complex controls
|
|
|
|
// Get metrics for subcontrols of complex controls
|
|
|
|
|
|
|
|
|
|
|
|
TQRect PhaseStyle::querySubControlMetrics(TQ_ComplexControl control,
|
|
|
|
TQRect PhaseStyle::querySubControlMetrics(TQ_ComplexControl control,
|
|
|
|
const TQWidget *widget,
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
SubControl subcontrol,
|
|
|
|
SubControl subcontrol,
|
|
|
|
const TQStyleOption &option) const
|
|
|
|
const TQStyleOption &option,
|
|
|
|
|
|
|
|
const TQWidget *widget) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQRect rect;
|
|
|
|
TQRect rect;
|
|
|
|
|
|
|
|
|
|
|
|
const int fw = pixelMetric(PM_DefaultFrameWidth, widget);
|
|
|
|
const int fw = pixelMetric(PM_DefaultFrameWidth, ceData, elementFlags, widget);
|
|
|
|
int w = widget->width(), h = widget->height();
|
|
|
|
int w = widget->width(), h = widget->height();
|
|
|
|
int xc;
|
|
|
|
int xc;
|
|
|
|
|
|
|
|
|
|
|
@ -2073,8 +2087,8 @@ TQRect PhaseStyle::querySubControlMetrics(TQ_ComplexControl control,
|
|
|
|
if (!sb) break;
|
|
|
|
if (!sb) break;
|
|
|
|
|
|
|
|
|
|
|
|
bool horizontal = (sb->orientation() == Qt::Horizontal);
|
|
|
|
bool horizontal = (sb->orientation() == Qt::Horizontal);
|
|
|
|
rect = KStyle::querySubControlMetrics(control, widget,
|
|
|
|
rect = KStyle::querySubControlMetrics(control, ceData, elementFlags,
|
|
|
|
subcontrol, option);
|
|
|
|
subcontrol, option, widget);
|
|
|
|
|
|
|
|
|
|
|
|
// adjust the standard metrics so controls can "overlap"
|
|
|
|
// adjust the standard metrics so controls can "overlap"
|
|
|
|
if (subcontrol == SC_ScrollBarGroove) {
|
|
|
|
if (subcontrol == SC_ScrollBarGroove) {
|
|
|
@ -2116,22 +2130,24 @@ TQRect PhaseStyle::querySubControlMetrics(TQ_ComplexControl control,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
rect = KStyle::querySubControlMetrics(control, widget, subcontrol,
|
|
|
|
rect = KStyle::querySubControlMetrics(control, ceData, elementFlags, subcontrol,
|
|
|
|
option);
|
|
|
|
option, widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
return rect;
|
|
|
|
return rect;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
//////////////////////////////////////////////////////////////////////////////
|
|
|
|
// tqsizeFromContents()
|
|
|
|
// sizeFromContents()
|
|
|
|
// ------------------
|
|
|
|
// ------------------
|
|
|
|
// Returns the size of widget based on the contentsize
|
|
|
|
// Returns the size of widget based on the contentsize
|
|
|
|
|
|
|
|
|
|
|
|
TQSize PhaseStyle::tqsizeFromContents(ContentsType contents,
|
|
|
|
TQSize PhaseStyle::sizeFromContents(ContentsType contents,
|
|
|
|
const TQWidget* widget,
|
|
|
|
TQStyleControlElementData ceData,
|
|
|
|
|
|
|
|
ControlElementFlags elementFlags,
|
|
|
|
const TQSize &contentsize,
|
|
|
|
const TQSize &contentsize,
|
|
|
|
const TQStyleOption &option ) const
|
|
|
|
const TQStyleOption &option,
|
|
|
|
|
|
|
|
const TQWidget* widget ) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
int w = contentsize.width();
|
|
|
|
int w = contentsize.width();
|
|
|
|
int h = contentsize.height();
|
|
|
|
int h = contentsize.height();
|
|
|
@ -2140,11 +2156,11 @@ TQSize PhaseStyle::tqsizeFromContents(ContentsType contents,
|
|
|
|
case CT_PushButton: {
|
|
|
|
case CT_PushButton: {
|
|
|
|
const TQPushButton* button = ::tqqt_cast<const TQPushButton*>(widget);
|
|
|
|
const TQPushButton* button = ::tqqt_cast<const TQPushButton*>(widget);
|
|
|
|
if (!button) {
|
|
|
|
if (!button) {
|
|
|
|
return KStyle::tqsizeFromContents(contents, widget, contentsize,
|
|
|
|
return KStyle::sizeFromContents(contents, ceData, elementFlags, contentsize,
|
|
|
|
option);
|
|
|
|
option, widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
int margin = pixelMetric(PM_ButtonMargin, widget)
|
|
|
|
int margin = pixelMetric(PM_ButtonMargin, ceData, elementFlags, widget)
|
|
|
|
+ pixelMetric(PM_DefaultFrameWidth, widget) + 4;
|
|
|
|
+ pixelMetric(PM_DefaultFrameWidth, ceData, elementFlags, widget) + 4;
|
|
|
|
|
|
|
|
|
|
|
|
w += margin + 6; // add room for bold font
|
|
|
|
w += margin + 6; // add room for bold font
|
|
|
|
h += margin;
|
|
|
|
h += margin;
|
|
|
@ -2161,8 +2177,8 @@ TQSize PhaseStyle::tqsizeFromContents(ContentsType contents,
|
|
|
|
if (!widget || option.isDefault()) return contentsize;
|
|
|
|
if (!widget || option.isDefault()) return contentsize;
|
|
|
|
const TQPopupMenu *popup = ::tqqt_cast<const TQPopupMenu*>(widget);
|
|
|
|
const TQPopupMenu *popup = ::tqqt_cast<const TQPopupMenu*>(widget);
|
|
|
|
if (!popup) {
|
|
|
|
if (!popup) {
|
|
|
|
return KStyle::tqsizeFromContents(contents, widget, contentsize,
|
|
|
|
return KStyle::sizeFromContents(contents, ceData, elementFlags, contentsize,
|
|
|
|
option);
|
|
|
|
option, widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
TQMenuItem *item = option.menuItem();
|
|
|
|
TQMenuItem *item = option.menuItem();
|
|
|
|
|
|
|
|
|
|
|
@ -2205,8 +2221,8 @@ TQSize PhaseStyle::tqsizeFromContents(ContentsType contents,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return KStyle::tqsizeFromContents(contents, widget, contentsize,
|
|
|
|
return KStyle::sizeFromContents(contents, ceData, elementFlags, contentsize,
|
|
|
|
option);
|
|
|
|
option, widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|