[Libreoffice-commits] core.git: 2 commits - vcl/aqua
Tor Lillqvist
tml at iki.fi
Wed Jul 24 13:33:00 PDT 2013
vcl/aqua/source/gdi/salnativewidgets.cxx | 74 ++++++++++++++++++++++---------
1 file changed, 54 insertions(+), 20 deletions(-)
New commits:
commit e8c467d134c1c49d2b25c72fbd45dd1c6b77b171
Author: Tor Lillqvist <tml at iki.fi>
Date: Wed Jul 24 23:27:06 2013 +0300
fdo#46271: No arrows in scrollbars in OS X 10.7 and later
So no need to take them into account when calculating the geometries
of the scrollbar parts.
Change-Id: Ie8d4b38107466663e6ff8c26aec3537638976f98
diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx
index 07a8b6b..dcdba2b 100644
--- a/vcl/aqua/source/gdi/salnativewidgets.cxx
+++ b/vcl/aqua/source/gdi/salnativewidgets.cxx
@@ -113,26 +113,56 @@ static bool AquaGetScrollRect( /* TODO: int nScreen, */ ControlPart nPart,
switch( nPart )
{
case PART_BUTTON_UP:
- if( GetSalData()->mbIsScrollbarDoubleMax )
- rResultRect.Top() = rControlRect.Bottom() - 2*BUTTON_HEIGHT;
- rResultRect.Bottom() = rResultRect.Top() + BUTTON_HEIGHT;
+ if (NSAppKitVersionNumber < NSAppKitVersionNumber10_7)
+ {
+ if( GetSalData()->mbIsScrollbarDoubleMax )
+ rResultRect.Top() = rControlRect.Bottom() - 2*BUTTON_HEIGHT;
+ rResultRect.Bottom() = rResultRect.Top() + BUTTON_HEIGHT;
+ }
+ else
+ {
+ rResultRect.Bottom() = rResultRect.Top();
+ }
break;
case PART_BUTTON_DOWN:
- rResultRect.Top() = rControlRect.Bottom() - BUTTON_HEIGHT;
+ if (NSAppKitVersionNumber < NSAppKitVersionNumber10_7)
+ {
+ rResultRect.Top() = rControlRect.Bottom() - BUTTON_HEIGHT;
+ }
+ else
+ {
+ rResultRect.Top() = rResultRect.Bottom();
+ }
break;
case PART_BUTTON_LEFT:
- if( GetSalData()->mbIsScrollbarDoubleMax )
- rResultRect.Left() = rControlRect.Right() - 2*BUTTON_WIDTH;
- rResultRect.Right() = rResultRect.Left() + BUTTON_WIDTH;
+ if (NSAppKitVersionNumber < NSAppKitVersionNumber10_7)
+ {
+ if( GetSalData()->mbIsScrollbarDoubleMax )
+ rResultRect.Left() = rControlRect.Right() - 2*BUTTON_WIDTH;
+ rResultRect.Right() = rResultRect.Left() + BUTTON_WIDTH;
+ }
+ else
+ {
+ rResultRect.Right() = rResultRect.Left();
+ }
break;
case PART_BUTTON_RIGHT:
- rResultRect.Left() = rControlRect.Right() - BUTTON_WIDTH;
+ if (NSAppKitVersionNumber < NSAppKitVersionNumber10_7)
+ {
+ rResultRect.Left() = rControlRect.Right() - BUTTON_WIDTH;
+ }
+ else
+ {
+ rResultRect.Left() = rResultRect.Right();
+ }
break;
case PART_TRACK_HORZ_AREA:
+ if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
+ break;
rResultRect.Right() -= BUTTON_WIDTH + 1;
if( GetSalData()->mbIsScrollbarDoubleMax )
rResultRect.Right() -= BUTTON_WIDTH;
@@ -141,6 +171,8 @@ static bool AquaGetScrollRect( /* TODO: int nScreen, */ ControlPart nPart,
break;
case PART_TRACK_VERT_AREA:
+ if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
+ break;
rResultRect.Bottom() -= BUTTON_HEIGHT + 1;
if( GetSalData()->mbIsScrollbarDoubleMax )
rResultRect.Bottom() -= BUTTON_HEIGHT;
@@ -148,6 +180,8 @@ static bool AquaGetScrollRect( /* TODO: int nScreen, */ ControlPart nPart,
rResultRect.Top() += BUTTON_HEIGHT + 1;
break;
case PART_THUMB_HORZ:
+ if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
+ break;
if( GetSalData()->mbIsScrollbarDoubleMax )
{
rResultRect.Left() += 8;
@@ -160,6 +194,8 @@ static bool AquaGetScrollRect( /* TODO: int nScreen, */ ControlPart nPart,
}
break;
case PART_THUMB_VERT:
+ if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
+ break;
if( GetSalData()->mbIsScrollbarDoubleMax )
{
rResultRect.Top() += 8;
@@ -172,24 +208,32 @@ static bool AquaGetScrollRect( /* TODO: int nScreen, */ ControlPart nPart,
}
break;
case PART_TRACK_HORZ_LEFT:
+ if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
+ break;
if( GetSalData()->mbIsScrollbarDoubleMax )
rResultRect.Right() += 8;
else
rResultRect.Right() += 4;
break;
case PART_TRACK_HORZ_RIGHT:
+ if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
+ break;
if( GetSalData()->mbIsScrollbarDoubleMax )
rResultRect.Left() += 6;
else
rResultRect.Left() += 4;
break;
case PART_TRACK_VERT_UPPER:
+ if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
+ break;
if( GetSalData()->mbIsScrollbarDoubleMax )
rResultRect.Bottom() += 8;
else
rResultRect.Bottom() += 4;
break;
case PART_TRACK_VERT_LOWER:
+ if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7)
+ break;
if( GetSalData()->mbIsScrollbarDoubleMax )
rResultRect.Top() += 8;
else
@@ -351,7 +395,8 @@ sal_Bool AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart n
Rectangle aRect;
bool bValid = AquaGetScrollRect( /* TODO: m_nScreen */ nPart, rControlRegion, aRect );
rIsInside = bValid ? aRect.IsInside( rPos ) : sal_False;
- if( GetSalData()->mbIsScrollbarDoubleMax )
+ if( NSAppKitVersionNumber < NSAppKitVersionNumber10_7 &&
+ GetSalData()->mbIsScrollbarDoubleMax )
{
// in double max mode the actual trough is a little smaller than the track
// there is some visual filler that is not sensitive
commit 23bb6bb20fb6cfc136da7a497ffe40539769ac7a
Author: Tor Lillqvist <tml at iki.fi>
Date: Wed Jul 24 20:02:28 2013 +0300
Bin pointless comment duplicating #defines in a header
Change-Id: I071da9dbe7c4fe5ce95deef8b62d74d2d5a20256
diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx
index 0921fb1..07a8b6b 100644
--- a/vcl/aqua/source/gdi/salnativewidgets.cxx
+++ b/vcl/aqua/source/gdi/salnativewidgets.cxx
@@ -451,17 +451,6 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
Rectangle buttonRect = rControlRegion;
HIRect rc = ImplGetHIRectFromRectangle(buttonRect);
- /** Scrollbar parts code equivalent **
- PART_BUTTON_UP 101
- PART_BUTTON_DOWN 102
- PART_THUMB_VERT 211
- PART_TRACK_VERT_UPPER 201
- PART_TRACK_VERT_LOWER 203
-
- PART_DRAW_BACKGROUND_HORZ 1000
- PART_DRAW_BACKGROUND_VERT 1001
- **/
-
switch( nType )
{
More information about the Libreoffice-commits
mailing list