summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <[email protected]>2012-10-31 12:39:49 -0500
committerTimothy Pearson <[email protected]>2012-10-31 12:39:49 -0500
commit2fce73142f9e5c46c909934b03bca5a30512a3d0 (patch)
tree3b467ac5f1f85ff95e36c8f9de08f1954b1017d6
parent0836d4649ca26cc4e6e867ca5a4a3eafd995f807 (diff)
downloadtqt3-2fce73142f9e5c46c909934b03bca5a30512a3d0.tar.gz
tqt3-2fce73142f9e5c46c909934b03bca5a30512a3d0.zip
Automated update from Qt3
-rw-r--r--src/kernel/ntqstyle.h8
-rw-r--r--src/styles/ntqcompactstyle.h2
-rw-r--r--src/styles/ntqsgistyle.h2
-rw-r--r--src/styles/qcompactstyle.cpp51
-rw-r--r--src/styles/qmotifplusstyle.cpp44
-rw-r--r--src/styles/qmotifstyle.cpp60
-rw-r--r--src/styles/qsgistyle.cpp66
-rw-r--r--src/styles/qwindowsstyle.cpp43
8 files changed, 243 insertions, 33 deletions
diff --git a/src/kernel/ntqstyle.h b/src/kernel/ntqstyle.h
index a65f62246..994eff811 100644
--- a/src/kernel/ntqstyle.h
+++ b/src/kernel/ntqstyle.h
@@ -835,6 +835,11 @@ public:
PM_MenuBarItemSpacing,
PM_ToolBarItemSpacing,
+ PM_MenuIndicatorFrameHBorder,
+ PM_MenuIndicatorFrameVBorder,
+ PM_MenuIconIndicatorFrameHBorder,
+ PM_MenuIconIndicatorFrameVBorder,
+
PM_ArrowSize,
// do not add any values below/greater than this
@@ -1036,6 +1041,9 @@ public:
// bool - hide underlined accelerators uless Alt key is currently down
SH_HideUnderlineAcceleratorWhenAltUp,
+ // int - width of menu check column
+ SH_MenuIndicatorColumnWidth,
+
// do not add any values below/greater than this
SH_CustomBase = 0xf0000000
};
diff --git a/src/styles/ntqcompactstyle.h b/src/styles/ntqcompactstyle.h
index 8511992da..cc8c7e947 100644
--- a/src/styles/ntqcompactstyle.h
+++ b/src/styles/ntqcompactstyle.h
@@ -72,6 +72,8 @@ public:
void drawControl( ControlElement element, TQPainter *p, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQRect &r,
const TQColorGroup &cg, SFlags how = Style_Default, const TQStyleOption& = TQStyleOption::Default, const TQWidget *w = 0 );
+ int styleHint(StyleHint sh, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQStyleOption &, TQStyleHintReturn *, const TQWidget *) const;
+
private: // Disabled copy constructor and operator=
#if defined(TQ_DISABLE_COPY)
TQCompactStyle( const TQCompactStyle & );
diff --git a/src/styles/ntqsgistyle.h b/src/styles/ntqsgistyle.h
index 73be2ae84..bca63f282 100644
--- a/src/styles/ntqsgistyle.h
+++ b/src/styles/ntqsgistyle.h
@@ -124,6 +124,8 @@ public:
const TQStyleOption& = TQStyleOption::Default,
const TQWidget *widget = 0 ) const;
+ int styleHint(StyleHint sh, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQStyleOption &, TQStyleHintReturn *, const TQWidget *) const;
+
bool objectEventHandler( TQStyleControlElementData ceData, ControlElementFlags elementFlags, void* source, TQEvent *e );
private:
diff --git a/src/styles/qcompactstyle.cpp b/src/styles/qcompactstyle.cpp
index 54b120851..f2038a38c 100644
--- a/src/styles/qcompactstyle.cpp
+++ b/src/styles/qcompactstyle.cpp
@@ -67,6 +67,12 @@ int TQCompactStyle::pixelMetric( PixelMetric metric, TQStyleControlElementData c
case PM_MaximumDragDistance:
ret = -1;
break;
+ case PM_MenuIndicatorFrameHBorder:
+ case PM_MenuIndicatorFrameVBorder:
+ case PM_MenuIconIndicatorFrameHBorder:
+ case PM_MenuIconIndicatorFrameVBorder:
+ ret = 0;
+ break;
default:
ret = TQWindowsStyle::pixelMetric( metric, ceData, elementFlags, widget );
break;
@@ -189,7 +195,7 @@ void TQCompactStyle::drawControl( ControlElement element, TQPainter *p, TQStyleC
return;
if ( mi->isChecked() ) {
- drawPrimitive( PE_MenuItemIndicatorFrame, p, ceData, elementFlags, TQRect(x, y, checkcol, h), itemg, flags, opt );
+ drawPrimitive( PE_MenuItemIndicatorFrame, p, ceData, elementFlags, r, itemg, flags, opt );
} else if ( !act ) {
p->fillRect(x, y, checkcol , h,
g.brush( TQColorGroup::Button ));
@@ -208,7 +214,7 @@ void TQCompactStyle::drawControl( ControlElement element, TQPainter *p, TQStyleC
int pixh = pixmap.height();
if ( act && !dis ) {
if ( !mi->isChecked() )
- drawPrimitive( PE_MenuItemIndicatorIconFrame, p, ceData, elementFlags, TQRect(x, y, checkcol, h), itemg, flags, opt );
+ drawPrimitive( PE_MenuItemIndicatorIconFrame, p, ceData, elementFlags, r, itemg, flags, opt );
}
TQRect cr( x, y, checkcol, h );
TQRect pmr( 0, 0, pixw, pixh );
@@ -221,7 +227,7 @@ void TQCompactStyle::drawControl( ControlElement element, TQPainter *p, TQStyleC
p->fillRect( x+checkcol + 1, y, w - checkcol - 1, h, fill);
} else if ( checkable ) { // just "checking"...
if ( mi->isChecked() ) {
- drawPrimitive( PE_MenuItemIndicatorCheck, p, ceData, elementFlags, TQRect(x, y, checkcol, h), itemg, flags, opt );
+ drawPrimitive( PE_MenuItemIndicatorCheck, p, ceData, elementFlags, r, itemg, flags, opt );
}
}
@@ -322,21 +328,27 @@ void TQCompactStyle::drawPrimitive( PrimitiveElement pe,
switch (pe) {
case PE_MenuItemIndicatorFrame:
{
+ int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL);
+
if ( act && !dis ) {
- qDrawShadePanel( p, x, y, w, h, cg, TRUE, 1, &cg.brush( TQColorGroup::Button ) );
+ qDrawShadePanel( p, x, y, checkcol, h, cg, TRUE, 1, &cg.brush( TQColorGroup::Button ) );
} else {
- qDrawShadePanel( p, x, y, w, h, cg, TRUE, 1, &cg.brush( TQColorGroup::Midlight ) );
+ qDrawShadePanel( p, x, y, checkcol, h, cg, TRUE, 1, &cg.brush( TQColorGroup::Midlight ) );
}
}
break;
case PE_MenuItemIndicatorIconFrame:
{
- qDrawShadePanel( p, x, y, w, h, cg, FALSE, 1, &cg.brush( TQColorGroup::Button ) );
+ int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL);
+
+ qDrawShadePanel( p, x, y, checkcol, h, cg, FALSE, 1, &cg.brush( TQColorGroup::Button ) );
}
break;
case PE_MenuItemIndicatorCheck:
{
- int mw = w + motifItemFrame;
+ int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL);
+
+ int mw = checkcol + motifItemFrame;
int mh = h - 2*motifItemFrame;
SFlags cflags = Style_Default;
@@ -355,4 +367,29 @@ void TQCompactStyle::drawPrimitive( PrimitiveElement pe,
}
}
+/*! \reimp */
+int TQCompactStyle::styleHint(StyleHint sh, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQStyleOption &opt, TQStyleHintReturn *returnData, const TQWidget *w) const
+{
+ int ret;
+
+ switch (sh) {
+ case SH_MenuIndicatorColumnWidth:
+ {
+ int maxpmw = opt.maxIconWidth();
+ bool checkable = (elementFlags & CEF_IsCheckable);
+
+ if ( checkable )
+ maxpmw = TQMAX( maxpmw, 8 ); // space for the checkmarks
+
+ ret = maxpmw;
+ }
+ break;
+ default:
+ ret = TQWindowsStyle::styleHint(sh, ceData, elementFlags, opt, returnData, w);
+ break;
+ }
+
+ return ret;
+}
+
#endif
diff --git a/src/styles/qmotifplusstyle.cpp b/src/styles/qmotifplusstyle.cpp
index d0b7fe980..6b56a3462 100644
--- a/src/styles/qmotifplusstyle.cpp
+++ b/src/styles/qmotifplusstyle.cpp
@@ -263,6 +263,13 @@ int TQMotifPlusStyle::pixelMetric(PixelMetric metric, TQStyleControlElementData
ret = 11;
break;
+ case PM_MenuIndicatorFrameHBorder:
+ case PM_MenuIndicatorFrameVBorder:
+ case PM_MenuIconIndicatorFrameHBorder:
+ case PM_MenuIconIndicatorFrameVBorder:
+ ret = 2;
+ break;
+
default:
ret = TQMotifStyle::pixelMetric(metric, ceData, elementFlags, widget);
break;
@@ -647,11 +654,30 @@ void TQMotifPlusStyle::drawPrimitive( PrimitiveElement pe,
break;
}
+ case PE_MenuItemIndicatorFrame:
+ {
+ // Draw nothing
+ break;
+ }
+ case PE_MenuItemIndicatorIconFrame:
+ {
+ int x, y, w, h;
+ r.rect(&x, &y, &w, &h);
+ int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL);
+
+ TQRect vrect = visualRect( TQRect( x+2, y+2, checkcol, h-2 ), r );
+
+ qDrawShadePanel( p, vrect.x(), y+2, checkcol, h-2*2, cg, TRUE, 1, &cg.brush( TQColorGroup::Midlight ) );
+ break;
+ }
+
case PE_MenuItemIndicatorCheck:
{
int x, y, w, h;
r.rect(&x, &y, &w, &h);
- TQRect vrect = visualRect( TQRect( x+2, y+2, w, h-2 ), r );
+ int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL);
+
+ TQRect vrect = visualRect( TQRect( x+2, y+2, checkcol, h-2 ), r );
SFlags cflags = Style_Default;
if (! dis)
@@ -820,8 +846,7 @@ void TQMotifPlusStyle::drawControl( ControlElement element,
TQRect vrect = visualRect( TQRect( x+2, y+2, checkcol, h-2 ), r );
if ( mi->isChecked() ) {
if ( mi->iconSet() ) {
- qDrawShadePanel( p, vrect.x(), y+2, checkcol, h-2*2,
- cg, TRUE, 1, &cg.brush( TQColorGroup::Midlight ) );
+ drawPrimitive(PE_MenuItemIndicatorIconFrame, p, ceData, elementFlags, r, cg, flags, opt);
}
} else if ( !act ) {
p->fillRect(vrect,
@@ -853,7 +878,7 @@ void TQMotifPlusStyle::drawControl( ControlElement element,
} else if (checkable) {
if (mi->isChecked()) {
- drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, TQRect(x, y, checkcol, h), cg, flags);
+ drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, r, cg, flags, opt);
}
}
@@ -1582,6 +1607,17 @@ int TQMotifPlusStyle::styleHint(StyleHint hint,
case SH_PopupMenu_MouseTracking:
ret = 1;
break;
+ case SH_MenuIndicatorColumnWidth:
+ {
+ int maxpmw = opt.maxIconWidth();
+ bool checkable = (elementFlags & CEF_IsCheckable);
+
+ if (checkable)
+ maxpmw = TQMAX(maxpmw, 15);
+
+ ret = maxpmw;
+ break;
+ }
default:
ret = TQMotifStyle::styleHint(hint, ceData, elementFlags, opt, returnData, widget);
break;
diff --git a/src/styles/qmotifstyle.cpp b/src/styles/qmotifstyle.cpp
index ea4da2073..3225e0e29 100644
--- a/src/styles/qmotifstyle.cpp
+++ b/src/styles/qmotifstyle.cpp
@@ -770,22 +770,44 @@ void TQMotifStyle::drawPrimitive( PrimitiveElement pe,
&cg.brush(TQColorGroup::Mid));
break;
+ case PE_MenuItemIndicatorFrame:
+ {
+ // Draw nothing
+ break;
+ }
+
+ case PE_MenuItemIndicatorIconFrame:
+ {
+ int x, y, w, h;
+ r.rect( &x, &y, &w, &h );
+ int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL);
+
+ TQRect vrect = visualRect( TQRect( x+motifItemFrame, y+motifItemFrame, checkcol, h-2*motifItemFrame ), r );
+ int xvis = vrect.x();
+
+ qDrawShadePanel( p, xvis, y+motifItemFrame, checkcol, h-2*motifItemFrame, cg, TRUE, 1, &cg.brush( TQColorGroup::Midlight ) );
+ break;
+ }
+
case PE_MenuItemIndicatorCheck:
{
int x, y, w, h;
r.rect( &x, &y, &w, &h );
- TQRect vrect = visualRect( TQRect( x+motifItemFrame, y+motifItemFrame, w, h-2*motifItemFrame ), r );
+ int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL);
+
+ TQRect vrect = visualRect( TQRect( x+motifItemFrame, y+motifItemFrame, checkcol, h-2*motifItemFrame ), r );
int xvis = vrect.x();
- int mw = w;
+ int mw = checkcol;
int mh = h - 2*motifItemFrame;
SFlags cflags = Style_Default;
- if (! dis)
- cflags |= Style_Enabled;
- if (act)
- cflags |= Style_On;
+ if (! dis)
+ cflags |= Style_Enabled;
+ if (act)
+ cflags |= Style_On;
- drawPrimitive(PE_CheckMark, p, ceData, elementFlags, TQRect(xvis, y+motifItemFrame, mw, mh), cg, cflags);
+ drawPrimitive(PE_CheckMark, p, ceData, elementFlags, TQRect(xvis, y+motifItemFrame, mw, mh), cg, cflags);
+ break;
}
default:
@@ -1077,8 +1099,7 @@ void TQMotifStyle::drawControl( ControlElement element,
int xvis = vrect.x();
if ( mi->isChecked() ) {
if ( mi->iconSet() ) {
- qDrawShadePanel( p, xvis, y+motifItemFrame, checkcol, h-2*motifItemFrame,
- cg, TRUE, 1, &cg.brush( TQColorGroup::Midlight ) );
+ drawPrimitive(PE_MenuItemIndicatorIconFrame, p, ceData, elementFlags, r, cg, flags, opt);
}
} else if ( !act ) {
p->fillRect(xvis, y+motifItemFrame, checkcol, h-2*motifItemFrame,
@@ -1104,7 +1125,7 @@ void TQMotifStyle::drawControl( ControlElement element,
} else if ( checkable ) { // just "checking"...
if ( mi->isChecked() ) {
- drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, TQRect(x, y, checkcol, h), cg, flags);
+ drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, r, cg, flags, opt);
}
}
@@ -1556,6 +1577,13 @@ int TQMotifStyle::pixelMetric( PixelMetric metric, TQStyleControlElementData ceD
ret = 13;
break;
+ case PM_MenuIndicatorFrameHBorder:
+ case PM_MenuIndicatorFrameVBorder:
+ case PM_MenuIconIndicatorFrameHBorder:
+ case PM_MenuIconIndicatorFrameVBorder:
+ ret = motifItemFrame;
+ break;
+
default:
ret = TQCommonStyle::pixelMetric( metric, ceData, elementFlags, widget );
break;
@@ -2364,6 +2392,18 @@ int TQMotifStyle::styleHint(StyleHint hint,
ret = 0;
break;
+ case SH_MenuIndicatorColumnWidth:
+ {
+ int maxpmw = opt.maxIconWidth();
+ bool checkable = (elementFlags & CEF_IsCheckable);
+
+ if ( checkable )
+ maxpmw = TQMAX( maxpmw, motifCheckMarkSpace );
+
+ ret = maxpmw;
+ break;
+ }
+
default:
ret = TQCommonStyle::styleHint(hint, ceData, elementFlags, opt, returnData, widget);
break;
diff --git a/src/styles/qsgistyle.cpp b/src/styles/qsgistyle.cpp
index 8110f66de..aa00c57f0 100644
--- a/src/styles/qsgistyle.cpp
+++ b/src/styles/qsgistyle.cpp
@@ -398,6 +398,14 @@ int TQSGIStyle::pixelMetric( PixelMetric metric, TQStyleControlElementData ceDat
case PM_SplitterWidth:
return TQMAX( 10, TQApplication::globalStrut().width() );
+ case PM_MenuIndicatorFrameHBorder:
+ return (sgiItemFrame+2);
+ case PM_MenuIndicatorFrameVBorder:
+ return (sgiItemFrame+4);
+ case PM_MenuIconIndicatorFrameHBorder:
+ case PM_MenuIconIndicatorFrameVBorder:
+ return sgiItemFrame;
+
default:
break;
}
@@ -881,7 +889,7 @@ void TQSGIStyle::drawPrimitive( PrimitiveElement pe,
}
break;
- case PE_MenuItemIndicatorCheck:
+ case PE_MenuItemIndicatorFrame:
{
int x, y, w, h;
r.rect(&x, &y, &w, &h);
@@ -895,6 +903,32 @@ void TQSGIStyle::drawPrimitive( PrimitiveElement pe,
TQRect er( x+sgiItemFrame+1, y+sgiItemFrame+3, pixelMetric(PM_IndicatorWidth, ceData, elementFlags), pixelMetric(PM_IndicatorHeight, ceData, elementFlags) );
er.addCoords( 1, 1, -1, -1 );
drawPrimitive( PE_ButtonBevel, p, ceData, elementFlags, er, cg, cflags, opt );
+ }
+ break;
+
+ case PE_MenuItemIndicatorIconFrame:
+ {
+ int x, y, w, h;
+ r.rect(&x, &y, &w, &h);
+ int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL);
+
+ drawPanel( p, x+sgiItemFrame, y+sgiItemFrame, checkcol, h-2*sgiItemFrame, cg, TRUE, 1, &cg.brush( TQColorGroup::Light ) );
+ }
+ break;
+
+ case PE_MenuItemIndicatorCheck:
+ {
+ int x, y, w, h;
+ r.rect(&x, &y, &w, &h);
+
+ SFlags cflags = Style_Default;
+ if (! dis)
+ cflags |= Style_Enabled;
+ if (act)
+ cflags |= Style_On;
+
+ TQRect er( x+sgiItemFrame+1, y+sgiItemFrame+3, pixelMetric(PM_IndicatorWidth, ceData, elementFlags), pixelMetric(PM_IndicatorHeight, ceData, elementFlags) );
+ er.addCoords( 1, 1, -1, -1 );
er.addCoords( 0, 1, 1, 1 );
drawPrimitive( PE_CheckMark, p, ceData, elementFlags, er, cg, cflags | Style_On, opt );
}
@@ -1012,8 +1046,7 @@ void TQSGIStyle::drawControl( ControlElement element,
if ( mi->isChecked() ) {
if ( mi->iconSet() ) {
- drawPanel( p, x+sgiItemFrame, y+sgiItemFrame, checkcol, h-2*sgiItemFrame,
- cg, TRUE, 1, &cg.brush( TQColorGroup::Light ) );
+ drawPrimitive(PE_MenuItemIndicatorIconFrame, p, ceData, elementFlags, r, cg, flags, opt);
}
} else {
if ( !act )
@@ -1041,7 +1074,8 @@ void TQSGIStyle::drawControl( ControlElement element,
} else {
if ( checkable ) {
if ( mi->isChecked() ) {
- drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, TQRect(x, y, w, h), cg, flags);
+ drawPrimitive(PE_MenuItemIndicatorFrame, p, ceData, elementFlags, r, cg, flags, opt);
+ drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, r, cg, flags, opt);
}
}
}
@@ -1477,4 +1511,28 @@ TQRect TQSGIStyle::querySubControlMetrics( ComplexControl control,
return TQMotifStyle::querySubControlMetrics( control, ceData, elementFlags, sub, opt, widget );
}
+/*! \reimp */
+int TQSGIStyle::styleHint(StyleHint sh, TQStyleControlElementData ceData, ControlElementFlags elementFlags, const TQStyleOption &opt, TQStyleHintReturn *returnData, const TQWidget *w) const
+{
+ int ret;
+
+ switch (sh) {
+ case SH_MenuIndicatorColumnWidth:
+ {
+ int maxpmw = opt.maxIconWidth();
+ bool checkable = ( elementFlags & CEF_IsCheckable );
+
+ if ( checkable )
+ maxpmw = TQMAX( maxpmw, sgiCheckMarkSpace );
+ ret = maxpmw;
+ }
+ break;
+ default:
+ ret = TQMotifStyle::styleHint(sh, ceData, elementFlags, opt, returnData, w);
+ break;
+ }
+
+ return ret;
+}
+
#endif // QT_NO_STYLE_SGI
diff --git a/src/styles/qwindowsstyle.cpp b/src/styles/qwindowsstyle.cpp
index b96a04b85..1c049b0d8 100644
--- a/src/styles/qwindowsstyle.cpp
+++ b/src/styles/qwindowsstyle.cpp
@@ -575,12 +575,13 @@ void TQWindowsStyle::drawPrimitive( PrimitiveElement pe,
{
int x, y, w, h;
r.rect( &x, &y, &w, &h );
+ int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL);
- TQRect vrect = visualRect( TQRect( x, y, w, h ), r );
+ TQRect vrect = visualRect( TQRect( x, y, checkcol, h ), r );
int xvis = vrect.x();
if ( act && !dis ) {
- qDrawShadePanel( p, xvis, y, w, h, cg, TRUE, 1, &cg.brush( TQColorGroup::Button ) );
+ qDrawShadePanel( p, xvis, y, checkcol, h, cg, TRUE, 1, &cg.brush( TQColorGroup::Button ) );
}
else {
TQBrush fill( cg.light(), Dense4Pattern );
@@ -589,7 +590,7 @@ void TQWindowsStyle::drawPrimitive( PrimitiveElement pe,
// a consistent look
TQPoint origin = p->brushOrigin();
p->setBrushOrigin( xvis, y );
- qDrawShadePanel( p, xvis, y, w, h, cg, TRUE, 1, &fill );
+ qDrawShadePanel( p, xvis, y, checkcol, h, cg, TRUE, 1, &fill );
// restore the previous brush origin
p->setBrushOrigin( origin );
}
@@ -600,8 +601,9 @@ void TQWindowsStyle::drawPrimitive( PrimitiveElement pe,
{
int x, y, w, h;
r.rect( &x, &y, &w, &h );
+ int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL);
- TQRect vrect = visualRect( TQRect( x, y, w, h ), r );
+ TQRect vrect = visualRect( TQRect( x, y, checkcol, h ), r );
int xvis = vrect.x();
qDrawShadePanel( p, xvis, y, w, h, cg, FALSE, 1, &cg.brush( TQColorGroup::Button ) );
@@ -612,6 +614,7 @@ void TQWindowsStyle::drawPrimitive( PrimitiveElement pe,
{
int x, y, w, h;
r.rect( &x, &y, &w, &h );
+ int checkcol = styleHint(SH_MenuIndicatorColumnWidth, ceData, elementFlags, opt, NULL, NULL);
int xp = x + windowsItemFrame;
@@ -621,7 +624,7 @@ void TQWindowsStyle::drawPrimitive( PrimitiveElement pe,
if (act)
cflags |= Style_On;
- drawPrimitive(PE_CheckMark, p, ceData, elementFlags, visualRect( TQRect(xp, y + windowsItemFrame, w - 2*windowsItemFrame, h - 2*windowsItemFrame), r ), cg, cflags);
+ drawPrimitive(PE_CheckMark, p, ceData, elementFlags, visualRect( TQRect(xp, y + windowsItemFrame, checkcol - 2*windowsItemFrame, h - 2*windowsItemFrame), r ), cg, cflags);
}
break;
@@ -866,7 +869,7 @@ void TQWindowsStyle::drawControl( ControlElement element,
TQRect vrect = visualRect( TQRect( xpos, y, checkcol, h ), r );
int xvis = vrect.x();
if ( mi->isChecked() ) {
- drawPrimitive(PE_MenuItemIndicatorFrame, p, ceData, elementFlags, TQRect(x, y, checkcol, h), cg, flags);
+ drawPrimitive(PE_MenuItemIndicatorFrame, p, ceData, elementFlags, r, cg, flags, opt);
} else if (! act)
p->fillRect(xvis, y, checkcol , h, cg.brush( TQColorGroup::Button ));
@@ -882,7 +885,7 @@ void TQWindowsStyle::drawControl( ControlElement element,
int pixw = pixmap.width();
int pixh = pixmap.height();
if ( act && !dis && !mi->isChecked() )
- drawPrimitive(PE_MenuItemIndicatorIconFrame, p, ceData, elementFlags, TQRect(x, y, checkcol, h), cg, flags);
+ drawPrimitive(PE_MenuItemIndicatorIconFrame, p, ceData, elementFlags, r, cg, flags, opt);
TQRect pmr( 0, 0, pixw, pixh );
pmr.moveCenter( vrect.center() );
p->setPen( cg.text() );
@@ -895,7 +898,7 @@ void TQWindowsStyle::drawControl( ControlElement element,
p->fillRect( visualRect( TQRect( xp, y, w - checkcol - 1, h ), r ), fill);
} else if ( checkable ) { // just "checking"...
if ( mi->isChecked() ) {
- drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, TQRect(x, y, checkcol, h), cg, flags);
+ drawPrimitive(PE_MenuItemIndicatorCheck, p, ceData, elementFlags, r, cg, flags, opt);
}
}
@@ -1073,6 +1076,13 @@ int TQWindowsStyle::pixelMetric(PixelMetric metric, TQStyleControlElementData ce
ret = TQMAX( 6, TQApplication::globalStrut().width() );
break;
+ case PM_MenuIndicatorFrameHBorder:
+ case PM_MenuIndicatorFrameVBorder:
+ case PM_MenuIconIndicatorFrameHBorder:
+ case PM_MenuIconIndicatorFrameVBorder:
+ ret = windowsItemFrame;
+ break;
+
default:
ret = TQCommonStyle::pixelMetric(metric, ceData, elementFlags, widget);
break;
@@ -1996,6 +2006,23 @@ int TQWindowsStyle::styleHint( StyleHint hint,
ret = 0;
break;
+ case SH_MenuIndicatorColumnWidth:
+ {
+ int maxpmw = opt.maxIconWidth();
+ bool checkable = ( elementFlags & CEF_IsCheckable );
+
+ if ( checkable ) {
+ // space for the checkmarks
+ if (use2000style)
+ maxpmw = TQMAX( maxpmw, 20 );
+ else
+ maxpmw = TQMAX( maxpmw, 12 );
+ }
+
+ ret = maxpmw;
+ break;
+ }
+
default:
ret = TQCommonStyle::styleHint(hint, ceData, elementFlags, opt, returnData, widget);
break;