Kaydet (Commit) 4065a6d6 authored tarafından Jan-Marek Glogowski's avatar Jan-Marek Glogowski Kaydeden (comit) Andras Timar

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/17438Reviewed-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
Tested-by: 's avatarKatarina Behrens <Katarina.Behrens@cib.de>
(cherry picked from commit ef126328)
Reviewed-on: https://gerrit.libreoffice.org/17448Tested-by: 's avatarJenkins <ci@libreoffice.org>
Reviewed-by: 's avatarMiklos Vajna <vmiklos@collabora.co.uk>
üst 890d86e1
...@@ -109,10 +109,7 @@ bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart par ...@@ -109,10 +109,7 @@ bool KDESalGraphics::IsNativeControlSupported( ControlType type, ControlPart par
return true; return true;
case CTRL_LISTBOX: case CTRL_LISTBOX:
return (part == PART_ENTIRE_CONTROL return (part == PART_ENTIRE_CONTROL || part == HAS_BACKGROUND_TEXTURE);
|| part == PART_SUB_EDIT
|| part == PART_WINDOW
|| part == PART_BUTTON_DOWN);
case CTRL_SPINBOX: case CTRL_SPINBOX:
return (part == PART_ENTIRE_CONTROL || part == HAS_BACKGROUND_TEXTURE); return (part == PART_ENTIRE_CONTROL || part == HAS_BACKGROUND_TEXTURE);
...@@ -653,12 +650,6 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, ...@@ -653,12 +650,6 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
const OUString&, const OUString&,
Rectangle &nativeBoundingRegion, Rectangle &nativeContentRegion ) Rectangle &nativeBoundingRegion, Rectangle &nativeContentRegion )
{ {
bool nativeSupport = IsNativeControlSupported( type, part );
if( ! nativeSupport ) {
assert( ! nativeSupport && "drawNativeControl called without native support!" );
return false;
}
bool retVal = false; bool retVal = false;
QRect boundingRect = region2QRect( controlRegion ); QRect boundingRect = region2QRect( controlRegion );
...@@ -756,6 +747,14 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, ...@@ -756,6 +747,14 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
int size = QApplication::style()->pixelMetric(QStyle::PM_ComboBoxFrameWidth) - 2; int size = QApplication::style()->pixelMetric(QStyle::PM_ComboBoxFrameWidth) - 2;
contentRect.adjust(-size,-size,size,size); 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; retVal = true;
break; break;
} }
...@@ -779,7 +778,6 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part, ...@@ -779,7 +778,6 @@ bool KDESalGraphics::getNativeControlRegion( ControlType type, ControlPart part,
contentRect.translate( boundingRect.left() + hmargin, boundingRect.top() + vmargin ); contentRect.translate( boundingRect.left() + hmargin, boundingRect.top() + vmargin );
contentRect.adjust( 0, 0, -2 * hmargin, -2 * vmargin ); contentRect.adjust( 0, 0, -2 * hmargin, -2 * vmargin );
boundingRect = contentRect;
retVal = true; retVal = true;
break; break;
......
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