|
|
@ -124,8 +124,8 @@ void TQtCKStyle::polish( TQWidget* widget )
|
|
|
|
if ( d->useFilledFrameWorkaround )
|
|
|
|
if ( d->useFilledFrameWorkaround )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( TQFrame *frame = ::tqqt_cast< TQFrame* >( widget ) ) {
|
|
|
|
if ( TQFrame *frame = ::tqqt_cast< TQFrame* >( widget ) ) {
|
|
|
|
TQFrame::Shape tqshape = frame->frameShape();
|
|
|
|
TQFrame::Shape shape = frame->frameShape();
|
|
|
|
if (tqshape == TQFrame::ToolBarPanel || tqshape == TQFrame::MenuBarPanel)
|
|
|
|
if (shape == TQFrame::ToolBarPanel || shape == TQFrame::MenuBarPanel)
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -137,8 +137,8 @@ void TQtCKStyle::unPolish( TQWidget* widget )
|
|
|
|
if ( d->useFilledFrameWorkaround )
|
|
|
|
if ( d->useFilledFrameWorkaround )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if ( TQFrame *frame = ::tqqt_cast< TQFrame* >( widget ) ) {
|
|
|
|
if ( TQFrame *frame = ::tqqt_cast< TQFrame* >( widget ) ) {
|
|
|
|
TQFrame::Shape tqshape = frame->frameShape();
|
|
|
|
TQFrame::Shape shape = frame->frameShape();
|
|
|
|
if (tqshape == TQFrame::ToolBarPanel || tqshape == TQFrame::MenuBarPanel)
|
|
|
|
if (shape == TQFrame::ToolBarPanel || shape == TQFrame::MenuBarPanel)
|
|
|
|
widget->removeEventFilter(this);
|
|
|
|
widget->removeEventFilter(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -423,7 +423,7 @@ void TQtCKStyle::drawPrimitive( PrimitiveElement pe,
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void TQtCKStyle::tqdrawControl( ControlElement element,
|
|
|
|
void TQtCKStyle::drawControl( ControlElement element,
|
|
|
|
TQPainter* p,
|
|
|
|
TQPainter* p,
|
|
|
|
const TQWidget* widget,
|
|
|
|
const TQWidget* widget,
|
|
|
|
const TQRect &r,
|
|
|
|
const TQRect &r,
|
|
|
@ -437,7 +437,7 @@ void TQtCKStyle::tqdrawControl( ControlElement element,
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
// ------------------------------------------------------------------------
|
|
|
|
case CE_TabBarTab: {
|
|
|
|
case CE_TabBarTab: {
|
|
|
|
const TQTabBar* tb = (const TQTabBar*) widget;
|
|
|
|
const TQTabBar* tb = (const TQTabBar*) widget;
|
|
|
|
TQTabBar::Shape tbs = tb->tqshape();
|
|
|
|
TQTabBar::Shape tbs = tb->shape();
|
|
|
|
bool selected = flags & Style_Selected;
|
|
|
|
bool selected = flags & Style_Selected;
|
|
|
|
int x = r.x(), y=r.y(), bottom=r.bottom(), right=r.right();
|
|
|
|
int x = r.x(), y=r.y(), bottom=r.bottom(), right=r.right();
|
|
|
|
|
|
|
|
|
|
|
@ -721,7 +721,7 @@ void TQtCKStyle::tqdrawControl( ControlElement element,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
TQCommonStyle::tqdrawControl(element, p, widget, r, cg, flags, opt);
|
|
|
|
TQCommonStyle::drawControl(element, p, widget, r, cg, flags, opt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -748,7 +748,7 @@ TQRect TQtCKStyle::subRect(SubRect r, const TQWidget* widget) const
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int TQtCKStyle::tqpixelMetric(PixelMetric m, const TQWidget* widget) const
|
|
|
|
int TQtCKStyle::pixelMetric(PixelMetric m, const TQWidget* widget) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch(m)
|
|
|
|
switch(m)
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -769,7 +769,7 @@ int TQtCKStyle::tqpixelMetric(PixelMetric m, const TQWidget* widget) const
|
|
|
|
&& widget->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) )
|
|
|
|
&& widget->inherits(TQDOCKWINDOWHANDLE_OBJECT_NAME_STRING) )
|
|
|
|
return widget->fontMetrics().lineSpacing();
|
|
|
|
return widget->fontMetrics().lineSpacing();
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return TQCommonStyle::tqpixelMetric(m, widget);
|
|
|
|
return TQCommonStyle::pixelMetric(m, widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// TABS
|
|
|
|
// TABS
|
|
|
@ -779,8 +779,8 @@ int TQtCKStyle::tqpixelMetric(PixelMetric m, const TQWidget* widget) const
|
|
|
|
|
|
|
|
|
|
|
|
case PM_TabBarTabVSpace: {
|
|
|
|
case PM_TabBarTabVSpace: {
|
|
|
|
const TQTabBar * tb = (const TQTabBar *) widget;
|
|
|
|
const TQTabBar * tb = (const TQTabBar *) widget;
|
|
|
|
if ( tb->tqshape() == TQTabBar::RoundedAbove ||
|
|
|
|
if ( tb->shape() == TQTabBar::RoundedAbove ||
|
|
|
|
tb->tqshape() == TQTabBar::RoundedBelow )
|
|
|
|
tb->shape() == TQTabBar::RoundedBelow )
|
|
|
|
return 10;
|
|
|
|
return 10;
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return 4;
|
|
|
|
return 4;
|
|
|
@ -788,7 +788,7 @@ int TQtCKStyle::tqpixelMetric(PixelMetric m, const TQWidget* widget) const
|
|
|
|
|
|
|
|
|
|
|
|
case PM_TabBarTabOverlap: {
|
|
|
|
case PM_TabBarTabOverlap: {
|
|
|
|
const TQTabBar* tb = (const TQTabBar*)widget;
|
|
|
|
const TQTabBar* tb = (const TQTabBar*)widget;
|
|
|
|
TQTabBar::Shape tbs = tb->tqshape();
|
|
|
|
TQTabBar::Shape tbs = tb->shape();
|
|
|
|
|
|
|
|
|
|
|
|
if ( (tbs == TQTabBar::RoundedAbove) ||
|
|
|
|
if ( (tbs == TQTabBar::RoundedAbove) ||
|
|
|
|
(tbs == TQTabBar::RoundedBelow) )
|
|
|
|
(tbs == TQTabBar::RoundedBelow) )
|
|
|
@ -853,10 +853,10 @@ int TQtCKStyle::tqpixelMetric(PixelMetric m, const TQWidget* widget) const
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
|
|
|
|
|
|
|
|
case PM_PopupMenuScrollerHeight:
|
|
|
|
case PM_PopupMenuScrollerHeight:
|
|
|
|
return tqpixelMetric( PM_ScrollBarExtent, 0);
|
|
|
|
return pixelMetric( PM_ScrollBarExtent, 0);
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return TQCommonStyle::tqpixelMetric( m, widget );
|
|
|
|
return TQCommonStyle::pixelMetric( m, widget );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -873,7 +873,7 @@ static TQListViewItem* nextVisibleSibling(TQListViewItem* item)
|
|
|
|
return sibling;
|
|
|
|
return sibling;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void TQtCKStyle::tqdrawComplexControl( ComplexControl control,
|
|
|
|
void TQtCKStyle::drawComplexControl( ComplexControl control,
|
|
|
|
TQPainter* p,
|
|
|
|
TQPainter* p,
|
|
|
|
const TQWidget* widget,
|
|
|
|
const TQWidget* widget,
|
|
|
|
const TQRect &r,
|
|
|
|
const TQRect &r,
|
|
|
@ -996,7 +996,7 @@ void TQtCKStyle::tqdrawComplexControl( ComplexControl control,
|
|
|
|
|
|
|
|
|
|
|
|
// Draw the tickmarks
|
|
|
|
// Draw the tickmarks
|
|
|
|
if (controls & SC_SliderTickmarks)
|
|
|
|
if (controls & SC_SliderTickmarks)
|
|
|
|
TQCommonStyle::tqdrawComplexControl(control, &p2, widget,
|
|
|
|
TQCommonStyle::drawComplexControl(control, &p2, widget,
|
|
|
|
r, cg, flags, SC_SliderTickmarks, active, opt);
|
|
|
|
r, cg, flags, SC_SliderTickmarks, active, opt);
|
|
|
|
|
|
|
|
|
|
|
|
// Draw the slider handle
|
|
|
|
// Draw the slider handle
|
|
|
@ -1022,7 +1022,7 @@ void TQtCKStyle::tqdrawComplexControl( ComplexControl control,
|
|
|
|
|
|
|
|
|
|
|
|
// Paint the icon and text.
|
|
|
|
// Paint the icon and text.
|
|
|
|
if ( controls & SC_ListView )
|
|
|
|
if ( controls & SC_ListView )
|
|
|
|
TQCommonStyle::tqdrawComplexControl( control, p, widget, r, cg, flags, controls, active, opt );
|
|
|
|
TQCommonStyle::drawComplexControl( control, p, widget, r, cg, flags, controls, active, opt );
|
|
|
|
|
|
|
|
|
|
|
|
// If we're have a branch or are expanded...
|
|
|
|
// If we're have a branch or are expanded...
|
|
|
|
if ( controls & (SC_ListViewBranch | SC_ListViewExpand) )
|
|
|
|
if ( controls & (SC_ListViewBranch | SC_ListViewExpand) )
|
|
|
@ -1162,7 +1162,7 @@ void TQtCKStyle::tqdrawComplexControl( ComplexControl control,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
TQCommonStyle::tqdrawComplexControl( control, p, widget, r, cg,
|
|
|
|
TQCommonStyle::drawComplexControl( control, p, widget, r, cg,
|
|
|
|
flags, controls, active, opt );
|
|
|
|
flags, controls, active, opt );
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1201,7 +1201,7 @@ TQRect TQtCKStyle::querySubControlMetrics( ComplexControl control,
|
|
|
|
const TQScrollBar *sb = (const TQScrollBar*)widget;
|
|
|
|
const TQScrollBar *sb = (const TQScrollBar*)widget;
|
|
|
|
bool horizontal = sb->orientation() == Qt::Horizontal;
|
|
|
|
bool horizontal = sb->orientation() == Qt::Horizontal;
|
|
|
|
int sliderstart = sb->sliderStart();
|
|
|
|
int sliderstart = sb->sliderStart();
|
|
|
|
int sbextent = tqpixelMetric(PM_ScrollBarExtent, widget);
|
|
|
|
int sbextent = pixelMetric(PM_ScrollBarExtent, widget);
|
|
|
|
int maxlen = (horizontal ? sb->width() : sb->height())
|
|
|
|
int maxlen = (horizontal ? sb->width() : sb->height())
|
|
|
|
- (sbextent * (threeButtonScrollBar ? 3 : 2));
|
|
|
|
- (sbextent * (threeButtonScrollBar ? 3 : 2));
|
|
|
|
int sliderlen;
|
|
|
|
int sliderlen;
|
|
|
@ -1212,7 +1212,7 @@ TQRect TQtCKStyle::querySubControlMetrics( ComplexControl control,
|
|
|
|
uint range = sb->maxValue() - sb->minValue();
|
|
|
|
uint range = sb->maxValue() - sb->minValue();
|
|
|
|
sliderlen = (sb->pageStep() * maxlen) / (range + sb->pageStep());
|
|
|
|
sliderlen = (sb->pageStep() * maxlen) / (range + sb->pageStep());
|
|
|
|
|
|
|
|
|
|
|
|
int slidermin = tqpixelMetric( PM_ScrollBarSliderMin, widget );
|
|
|
|
int slidermin = pixelMetric( PM_ScrollBarSliderMin, widget );
|
|
|
|
if ( sliderlen < slidermin || range > INT_MAX / 2 )
|
|
|
|
if ( sliderlen < slidermin || range > INT_MAX / 2 )
|
|
|
|
sliderlen = slidermin;
|
|
|
|
sliderlen = slidermin;
|
|
|
|
if ( sliderlen > maxlen )
|
|
|
|
if ( sliderlen > maxlen )
|
|
|
@ -1602,7 +1602,7 @@ TQPixmap TQtCKStyle::stylePixmap( StylePixmap stylepixmap,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int TQtCKStyle::tqstyleHint( StyleHint sh, const TQWidget* w,
|
|
|
|
int TQtCKStyle::styleHint( StyleHint sh, const TQWidget* w,
|
|
|
|
const TQStyleOption &opt, TQStyleHintReturn* shr) const
|
|
|
|
const TQStyleOption &opt, TQStyleHintReturn* shr) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
switch (sh)
|
|
|
|
switch (sh)
|
|
|
@ -1617,7 +1617,7 @@ int TQtCKStyle::tqstyleHint( StyleHint sh, const TQWidget* w,
|
|
|
|
return d->menuAltKeyNavigation ? 1 : 0;
|
|
|
|
return d->menuAltKeyNavigation ? 1 : 0;
|
|
|
|
|
|
|
|
|
|
|
|
case SH_PopupMenu_SubMenuPopupDelay:
|
|
|
|
case SH_PopupMenu_SubMenuPopupDelay:
|
|
|
|
if ( tqstyleHint( SH_PopupMenu_SloppySubMenus, w ) )
|
|
|
|
if ( styleHint( SH_PopupMenu_SloppySubMenus, w ) )
|
|
|
|
return TQMIN( 100, d->popupMenuDelay );
|
|
|
|
return TQMIN( 100, d->popupMenuDelay );
|
|
|
|
else
|
|
|
|
else
|
|
|
|
return d->popupMenuDelay;
|
|
|
|
return d->popupMenuDelay;
|
|
|
@ -1653,7 +1653,7 @@ int TQtCKStyle::tqstyleHint( StyleHint sh, const TQWidget* w,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return TQCommonStyle::tqstyleHint(sh, w, opt, shr);
|
|
|
|
return TQCommonStyle::styleHint(sh, w, opt, shr);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1666,7 +1666,7 @@ bool TQtCKStyle::eventFilter( TQObject* object, TQEvent* event )
|
|
|
|
// ensure that the filled frame contents are properly painted.
|
|
|
|
// ensure that the filled frame contents are properly painted.
|
|
|
|
// We essentially modify the paintEvent's rect to include the
|
|
|
|
// We essentially modify the paintEvent's rect to include the
|
|
|
|
// panel border, which also paints the widget's interior.
|
|
|
|
// panel border, which also paints the widget's interior.
|
|
|
|
// This is nasty, but I see no other way to properly tqrepaint
|
|
|
|
// This is nasty, but I see no other way to properly repaint
|
|
|
|
// filled frames in all TQMenuBars and TQToolBars.
|
|
|
|
// filled frames in all TQMenuBars and TQToolBars.
|
|
|
|
// -- Karol.
|
|
|
|
// -- Karol.
|
|
|
|
TQFrame *frame = 0;
|
|
|
|
TQFrame *frame = 0;
|
|
|
|