summaryrefslogtreecommitdiff
path: root/vcl/osx
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-03-03 21:10:57 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-03-04 14:07:31 +0100
commit5e75b7ca828954f9a23d7a3e8c3be3e0934210b3 (patch)
tree80979bb5305184f9c2763cd5010f00b20cd2cbaf /vcl/osx
parentcccc98921e04bd16651b8ff92f82ff9073a1b12c (diff)
macOS: use HITheme to draw listbox window border
Change-Id: I39fd6f643649bc405447d10e7072ae6dabd679b6 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111935 Tested-by: Jenkins Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
Diffstat (limited to 'vcl/osx')
-rw-r--r--vcl/osx/salnativewidgets.cxx24
1 files changed, 16 insertions, 8 deletions
diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 17d1744433f4..5dd5929c2fc6 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -732,16 +732,14 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
case ControlPart::ListboxWindow:
HIThemeFrameDrawInfo aTextDrawInfo;
aTextDrawInfo.version = 0;
- aTextDrawInfo.kind = kHIThemeFrameTextFieldSquare;
- aTextDrawInfo.state = getState(nState);
+ aTextDrawInfo.kind = kHIThemeFrameListBox;
+ aTextDrawInfo.state = kThemeStateActive;
aTextDrawInfo.isFocused = false;
- rc.size.width -= 2 * FOCUS_RING_WIDTH;
- rc.size.height -= 2 * FOCUS_RING_WIDTH;
- rc.origin.x += FOCUS_RING_WIDTH;
- rc.origin.y += FOCUS_RING_WIDTH;
+ rc.size.width += 2 * kThemeMetricListBoxFrameOutset - 2;
+ rc.size.height += 2 * kThemeMetricListBoxFrameOutset - 2;
+ rc.origin.x -= kThemeMetricListBoxFrameOutset - 1;
+ rc.origin.y -= kThemeMetricListBoxFrameOutset - 1;
HIThemeDrawFrame(&rc, &aTextDrawInfo, maContextHolder.get(), kHIThemeOrientationNormal);
- if (nState & ControlState::FOCUSED)
- HIThemeDrawFocusRect(&rc, true, maContextHolder.get(), kHIThemeOrientationNormal);
bOK = true;
break;
default:
@@ -1046,6 +1044,16 @@ bool AquaSalGraphics::getNativeControlRegion(ControlType nType,
rNativeContentRegion = tools::Rectangle(Point(x, y), Size(w, h));
toReturn = true;
}
+ else if (nPart == ControlPart::ListboxWindow)
+ {
+ w = aCtrlBoundRect.GetWidth() - 2 * kThemeMetricListBoxFrameOutset;
+ h = aCtrlBoundRect.GetHeight() - 2 * kThemeMetricListBoxFrameOutset;
+ x += kThemeMetricListBoxFrameOutset;
+ y += kThemeMetricListBoxFrameOutset;
+ rNativeBoundingRegion = aCtrlBoundRect;
+ rNativeContentRegion = tools::Rectangle(Point(x, y), Size(w, h));
+ toReturn = true;
+ }
break;
case ControlType::Spinbox:
if (nPart == ControlPart::Entire)