Kaydet (Commit) 84979c4c authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski

KDE4 implement native drag handlers

Change-Id: I3d6a1696b8278066b005c1983d226cc67381ba95
üst 60f49908
......@@ -384,14 +384,24 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
draw( QStyle::CE_ToolBar, &option, m_image.get(),
vclStateValue2StateFlag(nControlState, value) );
}
else if ( (type == ControlType::Toolbar) && (part == ControlPart::ThumbVert) )
else if ( (type == ControlType::Toolbar)
&& (part == ControlPart::ThumbVert || part == ControlPart::ThumbHorz) )
{ // reduce paint area only to the handle area
const int width = QApplication::style()->pixelMetric(QStyle::PM_ToolBarHandleExtent);
QRect rect( 0, 0, width, widgetRect.height());
localClipRegion = new QRegion(widgetRect.x(), widgetRect.y(), width, widgetRect.height());
const int handleExtend = QApplication::style()->pixelMetric(QStyle::PM_ToolBarHandleExtent);
QRect rect;
QStyleOption option;
option.state = QStyle::State_Horizontal;
if (part == ControlPart::ThumbVert)
{
rect = QRect( 0, 0, handleExtend, widgetRect.height());
localClipRegion = new QRegion(widgetRect.x(), widgetRect.y(), handleExtend, widgetRect.height());
option.state = QStyle::State_Horizontal;
}
else
{
rect = QRect( 0, 0, widgetRect.width(), handleExtend);
localClipRegion = new QRegion(widgetRect.x(), widgetRect.y(), widgetRect.width(), handleExtend);
}
draw( QStyle::PE_IndicatorToolBarHandle, &option, m_image.get(),
vclStateValue2StateFlag(nControlState, value), rect );
......@@ -435,6 +445,7 @@ bool KDESalGraphics::drawNativeControl( ControlType type, ControlPart part,
vclStateValue2StateFlag(nControlState, value) );
break;
default:
returnVal = false;
break;
}
}
......@@ -901,6 +912,23 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
}
break;
}
case ControlType::Toolbar:
{
const int nWorH = QApplication::style()->pixelMetric(QStyle::PM_ToolBarHandleExtent);
if( part == ControlPart::ThumbHorz )
{
contentRect = QRect(boundingRect.left(), boundingRect.top(), boundingRect.width(), nWorH );
boundingRect = contentRect;
retVal = true;
}
else if( part == ControlPart::ThumbVert )
{
contentRect = QRect(boundingRect.left(), boundingRect.top(), nWorH, boundingRect.height() );
boundingRect = contentRect;
retVal = true;
}
break;
}
case ControlType::Scrollbar:
{
// core can't handle 3-button scrollbars well, so we fix that in hitTestNativeControl(),
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment