diff options
author | Robert Antoni Buj Gelonch <robert.buj@gmail.com> | 2015-02-25 18:46:17 +0100 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2015-04-09 08:59:04 +0000 |
commit | 1af750ceed914cee01357fd83303df35b5b3dac8 (patch) | |
tree | 97303a7aa08b9ee409bd7c324eb8ce90c30c0e33 /vcl/osx/salnativewidgets.cxx | |
parent | 1627f39768be588368744f9addc7745092ca4e50 (diff) |
NSAppKitVersionNumber is always greater than NSAppKitVersionNumber10_7
Change-Id: I9e2b9388c5df1b3a5fc0b2deb570b6f63e59b8eb
Reviewed-on: https://gerrit.libreoffice.org/14637
Reviewed-by: Caolán McNamara <caolanm@redhat.com>
Tested-by: Caolán McNamara <caolanm@redhat.com>
Diffstat (limited to 'vcl/osx/salnativewidgets.cxx')
-rw-r--r-- | vcl/osx/salnativewidgets.cxx | 135 |
1 files changed, 4 insertions, 131 deletions
diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx index 559b41897f1c..041df334a051 100644 --- a/vcl/osx/salnativewidgets.cxx +++ b/vcl/osx/salnativewidgets.cxx @@ -36,10 +36,6 @@ #include <cuidraw.hxx> -#ifndef NSAppKitVersionNumber10_7 -#define NSAppKitVersionNumber10_7 1138 -#endif - #if !HAVE_FEATURE_MACOSX_SANDBOX @interface NSWindow(CoreUIRendererPrivate) @@ -130,131 +126,29 @@ static bool AquaGetScrollRect( /* TODO: int nScreen, */ ControlPart nPart, switch( nPart ) { case PART_BUTTON_UP: - 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(); - } + rResultRect.Bottom() = rResultRect.Top(); break; case PART_BUTTON_DOWN: - if (NSAppKitVersionNumber < NSAppKitVersionNumber10_7) - { - rResultRect.Top() = rControlRect.Bottom() - BUTTON_HEIGHT; - } - else - { - rResultRect.Top() = rResultRect.Bottom(); - } + rResultRect.Top() = rResultRect.Bottom(); break; case PART_BUTTON_LEFT: - 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(); - } + rResultRect.Right() = rResultRect.Left(); break; case PART_BUTTON_RIGHT: - if (NSAppKitVersionNumber < NSAppKitVersionNumber10_7) - { - rResultRect.Left() = rControlRect.Right() - BUTTON_WIDTH; - } - else - { - rResultRect.Left() = rResultRect.Right(); - } + 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; - else - rResultRect.Left() += BUTTON_WIDTH + 1; - break; - case PART_TRACK_VERT_AREA: - if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7) - break; - rResultRect.Bottom() -= BUTTON_HEIGHT + 1; - if( GetSalData()->mbIsScrollbarDoubleMax ) - rResultRect.Bottom() -= BUTTON_HEIGHT; - else - rResultRect.Top() += BUTTON_HEIGHT + 1; - break; case PART_THUMB_HORZ: - if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7) - break; - if( GetSalData()->mbIsScrollbarDoubleMax ) - { - rResultRect.Left() += 8; - rResultRect.Right() += 6; - } - else - { - rResultRect.Left() += 4; - rResultRect.Right() += 4; - } - break; case PART_THUMB_VERT: - if (NSAppKitVersionNumber >= NSAppKitVersionNumber10_7) - break; - if( GetSalData()->mbIsScrollbarDoubleMax ) - { - rResultRect.Top() += 8; - rResultRect.Bottom() += 8; - } - else - { - rResultRect.Top() += 4; - rResultRect.Bottom() += 4; - } - 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 - rResultRect.Top() += 4; break; default: bRetVal = false; @@ -412,27 +306,6 @@ bool AquaSalGraphics::hitTestNativeControl( ControlType nType, ControlPart nPart Rectangle aRect; bool bValid = AquaGetScrollRect( /* TODO: m_nScreen */ nPart, rControlRegion, aRect ); rIsInside = bValid && aRect.IsInside( rPos ); - 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 - if( bValid && rIsInside ) - { - if( nPart == PART_TRACK_HORZ_AREA ) - { - // the left 4 pixels are not hit sensitive - if( rPos.X() - aRect.Left() < 4 ) - rIsInside = false; - } - else if( nPart == PART_TRACK_VERT_AREA ) - { - // the top 4 pixels are not hit sensitive - if( rPos.Y() - aRect.Top() < 4 ) - rIsInside = false; - } - } - } return bValid; } // CTRL_SCROLLBAR |