summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2016-09-30 23:18:30 +0200
committerJan-Marek Glogowski <glogow@fbihome.de>2016-12-20 14:19:15 +0100
commit84979c4ca6ee6ae67b095c29ffb5b44f6fb77f75 (patch)
treef8f20c13ebeeb5ca355755b323396671a24fa5b8 /vcl/unx
parent60f49908e08c53fd5581c38ab0c93cd3631563eb (diff)
KDE4 implement native drag handlers
Change-Id: I3d6a1696b8278066b005c1983d226cc67381ba95
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/kde4/KDESalGraphics.cxx40
1 files changed, 34 insertions, 6 deletions
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index b9f85f8b8d43..bb468624b2cd 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -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(),