summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNoel Grandin <noelgrandin@gmail.com>2021-02-28 14:32:13 +0200
committerNoel Grandin <noel.grandin@collabora.co.uk>2021-03-01 08:00:10 +0100
commit0833f01a3df511871c572c5454a97ef878eb9f67 (patch)
treead0db48d32fb5160d34d18bda05c748935927772
parent6c897e5026a6819c2d706ccdc9720fb1b3f8bea2 (diff)
macOS spinbox and tab header tweaks
(*) tweak location of SpinBoxes so they line up a little better (*) tweak the size of the TabItems so they don't overlap, which causes little extra vertical bars of gray Change-Id: Ic36be6c97b4b44f5e60b0f4a0f1e172fd7c2af03 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/111712 Tested-by: Noel Grandin <noel.grandin@collabora.co.uk> Reviewed-by: Noel Grandin <noel.grandin@collabora.co.uk>
-rw-r--r--vcl/inc/osx/salnativewidgets.h1
-rw-r--r--vcl/osx/salnativewidgets.cxx7
2 files changed, 3 insertions, 5 deletions
diff --git a/vcl/inc/osx/salnativewidgets.h b/vcl/inc/osx/salnativewidgets.h
index 3fdcdc40ca97..86675e0623d6 100644
--- a/vcl/inc/osx/salnativewidgets.h
+++ b/vcl/inc/osx/salnativewidgets.h
@@ -22,7 +22,6 @@
#define TAB_HEIGHT 20 // height of tab header in pixels
#define TAB_TEXT_MARGIN 12 // left/right margin of text within tab headers
-#define VCL_TAB_TEXT_SEPARATOR 2 // Space between two tabs required by VCL
#define FOCUS_RING_WIDTH 4 // width of focus ring in pixels
diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 606db5ba9a37..17d1744433f4 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -661,8 +661,6 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
else if (aTabItemDrawInfo.position == kHIThemeTabPositionLast)
aTabItemDrawInfo.position = kHIThemeTabPositionFirst;
}
- rc.size.width += VCL_TAB_TEXT_SEPARATOR;
- rc.origin.x -= 1;
HIThemeDrawTab(&rc, &aTabItemDrawInfo, maContextHolder.get(), kHIThemeOrientationNormal, nullptr);
bOK=true;
}
@@ -812,7 +810,8 @@ bool AquaSalGraphics::drawNativeControl(ControlType nType,
? kThemeAdornmentDefault : kThemeAdornmentNone;
if (nUpperState & ControlState::FOCUSED || nLowerState & ControlState::FOCUSED)
aSpinInfo.adornment |= kThemeAdornmentFocus;
- rc.origin.x += rc.size.width + 2 * FOCUS_RING_WIDTH;
+ rc.origin.x += rc.size.width + FOCUS_RING_WIDTH + 1;
+ rc.origin.y -= 1;
rc.size.width = SPIN_BUTTON_WIDTH;
rc.size.height = SPIN_LOWER_BUTTON_HEIGHT + SPIN_LOWER_BUTTON_HEIGHT;
HIThemeDrawButton(&rc, &aSpinInfo, maContextHolder.get(), kHIThemeOrientationNormal, nullptr);
@@ -968,7 +967,7 @@ bool AquaSalGraphics::getNativeControlRegion(ControlType nType,
break;
case ControlType::TabItem:
{
- w = aCtrlBoundRect.GetWidth() + 2 * TAB_TEXT_MARGIN - 2 * VCL_TAB_TEXT_SEPARATOR;
+ w = aCtrlBoundRect.GetWidth() + 2 * TAB_TEXT_MARGIN;
h = TAB_HEIGHT + 2;
rNativeContentRegion = tools::Rectangle(Point(x, y), Size(w, h));
rNativeBoundingRegion = tools::Rectangle(Point(x, y), Size(w, h));