|
|
@ -1643,13 +1643,6 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
|
|
|
|
|
|
|
|
switch (control) {
|
|
|
|
switch (control) {
|
|
|
|
case CC_ComboBox: {
|
|
|
|
case CC_ComboBox: {
|
|
|
|
const TQComboBox * combo = ::tqqt_cast<const TQComboBox*>(widget);
|
|
|
|
|
|
|
|
if (!combo) {
|
|
|
|
|
|
|
|
KStyle::drawComplexControl(control, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
|
|
|
flags, controls, active, option, widget);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
sunken = (active == SC_ComboBoxArrow);
|
|
|
|
sunken = (active == SC_ComboBoxArrow);
|
|
|
|
drawPhaseButton(painter, x, y, w, h, group,
|
|
|
|
drawPhaseButton(painter, x, y, w, h, group,
|
|
|
|
(flags & Style_MouseOver)
|
|
|
|
(flags & Style_MouseOver)
|
|
|
@ -1669,7 +1662,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 (elementFlags & CEF_IsEditable) { // editable box
|
|
|
|
subrect = visualRect(querySubControlMetrics(CC_ComboBox,
|
|
|
|
subrect = visualRect(querySubControlMetrics(CC_ComboBox,
|
|
|
|
ceData, elementFlags, SC_ComboBoxEditField, TQStyleOption::Default, widget), ceData, elementFlags);
|
|
|
|
ceData, elementFlags, SC_ComboBoxEditField, TQStyleOption::Default, widget), ceData, elementFlags);
|
|
|
|
x2 = subrect.right(); y2 = subrect.bottom();
|
|
|
|
x2 = subrect.right(); y2 = subrect.bottom();
|
|
|
@ -1679,9 +1672,9 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
painter->drawLine(x2+2, y, x2+2, y2-1);
|
|
|
|
painter->drawLine(x2+2, y, x2+2, y2-1);
|
|
|
|
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 (elementFlags & CEF_HasFocus) { // non editable box
|
|
|
|
subrect = visualRect(subRect(SR_ComboBoxFocusRect, ceData, elementFlags,
|
|
|
|
subrect = visualRect(subRect(SR_ComboBoxFocusRect, ceData, elementFlags,
|
|
|
|
combo), ceData, elementFlags);
|
|
|
|
widget), ceData, elementFlags);
|
|
|
|
drawPrimitive(PE_FocusRect, painter, ceData, elementFlags, subrect, group,
|
|
|
|
drawPrimitive(PE_FocusRect, painter, ceData, elementFlags, subrect, group,
|
|
|
|
Style_FocusAtBorder,
|
|
|
|
Style_FocusAtBorder,
|
|
|
|
TQStyleOption(group.highlight()));
|
|
|
|
TQStyleOption(group.highlight()));
|
|
|
@ -1694,18 +1687,11 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
|
|
|
|
|
|
|
|
case CC_ScrollBar: {
|
|
|
|
case CC_ScrollBar: {
|
|
|
|
// always a three button scrollbar
|
|
|
|
// always a three button scrollbar
|
|
|
|
const TQScrollBar *sb = ::tqqt_cast<const TQScrollBar*>(widget);
|
|
|
|
|
|
|
|
if (!sb) {
|
|
|
|
|
|
|
|
KStyle::drawComplexControl(control, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
|
|
|
flags, controls, active, option, widget);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQRect srect;
|
|
|
|
TQRect srect;
|
|
|
|
bool horizontal = (sb->orientation() == Qt::Horizontal);
|
|
|
|
bool horizontal = (ceData.orientation == TQt::Horizontal);
|
|
|
|
SFlags scrollflags = (horizontal ? Style_Horizontal : Style_Default);
|
|
|
|
SFlags scrollflags = (horizontal ? Style_Horizontal : Style_Default);
|
|
|
|
|
|
|
|
|
|
|
|
if (sb->minValue() == sb->maxValue()) scrollflags |= Style_Default;
|
|
|
|
if (ceData.minSteps == ceData.maxSteps) scrollflags |= Style_Default;
|
|
|
|
else scrollflags |= Style_Enabled;
|
|
|
|
else scrollflags |= Style_Enabled;
|
|
|
|
|
|
|
|
|
|
|
|
// addline
|
|
|
|
// addline
|
|
|
@ -1765,7 +1751,7 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
|
|
|
|
|
|
|
|
// slider
|
|
|
|
// slider
|
|
|
|
if (controls & SC_ScrollBarSlider) {
|
|
|
|
if (controls & SC_ScrollBarSlider) {
|
|
|
|
if (sb->minValue() == sb->maxValue()) {
|
|
|
|
if (ceData.minSteps == ceData.maxSteps) {
|
|
|
|
// maxed out
|
|
|
|
// maxed out
|
|
|
|
srect = querySubControlMetrics(control, ceData, elementFlags,
|
|
|
|
srect = querySubControlMetrics(control, ceData, elementFlags,
|
|
|
|
SC_ScrollBarGroove, option, widget);
|
|
|
|
SC_ScrollBarGroove, option, widget);
|
|
|
@ -1780,7 +1766,7 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
scrollflags | ((active == SC_ScrollBarSlider)
|
|
|
|
scrollflags | ((active == SC_ScrollBarSlider)
|
|
|
|
? Style_Down : Style_Default));
|
|
|
|
? Style_Down : Style_Default));
|
|
|
|
// focus
|
|
|
|
// focus
|
|
|
|
if (sb->hasFocus()) {
|
|
|
|
if (elementFlags & CEF_HasFocus) {
|
|
|
|
srect.addCoords(2, 2, -2, -2);
|
|
|
|
srect.addCoords(2, 2, -2, -2);
|
|
|
|
drawPrimitive(PE_FocusRect, painter, ceData, elementFlags, srect, group,
|
|
|
|
drawPrimitive(PE_FocusRect, painter, ceData, elementFlags, srect, group,
|
|
|
|
Style_Default);
|
|
|
|
Style_Default);
|
|
|
@ -1852,11 +1838,6 @@ 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) {
|
|
|
|
|
|
|
|
KStyle::drawComplexControl(control, painter, ceData, elementFlags, rect, group,
|
|
|
|
|
|
|
|
flags, controls, active, option, widget);
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
TQToolBar *toolbar;
|
|
|
|
TQToolBar *toolbar;
|
|
|
|
bool horiz = true;
|
|
|
|
bool horiz = true;
|
|
|
@ -1866,32 +1847,29 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
y2 = rect.bottom();
|
|
|
|
y2 = rect.bottom();
|
|
|
|
|
|
|
|
|
|
|
|
// check for TQToolBar parent
|
|
|
|
// check for TQToolBar parent
|
|
|
|
if (btn->parent() && btn->parent()->inherits(TQTOOLBAR_OBJECT_NAME_STRING)) {
|
|
|
|
if (ceData.parentWidgetData.widgetObjectTypes.contains(TQTOOLBAR_OBJECT_NAME_STRING)) {
|
|
|
|
toolbar = ::tqqt_cast<TQToolBar*>(btn->parent());
|
|
|
|
toolbar = (btn)?::tqqt_cast<TQToolBar*>(btn->parent()):NULL;
|
|
|
|
if (toolbar) {
|
|
|
|
horiz = (ceData.toolBarData.orientation == TQt::Horizontal);
|
|
|
|
horiz = (toolbar->orientation() == Qt::Horizontal);
|
|
|
|
if (normal) { // draw background
|
|
|
|
if (normal) { // draw background
|
|
|
|
if (toolbar && flatToolbar(ceData, elementFlags, toolbar)) {
|
|
|
|
if (flatToolbar(ceData, elementFlags, toolbar)) {
|
|
|
|
// toolbar not floating or in a TQMainWindow
|
|
|
|
// toolbar not floating or in a TQMainWindow
|
|
|
|
painter->fillRect(rect, group.background());
|
|
|
|
painter->fillRect(rect, group.background());
|
|
|
|
} else {
|
|
|
|
|
|
|
|
drawPhaseGradient(painter, rect, group.background(),
|
|
|
|
|
|
|
|
!horiz, 0, 0,
|
|
|
|
|
|
|
|
ceData.parentWidgetData.rect.width()-3,
|
|
|
|
|
|
|
|
ceData.parentWidgetData.rect.height()-3, true);
|
|
|
|
|
|
|
|
painter->setPen(group.mid());
|
|
|
|
|
|
|
|
if (horiz) {
|
|
|
|
|
|
|
|
painter->drawLine(x, y2, x2, y2);
|
|
|
|
} else {
|
|
|
|
} else {
|
|
|
|
drawPhaseGradient(painter, rect, group.background(),
|
|
|
|
painter->drawLine(x2, y, x2, y2);
|
|
|
|
!horiz, 0, 0,
|
|
|
|
|
|
|
|
toolbar->width()-3,
|
|
|
|
|
|
|
|
toolbar->height()-3, true);
|
|
|
|
|
|
|
|
painter->setPen(group.mid());
|
|
|
|
|
|
|
|
if (horiz) {
|
|
|
|
|
|
|
|
painter->drawLine(x, y2, x2, y2);
|
|
|
|
|
|
|
|
} else {
|
|
|
|
|
|
|
|
painter->drawLine(x2, y, x2, y2);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// check for TQToolBarExtensionWidget parent
|
|
|
|
// check for TQToolBarExtensionWidget parent
|
|
|
|
else if (btn->parent() &&
|
|
|
|
else if (btn && ceData.parentWidgetData.widgetObjectTypes.contains(TQTOOLBAREXTENSION)) {
|
|
|
|
btn->parent()->inherits(TQTOOLBAREXTENSION)) {
|
|
|
|
|
|
|
|
TQWidget *extension;
|
|
|
|
TQWidget *extension;
|
|
|
|
if ((extension = ::tqqt_cast<TQWidget*>(btn->parent()))) {
|
|
|
|
if ((extension = ::tqqt_cast<TQWidget*>(btn->parent()))) {
|
|
|
|
toolbar = ::tqqt_cast<TQToolBar*>(extension->parent());
|
|
|
|
toolbar = ::tqqt_cast<TQToolBar*>(extension->parent());
|
|
|
@ -1906,11 +1884,10 @@ void PhaseStyle::drawComplexControl(TQ_ComplexControl control,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// check for background pixmap
|
|
|
|
// check for background pixmap
|
|
|
|
else if (normal && btn->parentWidget() &&
|
|
|
|
else if (normal &&
|
|
|
|
btn->parentWidget()->backgroundPixmap() &&
|
|
|
|
!ceData.parentWidgetData.bgPixmap.isNull()) {
|
|
|
|
!btn->parentWidget()->backgroundPixmap()->isNull()) {
|
|
|
|
TQPixmap pixmap = ceData.parentWidgetData.bgPixmap;
|
|
|
|
TQPixmap pixmap = *(btn->parentWidget()->backgroundPixmap());
|
|
|
|
painter->drawTiledPixmap(rect, pixmap, ceData.pos);
|
|
|
|
painter->drawTiledPixmap(rect, pixmap, btn->pos());
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// everything else
|
|
|
|
// everything else
|
|
|
|
else if (normal) {
|
|
|
|
else if (normal) {
|
|
|
|