summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2015-07-30 18:10:03 +0200
committerMiklos Vajna <vmiklos@collabora.co.uk>2015-08-05 08:08:23 +0000
commit4701f6b95d48cc8f253a26d0ed0d9b32d51e6bee (patch)
treeb91fd55f2670980973af70caf4d759747a534f2f
parent7f0cc275076c886efa53e35537c19cdb9b389666 (diff)
tdf#92903 KDE4: fix listbox regression from 92115
So at least in case of the CTRL_LISTBOX, getNativeControlRegion is called for a type and part unsupported by IsNativeControlSupported. For whatever reason, this results in broken listboxes drawn in Base's "Table Design" dialog, when selecting "field type", which draws the listbox on top of the cell. To make it worse, it seems the listbox is actually drawn to a smaller space then the actual requirement. Appearently it seems to use the content rect, instead of the bounding rect. So in addition to fixing the drawing, this patch increases the listbox bounding rect, which looks too large in normal dialogs, but makes the Base's listbox better readable. Change-Id: I112ec038fd20ad33facd260d16b5d68b508d2bd0 Reviewed-on: https://gerrit.libreoffice.org/17438 Reviewed-by: Katarina Behrens <Katarina.Behrens@cib.de> Tested-by: Katarina Behrens <Katarina.Behrens@cib.de> (cherry picked from commit ef126328c3ad35d51395abc461c3d64429f91c26) Reviewed-on: https://gerrit.libreoffice.org/17448 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
-rw-r--r--vcl/unx/kde4/KDESalGraphics.cxx20
1 files changed, 9 insertions, 11 deletions
diff --git a/vcl/unx/kde4/KDESalGraphics.cxx b/vcl/unx/kde4/KDESalGraphics.cxx
index e4412e21ac34..7e1a8810ed8d 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -109,10 +109,7 @@ bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart par
return true;
case CTRL_LISTBOX:
- return (part == PART_ENTIRE_CONTROL
- || part == PART_SUB_EDIT
- || part == PART_WINDOW
- || part == PART_BUTTON_DOWN);
+ return (part == PART_ENTIRE_CONTROL || part == HAS_BACKGROUND_TEXTURE);
case CTRL_SPINBOX:
return (part == PART_ENTIRE_CONTROL || part == HAS_BACKGROUND_TEXTURE);
@@ -653,12 +650,6 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
const OUString&,
Rectangle &nativeBoundingRegion, Rectangle &nativeContentRegion )
{
- bool nativeSupport = IsNativeControlSupported( type, part );
- if( ! nativeSupport ) {
- assert( ! nativeSupport && "drawNativeControl called without native support!" );
- return false;
- }
-
bool retVal = false;
QRect boundingRect = region2QRect( controlRegion );
@@ -756,6 +747,14 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
int size = QApplication::style()->pixelMetric(QStyle::PM_ComboBoxFrameWidth) - 2;
contentRect.adjust(-size,-size,size,size);
}
+ else {
+ int hmargin = QApplication::style()->pixelMetric(
+ QStyle::PM_FocusFrameHMargin, &styleOption);
+ int vmargin = QApplication::style()->pixelMetric(
+ QStyle::PM_FocusFrameVMargin, &styleOption);
+ boundingRect.translate( -hmargin, -vmargin );
+ boundingRect.adjust( -hmargin, -vmargin, 2 * hmargin, 2 * vmargin );
+ }
retVal = true;
break;
}
@@ -779,7 +778,6 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
contentRect.translate( boundingRect.left() + hmargin, boundingRect.top() + vmargin );
contentRect.adjust( 0, 0, -2 * hmargin, -2 * vmargin );
- boundingRect = contentRect;
retVal = true;
break;