summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoren De Cuyper <joren.libreoffice@telenet.be>2014-02-04 18:50:27 +0100
committerJan Holesovsky <kendy@collabora.com>2014-02-05 21:49:17 +0100
commit0c7e6080519014f1fb345ed25e2f12c9a043b3ae (patch)
treec711245d20c975031a38f83f12d6a9c54fbb63cd
parent352fc0ae2866eb0b222d90d51299c05222af8df5 (diff)
fdo#69358 Introduction of native Mac OSX Toolbar, based on CoreUI
Change-Id: I7774368a9b59e8087573348f6061b6a220fea130
-rw-r--r--vcl/Library_vcl.mk2
-rw-r--r--vcl/osx/salframe.cxx3
-rw-r--r--vcl/osx/salnativewidgets.cxx39
3 files changed, 39 insertions, 5 deletions
diff --git a/vcl/Library_vcl.mk b/vcl/Library_vcl.mk
index 204a0d62c530..04fc6cc8bf5a 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 6b236d677984..e5926497f02f 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 299e1f9ba97f..f0224fbf6b8c 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);
+}
+
+@interface NSWindow(CoreUIRendererPrivate)
++ (CUIRendererRef)coreUIRenderer;
+@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;