[Libreoffice-commits] core.git: vcl/Library_vcl.mk vcl/osx
Joren De Cuyper
joren.libreoffice at telenet.be
Wed Feb 5 12:50:52 PST 2014
vcl/Library_vcl.mk | 2 ++
vcl/osx/salframe.cxx | 3 +++
vcl/osx/salnativewidgets.cxx | 39 ++++++++++++++++++++++++++++++++++-----
3 files changed, 39 insertions(+), 5 deletions(-)
New commits:
commit 0c7e6080519014f1fb345ed25e2f12c9a043b3ae
Author: Joren De Cuyper <joren.libreoffice at telenet.be>
Date: Tue Feb 4 18:50:27 2014 +0100
fdo#69358 Introduction of native Mac OSX Toolbar, based on CoreUI
Change-Id: I7774368a9b59e8087573348f6061b6a220fea130
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 204a0d6..04fc6cc 100644
--- a/vcl/Library_vcl.mk
+++ b/vcl/Library_vcl.mk
@@ -81,6 +81,8 @@ $(eval $(call gb_Library_use_libraries,vcl,\
ifeq ($(OS),MACOSX)
$(eval $(call gb_Library_add_libs,vcl,\
-framework IOKit \
+ -F/System/Library/PrivateFrameworks \
+ -framework CoreUI \
-lobjc \
))
endif
diff --git a/vcl/osx/salframe.cxx b/vcl/osx/salframe.cxx
index 6b236d6..e592649 100644
--- a/vcl/osx/salframe.cxx
+++ b/vcl/osx/salframe.cxx
@@ -1301,6 +1301,9 @@ void AquaSalFrame::UpdateSettings( AllSettings& rSettings )
rSettings.SetStyleSettings( aStyleSettings );
+ // don't draw frame around each and every toolbar
+ ImplGetSVData()->maNWFData.mbDockingAreaAvoidTBFrames = true;
+
[mpNSView unlockFocus];
}
diff --git a/vcl/osx/salnativewidgets.cxx b/vcl/osx/salnativewidgets.cxx
index 299e1f9..f0224fb 100644
--- a/vcl/osx/salnativewidgets.cxx
+++ b/vcl/osx/salnativewidgets.cxx
@@ -35,6 +35,16 @@
#define NSAppKitVersionNumber10_7 1138
#endif
+extern "C"
+{
+ typedef CFTypeRef CUIRendererRef;
+ void CUIDraw(CUIRendererRef r, CGRect rect, CGContextRef ctx, CFDictionaryRef options, CFDictionaryRef* result);
+}
+
+ at interface NSWindow(CoreUIRendererPrivate)
++ (CUIRendererRef)coreUIRenderer;
+ at end
+
class AquaBlinker : public Timer
{
AquaSalFrame* mpFrame;
@@ -524,11 +534,30 @@ sal_Bool AquaSalGraphics::drawNativeControl(ControlType nType,
case CTRL_TOOLBAR:
{
- HIThemeMenuItemDrawInfo aMenuItemDrawInfo;
- aMenuItemDrawInfo.version = 0;
- aMenuItemDrawInfo.state = kThemeMenuActive;
- aMenuItemDrawInfo.itemType = kThemeMenuItemHierBackground;
- HIThemeDrawMenuItem(&rc,&rc,&aMenuItemDrawInfo,mrContext,kHIThemeOrientationNormal,NULL);
+ if (nPart == PART_DRAW_BACKGROUND_HORZ || nPart == PART_DRAW_BACKGROUND_VERT)
+ {
+ BOOL isMain = [mpFrame->getNSWindow() isMainWindow];
+ CGFloat unifiedHeight = rControlRegion.GetHeight();
+ CGRect drawRect = CGRectMake(rControlRegion.Left(), rControlRegion.Top(), rControlRegion.GetWidth(), rControlRegion.GetHeight());
+ CUIDraw([NSWindow coreUIRenderer], drawRect, mrContext,
+ (CFDictionaryRef)[NSDictionary dictionaryWithObjectsAndKeys:
+ @"kCUIWidgetWindowFrame", @"widget",
+ @"regularwin", @"windowtype",
+ (isMain ? @"normal" : @"inactive"), @"state",
+ [NSNumber numberWithDouble:unifiedHeight], @"kCUIWindowFrameUnifiedTitleBarHeightKey",
+ [NSNumber numberWithBool:YES], @"kCUIWindowFrameDrawTitleSeparatorKey",
+ [NSNumber numberWithBool:YES], @"is.flipped",
+ nil],
+ nil);;
+ }
+ else
+ {
+ HIThemeMenuItemDrawInfo aMenuItemDrawInfo;
+ aMenuItemDrawInfo.version = 0;
+ aMenuItemDrawInfo.state = kThemeMenuActive;
+ aMenuItemDrawInfo.itemType = kThemeMenuItemHierBackground;
+ HIThemeDrawMenuItem(&rc, &rc, &aMenuItemDrawInfo, mrContext, kHIThemeOrientationNormal, NULL);
+ }
bOK = true;
}
break;
More information about the Libreoffice-commits
mailing list