summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJan-Marek Glogowski <glogow@fbihome.de>2015-07-30 18:10:03 +0200
committerKatarina Behrens <Katarina.Behrens@cib.de>2015-07-31 12:41:48 +0000
commitef126328c3ad35d51395abc461c3d64429f91c26 (patch)
treead224b1fea0afc570aa30dcb0516c4ed838e071d
parent0db37d785311aa2294f60b750fce4dadff6c75e0 (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>
-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 3e79e1e4f079..eeb741f831ff 100644
--- a/vcl/unx/kde4/KDESalGraphics.cxx
+++ b/vcl/unx/kde4/KDESalGraphics.cxx
@@ -108,10 +108,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);
@@ -650,12 +647,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 );
@@ -753,6 +744,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;
}
@@ -776,7 +775,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;