[Libreoffice-commits] core.git: Branch 'libreoffice-4-1' - vcl/aqua
Tor Lillqvist
tml at iki.fi
Thu Jul 25 01:11:55 PDT 2013
vcl/aqua/source/gdi/salnativewidgets.cxx | 63 ++++++++++++++++++++++++++-----
1 file changed, 54 insertions(+), 9 deletions(-)
New commits:
commit c64554aec5a90daa800dd3a70b777dca510c56dc
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.
(cherry picked from commit e8c467d134c1c49d2b25c72fbd45dd1c6b77b171)
Change-Id: Ie8d4b38107466663e6ff8c26aec3537638976f98
Reviewed-on: https://gerrit.libreoffice.org/5090
Reviewed-by: Fridrich Strba <fridrich at documentfoundation.org>
Tested-by: Fridrich Strba <fridrich at documentfoundation.org>
diff --git a/vcl/aqua/source/gdi/salnativewidgets.cxx b/vcl/aqua/source/gdi/salnativewidgets.cxx
index 3de4118..f52775b 100644
--- a/vcl/aqua/source/gdi/salnativewidgets.cxx
+++ b/vcl/aqua/source/gdi/salnativewidgets.cxx
@@ -135,26 +135,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;
@@ -163,6 +193,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;
@@ -170,6 +202,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;
@@ -182,6 +216,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;
@@ -194,24 +230,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
@@ -373,7 +417,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
More information about the Libreoffice-commits
mailing list