supporting native large control sizes

This commit is contained in:
Stefan Csomor
2020-06-25 16:12:55 +02:00
parent 80610cb383
commit 31581c0f41
5 changed files with 20 additions and 0 deletions

View File

@@ -156,6 +156,9 @@ void wxButtonCocoaImpl::GetLayoutInset(int &left , int &top , int &right, int &b
{ {
switch( size ) switch( size )
{ {
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_16
case NSControlSizeLarge:
#endif
case NSRegularControlSize: case NSRegularControlSize:
left = right = 6; left = right = 6;
top = 4; top = 4;

View File

@@ -88,6 +88,9 @@ public:
switch( size ) switch( size )
{ {
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_16
case NSControlSizeLarge:
#endif
case NSRegularControlSize: case NSRegularControlSize:
left = right = 3; left = right = 3;
top = 2; top = 2;

View File

@@ -78,6 +78,9 @@ public :
switch( size ) switch( size )
{ {
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_16
case NSControlSizeLarge:
#endif
case NSRegularControlSize: case NSRegularControlSize:
left = right = 2; left = right = 2;
top = 0; top = 0;

View File

@@ -25,6 +25,7 @@
#endif #endif
#include "wx/osx/private.h" #include "wx/osx/private.h"
#include "wx/osx/private/available.h"
// forward decls // forward decls
@@ -422,6 +423,11 @@ wxListWidgetColumn* wxListWidgetCocoaImpl::InsertCheckColumn( unsigned pos , con
break ; break ;
case wxWINDOW_VARIANT_LARGE : case wxWINDOW_VARIANT_LARGE :
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_16
if ( WX_IS_MACOS_AVAILABLE( 10, 16 ))
size = NSControlSizeLarge;
else
#endif
size = NSRegularControlSize; size = NSRegularControlSize;
break ; break ;

View File

@@ -3504,6 +3504,11 @@ void wxWidgetCocoaImpl::SetControlSize( wxWindowVariant variant )
break ; break ;
case wxWINDOW_VARIANT_LARGE : case wxWINDOW_VARIANT_LARGE :
#if __MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_16
if ( WX_IS_MACOS_AVAILABLE( 10, 16 ))
size = NSControlSizeLarge;
else
#endif
size = NSRegularControlSize; size = NSRegularControlSize;
break ; break ;