|
|
@ -918,7 +918,7 @@ void StyleCheckStyle::accelManageRecursive(TQWidget* widget)
|
|
|
|
void StyleCheckStyle::slotAccelManage()
|
|
|
|
void StyleCheckStyle::slotAccelManage()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Walk through top-levels
|
|
|
|
//Walk through top-levels
|
|
|
|
TQWidgetList* topLevels = TQApplication::tqtopLevelWidgets();
|
|
|
|
TQWidgetList* topLevels = TQApplication::topLevelWidgets();
|
|
|
|
if (!topLevels)
|
|
|
|
if (!topLevels)
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
@ -1392,7 +1392,7 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe,
|
|
|
|
case PE_WindowFrame:
|
|
|
|
case PE_WindowFrame:
|
|
|
|
case PE_PanelLineEdit: {
|
|
|
|
case PE_PanelLineEdit: {
|
|
|
|
bool sunken = flags & Style_Sunken;
|
|
|
|
bool sunken = flags & Style_Sunken;
|
|
|
|
int lw = opt.isDefault() ? tqpixelMetric(PM_DefaultFrameWidth)
|
|
|
|
int lw = opt.isDefault() ? pixelMetric(PM_DefaultFrameWidth)
|
|
|
|
: opt.lineWidth();
|
|
|
|
: opt.lineWidth();
|
|
|
|
if (lw == 2)
|
|
|
|
if (lw == 2)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -1502,8 +1502,8 @@ void StyleCheckStyle::drawPrimitive( PrimitiveElement pe,
|
|
|
|
|
|
|
|
|
|
|
|
p->save();
|
|
|
|
p->save();
|
|
|
|
if ( flags & Style_Down )
|
|
|
|
if ( flags & Style_Down )
|
|
|
|
p->translate( tqpixelMetric( PM_ButtonShiftHorizontal ),
|
|
|
|
p->translate( pixelMetric( PM_ButtonShiftHorizontal ),
|
|
|
|
tqpixelMetric( PM_ButtonShiftVertical ) );
|
|
|
|
pixelMetric( PM_ButtonShiftVertical ) );
|
|
|
|
|
|
|
|
|
|
|
|
if ( flags & Style_Enabled ) {
|
|
|
|
if ( flags & Style_Enabled ) {
|
|
|
|
a.translate( r.x() + r.width() / 2, r.y() + r.height() / 2 );
|
|
|
|
a.translate( r.x() + r.width() / 2, r.y() + r.height() / 2 );
|
|
|
@ -1705,7 +1705,7 @@ void StyleCheckStyle::drawKStylePrimitive( KStylePrimitive kpe,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void StyleCheckStyle::tqdrawControl( ControlElement element,
|
|
|
|
void StyleCheckStyle::drawControl( ControlElement element,
|
|
|
|
TQPainter *p,
|
|
|
|
TQPainter *p,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQRect &r,
|
|
|
|
const TQRect &r,
|
|
|
@ -1727,7 +1727,7 @@ void StyleCheckStyle::tqdrawControl( ControlElement element,
|
|
|
|
|
|
|
|
|
|
|
|
if ( btnDefault || button->autoDefault() ) {
|
|
|
|
if ( btnDefault || button->autoDefault() ) {
|
|
|
|
// Compensate for default indicator
|
|
|
|
// Compensate for default indicator
|
|
|
|
static int di = tqpixelMetric( PM_ButtonDefaultIndicator );
|
|
|
|
static int di = pixelMetric( PM_ButtonDefaultIndicator );
|
|
|
|
br.addCoords( di, di, -di, -di );
|
|
|
|
br.addCoords( di, di, -di, -di );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1750,14 +1750,14 @@ void StyleCheckStyle::tqdrawControl( ControlElement element,
|
|
|
|
|
|
|
|
|
|
|
|
// Shift button contents if pushed.
|
|
|
|
// Shift button contents if pushed.
|
|
|
|
if ( active ) {
|
|
|
|
if ( active ) {
|
|
|
|
x += tqpixelMetric(PM_ButtonShiftHorizontal, widget);
|
|
|
|
x += pixelMetric(PM_ButtonShiftHorizontal, widget);
|
|
|
|
y += tqpixelMetric(PM_ButtonShiftVertical, widget);
|
|
|
|
y += pixelMetric(PM_ButtonShiftVertical, widget);
|
|
|
|
flags |= Style_Sunken;
|
|
|
|
flags |= Style_Sunken;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Does the button have a popup menu?
|
|
|
|
// Does the button have a popup menu?
|
|
|
|
if ( button->isMenuButton() ) {
|
|
|
|
if ( button->isMenuButton() ) {
|
|
|
|
int dx = tqpixelMetric( PM_MenuButtonIndicator, widget );
|
|
|
|
int dx = pixelMetric( PM_MenuButtonIndicator, widget );
|
|
|
|
drawPrimitive( PE_ArrowDown, p, TQRect(x + w - dx - 2, y + 2, dx, h - 4),
|
|
|
|
drawPrimitive( PE_ArrowDown, p, TQRect(x + w - dx - 2, y + 2, dx, h - 4),
|
|
|
|
cg, flags, opt );
|
|
|
|
cg, flags, opt );
|
|
|
|
w -= dx;
|
|
|
|
w -= dx;
|
|
|
@ -1786,7 +1786,7 @@ void StyleCheckStyle::tqdrawControl( ControlElement element,
|
|
|
|
// Make the label indicate if the button is a default button or not
|
|
|
|
// Make the label indicate if the button is a default button or not
|
|
|
|
if ( active || button->isDefault() ) {
|
|
|
|
if ( active || button->isDefault() ) {
|
|
|
|
// Draw "fake" bold text - this enables the font metrics to remain
|
|
|
|
// Draw "fake" bold text - this enables the font metrics to remain
|
|
|
|
// the same as computed in TQPushButton::tqsizeHint(), but gives
|
|
|
|
// the same as computed in TQPushButton::sizeHint(), but gives
|
|
|
|
// a reasonable bold effect.
|
|
|
|
// a reasonable bold effect.
|
|
|
|
int i;
|
|
|
|
int i;
|
|
|
|
|
|
|
|
|
|
|
@ -1794,25 +1794,25 @@ void StyleCheckStyle::tqdrawControl( ControlElement element,
|
|
|
|
if (button->isEnabled()) // Don't draw double-shadow when disabled
|
|
|
|
if (button->isEnabled()) // Don't draw double-shadow when disabled
|
|
|
|
for(i=0; i<2; i++)
|
|
|
|
for(i=0; i<2; i++)
|
|
|
|
drawItem( p, TQRect(x+i+1, y+1, w, h), AlignCenter | ShowPrefix,
|
|
|
|
drawItem( p, TQRect(x+i+1, y+1, w, h), AlignCenter | ShowPrefix,
|
|
|
|
button->tqcolorGroup(), button->isEnabled(), button->pixmap(),
|
|
|
|
button->colorGroup(), button->isEnabled(), button->pixmap(),
|
|
|
|
removedXX(stripAccelViolations(button->text())), -1,
|
|
|
|
removedXX(stripAccelViolations(button->text())), -1,
|
|
|
|
active ? &button->tqcolorGroup().dark() : &button->tqcolorGroup().mid() );
|
|
|
|
active ? &button->colorGroup().dark() : &button->colorGroup().mid() );
|
|
|
|
|
|
|
|
|
|
|
|
// Normal Text
|
|
|
|
// Normal Text
|
|
|
|
for(i=0; i<2; i++)
|
|
|
|
for(i=0; i<2; i++)
|
|
|
|
drawItem( p, TQRect(x+i, y, w, h), AlignCenter | ShowPrefix,
|
|
|
|
drawItem( p, TQRect(x+i, y, w, h), AlignCenter | ShowPrefix,
|
|
|
|
button->tqcolorGroup(), button->isEnabled(), button->pixmap(),
|
|
|
|
button->colorGroup(), button->isEnabled(), button->pixmap(),
|
|
|
|
removedXX(stripAccelViolations(button->text())), -1,
|
|
|
|
removedXX(stripAccelViolations(button->text())), -1,
|
|
|
|
active ? &button->tqcolorGroup().light() : &button->tqcolorGroup().buttonText() );
|
|
|
|
active ? &button->colorGroup().light() : &button->colorGroup().buttonText() );
|
|
|
|
} else
|
|
|
|
} else
|
|
|
|
drawItem( p, TQRect(x, y, w, h), AlignCenter | ShowPrefix, button->tqcolorGroup(),
|
|
|
|
drawItem( p, TQRect(x, y, w, h), AlignCenter | ShowPrefix, button->colorGroup(),
|
|
|
|
button->isEnabled(), button->pixmap(), removedXX(stripAccelViolations(button->text())), -1,
|
|
|
|
button->isEnabled(), button->pixmap(), removedXX(stripAccelViolations(button->text())), -1,
|
|
|
|
active ? &button->tqcolorGroup().light() : &button->tqcolorGroup().buttonText() );
|
|
|
|
active ? &button->colorGroup().light() : &button->colorGroup().buttonText() );
|
|
|
|
|
|
|
|
|
|
|
|
// Draw a focus rect if the button has focus
|
|
|
|
// Draw a focus rect if the button has focus
|
|
|
|
if ( flags & Style_HasFocus )
|
|
|
|
if ( flags & Style_HasFocus )
|
|
|
|
drawPrimitive( PE_FocusRect, p,
|
|
|
|
drawPrimitive( PE_FocusRect, p,
|
|
|
|
TQStyle::tqvisualRect(subRect(SR_PushButtonFocusRect, widget), widget),
|
|
|
|
TQStyle::visualRect(subRect(SR_PushButtonFocusRect, widget), widget),
|
|
|
|
cg, flags );
|
|
|
|
cg, flags );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1828,7 +1828,7 @@ void StyleCheckStyle::tqdrawControl( ControlElement element,
|
|
|
|
TQRect tr = r;
|
|
|
|
TQRect tr = r;
|
|
|
|
if ( t->identifier() == tb->currentTab() )
|
|
|
|
if ( t->identifier() == tb->currentTab() )
|
|
|
|
tr.setBottom( tr.bottom() -
|
|
|
|
tr.setBottom( tr.bottom() -
|
|
|
|
tqpixelMetric( TQStyle::PM_DefaultFrameWidth, tb ) );
|
|
|
|
pixelMetric( TQStyle::PM_DefaultFrameWidth, tb ) );
|
|
|
|
|
|
|
|
|
|
|
|
TQValueVector<StyleGuideViolation> violations = checkTitleStyle(t->text(), ShortTitle, HasAccels);
|
|
|
|
TQValueVector<StyleGuideViolation> violations = checkTitleStyle(t->text(), ShortTitle, HasAccels);
|
|
|
|
renderViolations(violations, p, r, AlignCenter |ShowPrefix, t->text());
|
|
|
|
renderViolations(violations, p, r, AlignCenter |ShowPrefix, t->text());
|
|
|
@ -1857,7 +1857,7 @@ void StyleCheckStyle::tqdrawControl( ControlElement element,
|
|
|
|
|
|
|
|
|
|
|
|
if (flags & Style_HasFocus)
|
|
|
|
if (flags & Style_HasFocus)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQRect fr = tqvisualRect(subRect(SR_CheckBoxFocusRect, widget), widget);
|
|
|
|
TQRect fr = visualRect(subRect(SR_CheckBoxFocusRect, widget), widget);
|
|
|
|
drawPrimitive(PE_FocusRect, p, fr, cg, flags);
|
|
|
|
drawPrimitive(PE_FocusRect, p, fr, cg, flags);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -1878,7 +1878,7 @@ void StyleCheckStyle::tqdrawControl( ControlElement element,
|
|
|
|
|
|
|
|
|
|
|
|
if (flags & Style_HasFocus)
|
|
|
|
if (flags & Style_HasFocus)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQRect fr = tqvisualRect(subRect(SR_CheckBoxFocusRect, widget), widget);
|
|
|
|
TQRect fr = visualRect(subRect(SR_CheckBoxFocusRect, widget), widget);
|
|
|
|
drawPrimitive(PE_FocusRect, p, fr, cg, flags);
|
|
|
|
drawPrimitive(PE_FocusRect, p, fr, cg, flags);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
@ -1933,7 +1933,7 @@ void StyleCheckStyle::tqdrawControl( ControlElement element,
|
|
|
|
bool enabled = mi->isEnabled();
|
|
|
|
bool enabled = mi->isEnabled();
|
|
|
|
bool checkable = popupmenu->isCheckable();
|
|
|
|
bool checkable = popupmenu->isCheckable();
|
|
|
|
bool active = flags & Style_Active;
|
|
|
|
bool active = flags & Style_Active;
|
|
|
|
bool etchtext = tqstyleHint( SH_EtchDisabledText );
|
|
|
|
bool etchtext = styleHint( SH_EtchDisabledText );
|
|
|
|
bool reverse = TQApplication::reverseLayout();
|
|
|
|
bool reverse = TQApplication::reverseLayout();
|
|
|
|
int x, y, w, h;
|
|
|
|
int x, y, w, h;
|
|
|
|
r.rect( &x, &y, &w, &h );
|
|
|
|
r.rect( &x, &y, &w, &h );
|
|
|
@ -1964,7 +1964,7 @@ void StyleCheckStyle::tqdrawControl( ControlElement element,
|
|
|
|
// Do we have an icon?
|
|
|
|
// Do we have an icon?
|
|
|
|
if ( mi->iconSet() ) {
|
|
|
|
if ( mi->iconSet() ) {
|
|
|
|
TQIconSet::Mode mode;
|
|
|
|
TQIconSet::Mode mode;
|
|
|
|
TQRect cr = tqvisualRect( TQRect(x, y, checkcol, h), r );
|
|
|
|
TQRect cr = visualRect( TQRect(x, y, checkcol, h), r );
|
|
|
|
|
|
|
|
|
|
|
|
// Select the correct icon from the iconset
|
|
|
|
// Select the correct icon from the iconset
|
|
|
|
if ( active )
|
|
|
|
if ( active )
|
|
|
@ -2110,8 +2110,8 @@ void StyleCheckStyle::tqdrawControl( ControlElement element,
|
|
|
|
// Does the menu item have a submenu?
|
|
|
|
// Does the menu item have a submenu?
|
|
|
|
if ( mi->popup() ) {
|
|
|
|
if ( mi->popup() ) {
|
|
|
|
PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight;
|
|
|
|
PrimitiveElement arrow = reverse ? PE_ArrowLeft : PE_ArrowRight;
|
|
|
|
int dim = tqpixelMetric(PM_MenuButtonIndicator);
|
|
|
|
int dim = pixelMetric(PM_MenuButtonIndicator);
|
|
|
|
TQRect vr = tqvisualRect( TQRect( x + w - arrowHMargin - 2*itemFrame - dim,
|
|
|
|
TQRect vr = visualRect( TQRect( x + w - arrowHMargin - 2*itemFrame - dim,
|
|
|
|
y + h / 2 - dim / 2, dim, dim), r );
|
|
|
|
y + h / 2 - dim / 2, dim, dim), r );
|
|
|
|
|
|
|
|
|
|
|
|
// Draw an arrow at the far end of the menu item
|
|
|
|
// Draw an arrow at the far end of the menu item
|
|
|
@ -2164,12 +2164,12 @@ void StyleCheckStyle::tqdrawControl( ControlElement element,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::tqdrawControl(element, p, widget, r, cg, flags, opt);
|
|
|
|
KStyle::drawControl(element, p, widget, r, cg, flags, opt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void StyleCheckStyle::tqdrawControlMask( ControlElement element,
|
|
|
|
void StyleCheckStyle::drawControlMask( ControlElement element,
|
|
|
|
TQPainter *p,
|
|
|
|
TQPainter *p,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQRect &r,
|
|
|
|
const TQRect &r,
|
|
|
@ -2190,12 +2190,12 @@ void StyleCheckStyle::tqdrawControlMask( ControlElement element,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::tqdrawControlMask(element, p, widget, r, opt);
|
|
|
|
KStyle::drawControlMask(element, p, widget, r, opt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void StyleCheckStyle::tqdrawComplexControl( ComplexControl control,
|
|
|
|
void StyleCheckStyle::drawComplexControl( ComplexControl control,
|
|
|
|
TQPainter *p,
|
|
|
|
TQPainter *p,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQRect &r,
|
|
|
|
const TQRect &r,
|
|
|
@ -2246,7 +2246,7 @@ void StyleCheckStyle::tqdrawComplexControl( ComplexControl control,
|
|
|
|
p->drawLine(x+1, y+2, x+1, y2-2);
|
|
|
|
p->drawLine(x+1, y+2, x+1, y2-2);
|
|
|
|
|
|
|
|
|
|
|
|
// Get the button bounding box
|
|
|
|
// Get the button bounding box
|
|
|
|
TQRect ar = TQStyle::tqvisualRect(
|
|
|
|
TQRect ar = TQStyle::visualRect(
|
|
|
|
querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxArrow),
|
|
|
|
querySubControlMetrics(CC_ComboBox, widget, SC_ComboBoxArrow),
|
|
|
|
widget );
|
|
|
|
widget );
|
|
|
|
|
|
|
|
|
|
|
@ -2265,7 +2265,7 @@ void StyleCheckStyle::tqdrawComplexControl( ComplexControl control,
|
|
|
|
if ( controls & SC_ComboBoxEditField )
|
|
|
|
if ( controls & SC_ComboBoxEditField )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
const TQComboBox * cb = (const TQComboBox *) widget;
|
|
|
|
const TQComboBox * cb = (const TQComboBox *) widget;
|
|
|
|
TQRect re = TQStyle::tqvisualRect(
|
|
|
|
TQRect re = TQStyle::visualRect(
|
|
|
|
querySubControlMetrics( CC_ComboBox, widget,
|
|
|
|
querySubControlMetrics( CC_ComboBox, widget,
|
|
|
|
SC_ComboBoxEditField), widget );
|
|
|
|
SC_ComboBoxEditField), widget );
|
|
|
|
|
|
|
|
|
|
|
@ -2289,7 +2289,7 @@ void StyleCheckStyle::tqdrawComplexControl( ComplexControl control,
|
|
|
|
p->fillRect( re.x(), re.y(), re.width(), re.height(),
|
|
|
|
p->fillRect( re.x(), re.y(), re.width(), re.height(),
|
|
|
|
cg.brush( TQColorGroup::Highlight ) );
|
|
|
|
cg.brush( TQColorGroup::Highlight ) );
|
|
|
|
|
|
|
|
|
|
|
|
TQRect re = TQStyle::tqvisualRect(
|
|
|
|
TQRect re = TQStyle::visualRect(
|
|
|
|
subRect(SR_ComboBoxFocusRect, cb), widget);
|
|
|
|
subRect(SR_ComboBoxFocusRect, cb), widget);
|
|
|
|
|
|
|
|
|
|
|
|
drawPrimitive( PE_FocusRect, p, re, cg,
|
|
|
|
drawPrimitive( PE_FocusRect, p, re, cg,
|
|
|
@ -2377,14 +2377,14 @@ void StyleCheckStyle::tqdrawComplexControl( ComplexControl control,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::tqdrawComplexControl(control, p, widget,
|
|
|
|
KStyle::drawComplexControl(control, p, widget,
|
|
|
|
r, cg, flags, controls, active, opt);
|
|
|
|
r, cg, flags, controls, active, opt);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void StyleCheckStyle::tqdrawComplexControlMask( ComplexControl control,
|
|
|
|
void StyleCheckStyle::drawComplexControlMask( ComplexControl control,
|
|
|
|
TQPainter *p,
|
|
|
|
TQPainter *p,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQWidget *widget,
|
|
|
|
const TQRect &r,
|
|
|
|
const TQRect &r,
|
|
|
@ -2406,7 +2406,7 @@ void StyleCheckStyle::tqdrawComplexControlMask( ComplexControl control,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::tqdrawComplexControlMask(control, p, widget, r, opt);
|
|
|
|
KStyle::drawComplexControlMask(control, p, widget, r, opt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2422,11 +2422,11 @@ TQRect StyleCheckStyle::subRect(SubRect r, const TQWidget *widget) const
|
|
|
|
int dbw1 = 0, dbw2 = 0;
|
|
|
|
int dbw1 = 0, dbw2 = 0;
|
|
|
|
|
|
|
|
|
|
|
|
if (button->isDefault() || button->autoDefault()) {
|
|
|
|
if (button->isDefault() || button->autoDefault()) {
|
|
|
|
dbw1 = tqpixelMetric(PM_ButtonDefaultIndicator, widget);
|
|
|
|
dbw1 = pixelMetric(PM_ButtonDefaultIndicator, widget);
|
|
|
|
dbw2 = dbw1 * 2;
|
|
|
|
dbw2 = dbw1 * 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
int dfw1 = tqpixelMetric(PM_DefaultFrameWidth, widget) * 2,
|
|
|
|
int dfw1 = pixelMetric(PM_DefaultFrameWidth, widget) * 2,
|
|
|
|
dfw2 = dfw1 * 2;
|
|
|
|
dfw2 = dfw1 * 2;
|
|
|
|
|
|
|
|
|
|
|
|
return TQRect(wrect.x() + dfw1 + dbw1 + 1,
|
|
|
|
return TQRect(wrect.x() + dfw1 + dbw1 + 1,
|
|
|
@ -2438,7 +2438,7 @@ TQRect StyleCheckStyle::subRect(SubRect r, const TQWidget *widget) const
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int StyleCheckStyle::tqpixelMetric(PixelMetric m, const TQWidget *widget) const
|
|
|
|
int StyleCheckStyle::pixelMetric(PixelMetric m, const TQWidget *widget) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch(m)
|
|
|
|
switch(m)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -2465,7 +2465,7 @@ int StyleCheckStyle::tqpixelMetric(PixelMetric m, const TQWidget *widget) const
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return KStyle::tqpixelMetric(m, widget);
|
|
|
|
return KStyle::pixelMetric(m, widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2483,8 +2483,8 @@ TQSize StyleCheckStyle::sizeFromContents( ContentsType contents,
|
|
|
|
const TQPushButton* button = (const TQPushButton*) widget;
|
|
|
|
const TQPushButton* button = (const TQPushButton*) widget;
|
|
|
|
int w = contentSize.width();
|
|
|
|
int w = contentSize.width();
|
|
|
|
int h = contentSize.height();
|
|
|
|
int h = contentSize.height();
|
|
|
|
int bm = tqpixelMetric( PM_ButtonMargin, widget );
|
|
|
|
int bm = pixelMetric( PM_ButtonMargin, widget );
|
|
|
|
int fw = tqpixelMetric( PM_DefaultFrameWidth, widget ) * 2;
|
|
|
|
int fw = pixelMetric( PM_DefaultFrameWidth, widget ) * 2;
|
|
|
|
|
|
|
|
|
|
|
|
w += bm + fw + 6; // ### Add 6 to make way for bold font.
|
|
|
|
w += bm + fw + 6; // ### Add 6 to make way for bold font.
|
|
|
|
h += bm + fw;
|
|
|
|
h += bm + fw;
|
|
|
@ -2495,7 +2495,7 @@ TQSize StyleCheckStyle::sizeFromContents( ContentsType contents,
|
|
|
|
w = 80;
|
|
|
|
w = 80;
|
|
|
|
|
|
|
|
|
|
|
|
// Compensate for default indicator
|
|
|
|
// Compensate for default indicator
|
|
|
|
int di = tqpixelMetric( PM_ButtonDefaultIndicator );
|
|
|
|
int di = pixelMetric( PM_ButtonDefaultIndicator );
|
|
|
|
w += di * 2;
|
|
|
|
w += di * 2;
|
|
|
|
h += di * 2;
|
|
|
|
h += di * 2;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2520,8 +2520,8 @@ TQSize StyleCheckStyle::sizeFromContents( ContentsType contents,
|
|
|
|
int w = contentSize.width(), h = contentSize.height();
|
|
|
|
int w = contentSize.width(), h = contentSize.height();
|
|
|
|
|
|
|
|
|
|
|
|
if ( mi->custom() ) {
|
|
|
|
if ( mi->custom() ) {
|
|
|
|
w = mi->custom()->tqsizeHint().width();
|
|
|
|
w = mi->custom()->sizeHint().width();
|
|
|
|
h = mi->custom()->tqsizeHint().height();
|
|
|
|
h = mi->custom()->sizeHint().height();
|
|
|
|
if ( ! mi->custom()->fullSpan() )
|
|
|
|
if ( ! mi->custom()->fullSpan() )
|
|
|
|
h += 2*itemVMargin + 2*itemFrame;
|
|
|
|
h += 2*itemVMargin + 2*itemFrame;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2658,7 +2658,7 @@ bool StyleCheckStyle::eventFilter( TQObject *object, TQEvent *event )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
renderViolations(violations, &p, cr,lb->tqalignment() | ShowPrefix, lb->text() );
|
|
|
|
renderViolations(violations, &p, cr,lb->tqalignment() | ShowPrefix, lb->text() );
|
|
|
|
// ordinary text or pixmap label
|
|
|
|
// ordinary text or pixmap label
|
|
|
|
drawItem( &p, cr, lb->tqalignment(), lb->tqcolorGroup(), lb->isEnabled(),
|
|
|
|
drawItem( &p, cr, lb->tqalignment(), lb->colorGroup(), lb->isEnabled(),
|
|
|
|
0, removedXX(stripAccelViolations(lb->text())) );
|
|
|
|
0, removedXX(stripAccelViolations(lb->text())) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
@ -2666,7 +2666,7 @@ bool StyleCheckStyle::eventFilter( TQObject *object, TQEvent *event )
|
|
|
|
renderViolations(violations, &p, cr,lb->tqalignment(), lb->text() );
|
|
|
|
renderViolations(violations, &p, cr,lb->tqalignment(), lb->text() );
|
|
|
|
|
|
|
|
|
|
|
|
// ordinary text or pixmap label
|
|
|
|
// ordinary text or pixmap label
|
|
|
|
drawItem( &p, cr, lb->tqalignment(), lb->tqcolorGroup(), lb->isEnabled(),
|
|
|
|
drawItem( &p, cr, lb->tqalignment(), lb->colorGroup(), lb->isEnabled(),
|
|
|
|
0, removedXX(stripAccelViolations(lb->text())) );
|
|
|
|
0, removedXX(stripAccelViolations(lb->text())) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2723,7 +2723,7 @@ bool StyleCheckStyle::eventFilter( TQObject *object, TQEvent *event )
|
|
|
|
|
|
|
|
|
|
|
|
renderViolations( violations, &paint, r, AlignCenter | ShowPrefix, gb->title() );
|
|
|
|
renderViolations( violations, &paint, r, AlignCenter | ShowPrefix, gb->title() );
|
|
|
|
|
|
|
|
|
|
|
|
drawItem(&paint, r, AlignCenter | ShowPrefix, gb->tqcolorGroup(),
|
|
|
|
drawItem(&paint, r, AlignCenter | ShowPrefix, gb->colorGroup(),
|
|
|
|
gb->isEnabled(), 0, stripped_title );
|
|
|
|
gb->isEnabled(), 0, stripped_title );
|
|
|
|
|
|
|
|
|
|
|
|
paint.setClipRegion( pevent->region().subtract( r ) );
|
|
|
|
paint.setClipRegion( pevent->region().subtract( r ) );
|
|
|
@ -2740,7 +2740,7 @@ bool StyleCheckStyle::eventFilter( TQObject *object, TQEvent *event )
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
tqdrawPrimitive( TQStyle::PE_GroupBoxFrame, &paint, gb->frameRect(),
|
|
|
|
tqdrawPrimitive( TQStyle::PE_GroupBoxFrame, &paint, gb->frameRect(),
|
|
|
|
gb->tqcolorGroup(), TQStyle::Style_Default,
|
|
|
|
gb->colorGroup(), TQStyle::Style_Default,
|
|
|
|
TQStyleOption(gb->lineWidth(), gb->midLineWidth(),
|
|
|
|
TQStyleOption(gb->lineWidth(), gb->midLineWidth(),
|
|
|
|
gb->frameShape(), gb->frameShadow()) );
|
|
|
|
gb->frameShape(), gb->frameShadow()) );
|
|
|
|
}
|
|
|
|
}
|
|
|
|