|
|
@ -96,7 +96,7 @@ static const int itemHMargin = 3;
|
|
|
|
static const int itemVMargin = 0;
|
|
|
|
static const int itemVMargin = 0;
|
|
|
|
static const int arrowHMargin = 6;
|
|
|
|
static const int arrowHMargin = 6;
|
|
|
|
static const int rightBorder = 12;
|
|
|
|
static const int rightBorder = 12;
|
|
|
|
static const char* kdeToolbarWidget = "kde toolbar widget";
|
|
|
|
static const char* kdeToolbarWidget = "tde toolbar widget";
|
|
|
|
const int smallButMaxW = 27;
|
|
|
|
const int smallButMaxW = 27;
|
|
|
|
const int smallButMaxH = 20;
|
|
|
|
const int smallButMaxH = 20;
|
|
|
|
|
|
|
|
|
|
|
@ -108,7 +108,7 @@ MandrivaStyle::MandrivaColorData::~MandrivaColorData()
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
// ---------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
MandrivaStyle::MandrivaStyle( )
|
|
|
|
MandrivaStyle::MandrivaStyle( )
|
|
|
|
: KStyle( AllowMenuTransparency | FilledFrameWorkaround, WindowsStyleScrollBar )
|
|
|
|
: TDEStyle( AllowMenuTransparency | FilledFrameWorkaround, WindowsStyleScrollBar )
|
|
|
|
, m_dataCache (), formMode( false ),kickerMode(false)
|
|
|
|
, m_dataCache (), formMode( false ),kickerMode(false)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
hoverWidget = 0L;
|
|
|
|
hoverWidget = 0L;
|
|
|
@ -381,7 +381,7 @@ void MandrivaStyle::polish(TQWidget* widget)
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
widget->setBackgroundMode( TQWidget::PaletteBackground );
|
|
|
|
widget->setBackgroundMode( TQWidget::PaletteBackground );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( widget->inherits( "KToolBarSeparator" ) || widget->inherits( "TQToolBarSeparator" ) )
|
|
|
|
else if ( widget->inherits( "TDEToolBarSeparator" ) || widget->inherits( "TQToolBarSeparator" ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
widget->setBackgroundMode( TQWidget::PaletteBackground );
|
|
|
|
widget->setBackgroundMode( TQWidget::PaletteBackground );
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -391,7 +391,7 @@ void MandrivaStyle::polish(TQWidget* widget)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( widget->parentWidget() &&
|
|
|
|
else if ( widget->parentWidget() &&
|
|
|
|
( ( widget->inherits( "TQListBox" ) && widget->parentWidget()->inherits( "TQComboBox" ) )
|
|
|
|
( ( widget->inherits( "TQListBox" ) && widget->parentWidget()->inherits( "TQComboBox" ) )
|
|
|
|
|| widget->inherits( "KCompletionBox" ) ) )
|
|
|
|
|| widget->inherits( "TDECompletionBox" ) ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQListBox* listbox = (TQListBox*) widget;
|
|
|
|
TQListBox* listbox = (TQListBox*) widget;
|
|
|
|
listbox->setLineWidth( 1 );
|
|
|
|
listbox->setLineWidth( 1 );
|
|
|
@ -403,7 +403,7 @@ void MandrivaStyle::polish(TQWidget* widget)
|
|
|
|
widget->setBackgroundMode( NoBackground ); // We paint the whole background.
|
|
|
|
widget->setBackgroundMode( NoBackground ); // We paint the whole background.
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
widget->installEventFilter(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
KStyle::polish( widget );
|
|
|
|
TDEStyle::polish( widget );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -436,7 +436,7 @@ void MandrivaStyle::unPolish(TQWidget* widget)
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else if ( widget->parentWidget() &&
|
|
|
|
else if ( widget->parentWidget() &&
|
|
|
|
( ( widget->inherits( "TQListBox" ) && widget->parentWidget()->inherits( "TQComboBox" ) )
|
|
|
|
( ( widget->inherits( "TQListBox" ) && widget->parentWidget()->inherits( "TQComboBox" ) )
|
|
|
|
|| widget->inherits( "KCompletionBox" ) ) )
|
|
|
|
|| widget->inherits( "TDECompletionBox" ) ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
TQListBox* listbox = (TQListBox*) widget;
|
|
|
|
TQListBox* listbox = (TQListBox*) widget;
|
|
|
|
listbox->setLineWidth( 1 );
|
|
|
|
listbox->setLineWidth( 1 );
|
|
|
@ -445,7 +445,7 @@ void MandrivaStyle::unPolish(TQWidget* widget)
|
|
|
|
widget->clearMask();
|
|
|
|
widget->clearMask();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//For toolbar internal separators, return to button, too (can't use tqt_cast here since don't have access to the class)
|
|
|
|
//For toolbar internal separators, return to button, too (can't use tqt_cast here since don't have access to the class)
|
|
|
|
else if ( widget->inherits( "KToolBarSeparator" ) || widget->inherits( "TQToolBarSeparator" ) )
|
|
|
|
else if ( widget->inherits( "TDEToolBarSeparator" ) || widget->inherits( "TQToolBarSeparator" ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
widget->setBackgroundMode( TQWidget::PaletteBackground );
|
|
|
|
widget->setBackgroundMode( TQWidget::PaletteBackground );
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -455,7 +455,7 @@ void MandrivaStyle::unPolish(TQWidget* widget)
|
|
|
|
widget->removeEventFilter(this);
|
|
|
|
widget->removeEventFilter(this);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
KStyle::unPolish( widget );
|
|
|
|
TDEStyle::unPolish( widget );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* reimp. */
|
|
|
|
/* reimp. */
|
|
|
@ -798,7 +798,7 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe,
|
|
|
|
p->setPen(oldPen);
|
|
|
|
p->setPen(oldPen);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
KStyle::drawPrimitive(pe, p, r, cg, flags, opt);
|
|
|
|
TDEStyle::drawPrimitive(pe, p, r, cg, flags, opt);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case PE_GroupBoxFrame:
|
|
|
|
case PE_GroupBoxFrame:
|
|
|
@ -1371,7 +1371,7 @@ void MandrivaStyle::drawPrimitive( PrimitiveElement pe,
|
|
|
|
drawMandrivaArrow( a, p, r, cg, flags, opt );
|
|
|
|
drawMandrivaArrow( a, p, r, cg, flags, opt );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
KStyle::drawPrimitive( pe, p, r, cg, flags, opt );
|
|
|
|
TDEStyle::drawPrimitive( pe, p, r, cg, flags, opt );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
} //switch
|
|
|
|
} //switch
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -1389,7 +1389,7 @@ void MandrivaStyle::drawMandrivaArrow( TQPointArray a, TQPainter *p,
|
|
|
|
p->setPen( oldPen ); // restore pen
|
|
|
|
p->setPen( oldPen ); // restore pen
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MandrivaStyle::drawKStylePrimitive( KStylePrimitive pe,
|
|
|
|
void MandrivaStyle::drawTDEStylePrimitive( TDEStylePrimitive pe,
|
|
|
|
TQPainter* p,
|
|
|
|
TQPainter* p,
|
|
|
|
const TQWidget* widget,
|
|
|
|
const TQWidget* widget,
|
|
|
|
const TQRect &r,
|
|
|
|
const TQRect &r,
|
|
|
@ -1514,7 +1514,7 @@ void MandrivaStyle::drawKStylePrimitive( KStylePrimitive pe,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
// copied and slightly modified from KStyle.
|
|
|
|
// copied and slightly modified from TDEStyle.
|
|
|
|
case KPE_ListViewBranch:
|
|
|
|
case KPE_ListViewBranch:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Typical Windows style listview branch element (dotted line).
|
|
|
|
// Typical Windows style listview branch element (dotted line).
|
|
|
@ -1589,7 +1589,7 @@ void MandrivaStyle::drawKStylePrimitive( KStylePrimitive pe,
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::drawKStylePrimitive( pe, p, widget, r, cg, flags, opt);
|
|
|
|
TDEStyle::drawTDEStylePrimitive( pe, p, widget, r, cg, flags, opt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -1795,7 +1795,7 @@ void MandrivaStyle::drawControl( ControlElement element,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case CE_ToolButtonLabel:
|
|
|
|
case CE_ToolButtonLabel:
|
|
|
|
{
|
|
|
|
{
|
|
|
|
KStyle::drawControl(element, p, widget, r, cg, flags, opt);
|
|
|
|
TDEStyle::drawControl(element, p, widget, r, cg, flags, opt);
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2307,7 +2307,7 @@ void MandrivaStyle::drawControl( ControlElement element,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::drawControl(element, p, widget, r, cg, flags, opt);
|
|
|
|
TDEStyle::drawControl(element, p, widget, r, cg, flags, opt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2326,7 +2326,7 @@ void MandrivaStyle::drawControlMask( ControlElement element,
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::drawControlMask(element, p, widget, r, opt);
|
|
|
|
TDEStyle::drawControlMask(element, p, widget, r, opt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2683,7 +2683,7 @@ void MandrivaStyle::drawComplexControl( ComplexControl control,
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::drawComplexControl(control, p, widget,
|
|
|
|
TDEStyle::drawComplexControl(control, p, widget,
|
|
|
|
r, cg, flags, controls, active, opt);
|
|
|
|
r, cg, flags, controls, active, opt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2702,7 +2702,7 @@ TQRect MandrivaStyle::querySubControlMetrics( ComplexControl control,
|
|
|
|
case SC_SpinWidgetButtonField:
|
|
|
|
case SC_SpinWidgetButtonField:
|
|
|
|
return TQRect( widget->width() -14 , 0, 14, widget->height() );
|
|
|
|
return TQRect( widget->width() -14 , 0, 14, widget->height() );
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return KStyle::querySubControlMetrics( control, widget, subcontrol, opt );
|
|
|
|
return TDEStyle::querySubControlMetrics( control, widget, subcontrol, opt );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//TODO verify it.
|
|
|
|
//TODO verify it.
|
|
|
@ -2729,7 +2729,7 @@ TQRect MandrivaStyle::querySubControlMetrics( ComplexControl control,
|
|
|
|
return TQRect( 5, 1, widget->width() - arrow-12, widget->height() - 2);
|
|
|
|
return TQRect( 5, 1, widget->width() - arrow-12, widget->height() - 2);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return KStyle::querySubControlMetrics( control, widget, subcontrol, opt );
|
|
|
|
return TDEStyle::querySubControlMetrics( control, widget, subcontrol, opt );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -2768,7 +2768,7 @@ TQRect MandrivaStyle::querySubControlMetrics( ComplexControl control,
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return KStyle::querySubControlMetrics( control, widget, subcontrol, opt );
|
|
|
|
return TDEStyle::querySubControlMetrics( control, widget, subcontrol, opt );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void MandrivaStyle::drawComplexControlMask( ComplexControl control,
|
|
|
|
void MandrivaStyle::drawComplexControlMask( ComplexControl control,
|
|
|
@ -2796,10 +2796,10 @@ void MandrivaStyle::drawComplexControlMask( ComplexControl control,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
KStyle::drawComplexControlMask(control, p, widget, r, opt);
|
|
|
|
TDEStyle::drawComplexControlMask(control, p, widget, r, opt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
//#endif
|
|
|
|
//#endif
|
|
|
|
//KStyle::drawComplexControlMask(control, p, widget, r, opt);
|
|
|
|
//TDEStyle::drawComplexControlMask(control, p, widget, r, opt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -2841,7 +2841,7 @@ int MandrivaStyle::pixelMetric(PixelMetric m, const TQWidget *widget) const
|
|
|
|
case PM_TabBarTabShiftVertical:
|
|
|
|
case PM_TabBarTabShiftVertical:
|
|
|
|
return 0;
|
|
|
|
return 0;
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return KStyle::pixelMetric(m, widget);
|
|
|
|
return TDEStyle::pixelMetric(m, widget);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2876,7 +2876,7 @@ TQSize MandrivaStyle::sizeFromContents( ContentsType contents,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return KStyle::sizeFromContents( contents, widget, contentSize, opt );
|
|
|
|
return TDEStyle::sizeFromContents( contents, widget, contentSize, opt );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
case CT_ComboBox:
|
|
|
|
case CT_ComboBox:
|
|
|
@ -2981,7 +2981,7 @@ TQSize MandrivaStyle::sizeFromContents( ContentsType contents,
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return KStyle::sizeFromContents( contents, widget, contentSize, opt );
|
|
|
|
return TDEStyle::sizeFromContents( contents, widget, contentSize, opt );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -2991,12 +2991,12 @@ TQPixmap MandrivaStyle::stylePixmap(StylePixmap stylepixmap,
|
|
|
|
const TQWidget* widget,
|
|
|
|
const TQWidget* widget,
|
|
|
|
const TQStyleOption& opt) const
|
|
|
|
const TQStyleOption& opt) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return KStyle::stylePixmap(stylepixmap, widget, opt);
|
|
|
|
return TDEStyle::stylePixmap(stylepixmap, widget, opt);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
bool MandrivaStyle::eventFilter( TQObject *object, TQEvent *event )
|
|
|
|
bool MandrivaStyle::eventFilter( TQObject *object, TQEvent *event )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (KStyle::eventFilter( object, event ))
|
|
|
|
if (TDEStyle::eventFilter( object, event ))
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
|
TQToolBar* toolbar;
|
|
|
|
TQToolBar* toolbar;
|
|
|
|
//Hover highlight on buttons and combos
|
|
|
|
//Hover highlight on buttons and combos
|
|
|
@ -3043,7 +3043,7 @@ bool MandrivaStyle::eventFilter( TQObject *object, TQEvent *event )
|
|
|
|
else if ( object->parent() && !qstrcmp( object->name(), kdeToolbarWidget ) )
|
|
|
|
else if ( object->parent() && !qstrcmp( object->name(), kdeToolbarWidget ) )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// Draw a gradient background for custom widgets in the toolbar
|
|
|
|
// Draw a gradient background for custom widgets in the toolbar
|
|
|
|
// that have specified a "kde toolbar widget" name.
|
|
|
|
// that have specified a "tde toolbar widget" name.
|
|
|
|
|
|
|
|
|
|
|
|
if (event->type() == TQEvent::Paint )
|
|
|
|
if (event->type() == TQEvent::Paint )
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -3356,7 +3356,7 @@ TQRect MandrivaStyle::subRect(SubRect r, const TQWidget *widget) const
|
|
|
|
return querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxEditField );
|
|
|
|
return querySubControlMetrics( CC_ComboBox, widget, SC_ComboBoxEditField );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
default:
|
|
|
|
default:
|
|
|
|
return KStyle::subRect( r, widget );
|
|
|
|
return TDEStyle::subRect( r, widget );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
@ -3403,7 +3403,7 @@ bool MandrivaStyle::excludeColor(const TQColor &col, bool active) const
|
|
|
|
|
|
|
|
|
|
|
|
bool MandrivaStyle::isFormWidget(const TQWidget* widget) const
|
|
|
|
bool MandrivaStyle::isFormWidget(const TQWidget* widget) const
|
|
|
|
{
|
|
|
|
{
|
|
|
|
//Form widgets are in the KHTMLView, but that has 2 further inner levels
|
|
|
|
//Form widgets are in the TDEHTMLView, but that has 2 further inner levels
|
|
|
|
//of widgets - TQClipperWidget, and outside of that, TQViewportWidget
|
|
|
|
//of widgets - TQClipperWidget, and outside of that, TQViewportWidget
|
|
|
|
TQWidget* potentialClipPort = widget->parentWidget();
|
|
|
|
TQWidget* potentialClipPort = widget->parentWidget();
|
|
|
|
if ( !potentialClipPort || potentialClipPort->isTopLevel() )
|
|
|
|
if ( !potentialClipPort || potentialClipPort->isTopLevel() )
|
|
|
@ -3416,7 +3416,7 @@ bool MandrivaStyle::isFormWidget(const TQWidget* widget) const
|
|
|
|
|
|
|
|
|
|
|
|
TQWidget* potentialKHTML = potentialViewPort->parentWidget();
|
|
|
|
TQWidget* potentialKHTML = potentialViewPort->parentWidget();
|
|
|
|
if (!potentialKHTML || potentialKHTML->isTopLevel() ||
|
|
|
|
if (!potentialKHTML || potentialKHTML->isTopLevel() ||
|
|
|
|
qstrcmp(potentialKHTML->className(), "KHTMLView") )
|
|
|
|
qstrcmp(potentialKHTML->className(), "TDEHTMLView") )
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|